---
title: "Add context data to the context processor"
method: POST
path: "/api/v1/context/add"
tags: ["context"]
---

# Add context data to the context processor

`POST /api/v1/context/add`

This endpoint accepts context data and sends it to a context processor for further handling. It returns a success or error response depending on the result from the context processor.

## Request body

- object
  - `documents` object[], required — Array of documents with content and additional metadata
    - `content` string — The content of the document
  - `source` string, required — The source of the context data
  - `context_type` 'resource' | 'conversation' | 'instruction', required — Type of context being added
  - `scope` 'internal' | 'external', required — Scope of the context
  - `metadata` object — Additional metadata for the context
    - `fileName` string — Name of the file
    - `fileType` string — Type/MIME of the file
    - `groupName` string[] — Array of Group Name to which the file belongs to
    - `lastModified` string — Last modified timestamp
    - `fileSize` number — Size of the file in bytes

## Response `201`

Context added successfully

- ContextAddSuccess
  - `success` boolean, required
  - `context_id` string, required
  - `processed_documents` number

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `402` — Payment Required
- `403` — Forbidden
- `404` — Not Found - Invalid context data format
- `500` — Internal Server Error

## Changes

- **2026-01-03** `510cbb709bed` — 3 breaking, 1 warning, 17 info
  - the request property `context_type` became required
  - the request property `documents` became required
  - the request property `source` became required
  - removed the optional property `response` from the response with the `500` status
  - …17 more
- **2025-12-24** `3f676384b4bb` — 1 info
  - api operation id `addContextSync` was added
- **2025-10-23** `cdd0680c6405` — 1 breaking
  - the `metadata/groupName` request property type/format changed from `string[]`/`` to `array`/``
- **2025-10-17** `ee3a4ec4897b` — 1 info
  - added the new optional request property `metadata/groupName`
- **2025-09-19** `6e7d56da06e5` — 1 info
  - added the new optional request property `context_type`

[Full history](https://skmtc.dev/alchemyst-ai/apis/alchemyst-ai-api-v1-documentation/changes/api/v1/context/add/post.md)

---

[API](https://skmtc.dev/alchemyst-ai/apis/alchemyst-ai-api-v1-documentation.md) · [All operations](https://skmtc.dev/alchemyst-ai/apis/alchemyst-ai-api-v1-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/alchemyst-ai/alchemyst-ai-api-v1-documentation/revisions/af43a0360c78/schema)
