---
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

---

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