Skip to main content
POST
/
api
/
v1
/
context
/
add-async
Add context data to the context processor
curl --request POST \
  --url https://platform-backend.getalchemystai.com/api/v1/context/add-async \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "documents": [
    {
      "content": "Customer asked about pricing for the Scale plan.",
      "containerTag": "support-emails",
      "ticketId": "TCK-1234"
    }
  ],
  "source": "support-inbox",
  "context_type": "resource",
  "scope": "internal",
  "metadata": {
    "fileName": "support_thread_TCK-1234.txt",
    "fileType": "text/plain",
    "groupName": [
      "support",
      "pricing"
    ],
    "lastModified": "2025-01-10T12:34:56.000Z",
    "fileSize": 2048
  }
}
'
{
  "queued": true,
  "jobId": "context-add-123456"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
documents
object[]

Array of documents with content and additional metadata

source
string

The source of the context data

context_type
enum<string>

Type of context being added

Available options:
resource,
conversation,
instruction
scope
enum<string>
default:internal

Scope of the context

Available options:
internal,
external
metadata
object

Additional metadata for the context

Response

Context added successfully

queued
boolean
Example:

true

jobId
string
Example:

"context-add-123456"