Start HereQuickstart

Quickstart

Get started with Ctxfy API in minutes.

Overview

Resume projects in 30 seconds. Cut token costs. Automate context capture—get started with the API below.

This guide walks you through creating a space, uploading a source (e.g. AI conversation or document), and checking processing status via the Ctxfy API.

Prerequisites

  • Base URL of the API (e.g. https://api.ctxfy.com or your deployment)
  • API Key from the Ctxfy dashboard or API

1. Create a space

curl -X POST https://api.ctxfy.com/v1/spaces \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "My Project", "description": "AI context for my project"}'

Response includes data.id — the spaceId for subsequent calls.

2. Create a collection (optional)

Organize sources in a collection:

curl -X POST https://api.ctxfy.com/v1/spaces/{spaceId}/collections \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Documents", "parentId": null}'

Use parentId to create nested collections.

3. Create a source

Create a source by type. For pasted content (e.g. AI conversation), use CONTENT:

curl -X POST https://api.ctxfy.com/v1/spaces/{spaceId}/sources \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "CONTENT",
    "initial_data": {"data": "Your AI conversation or document text here..."},
    "instructions": {},
    "name": "My Chat Snapshot"
  }'

For URLs use URI, for uploaded files use FILE. See Concepts for initial_data per type.

4. Upload a file (S3 presigned URL)

For file-based sources, get a presigned URL first:

curl -X POST https://api.ctxfy.com/v1/upload/s3 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"filename": "report.pdf", "contentType": "application/pdf", "size": 102400}'

Response: uploadUrl, publicUrl, fileKey. Upload the file with PUT to uploadUrl, then create a source of type FILE with initial_data: { "data": "<fileKey>" }.

5. Check source status

curl https://api.ctxfy.com/v1/sources/{sourceId} \
  -H "Authorization: Bearer YOUR_API_KEY"

Status lifecycle: CREATEDPENDINGPROCESSINGCOMPLETED or FAILED.

Next steps