> ## Documentation Index
> Fetch the complete documentation index at: https://getalchemystai.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Asynchronously queue context data to add to the context processor

> This endpoint accepts context data and queues it for asynchronous processing by the context processor. It returns a success or error response depending on the queuing result.



## OpenAPI

````yaml POST /api/v1/context/add-async
openapi: 3.1.0
info:
  title: Alchemyst AI API v1 documentation
  version: 1.0.0
  description: v1 API documentation for Alchemyst AI
servers:
  - url: https://platform-backend.getalchemystai.com
    description: production
security:
  - bearerAuth: []
tags: []
paths:
  /api/v1/context/add-async:
    post:
      tags:
        - context
      summary: Asynchronously queue context data to add to the context processor
      description: >-
        This endpoint accepts context data and queues it for asynchronous
        processing by the context processor. It returns a success or error
        response depending on the queuing result.
      operationId: addContextAsync
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - documents
                - context_type
                - source
                - scope
              properties:
                documents:
                  type: array
                  items:
                    type: object
                    properties:
                      content:
                        type: string
                        description: The content of the document
                    additionalProperties:
                      type: string
                  description: Array of documents with content and additional metadata
                source:
                  type: string
                  description: The source of the context data
                context_type:
                  type: string
                  enum:
                    - resource
                    - conversation
                    - instruction
                  description: Type of context being added
                scope:
                  type: string
                  enum:
                    - internal
                    - external
                  default: internal
                  description: Scope of the context
                metadata:
                  type: object
                  description: Additional metadata for the context
                  properties:
                    fileName:
                      type: string
                      description: Name of the file
                    fileType:
                      type: string
                      description: Type/MIME of the file
                    groupName:
                      type: array
                      items:
                        type: string
                      description: Array of Group Name to which the file belongs to
                    lastModified:
                      type: string
                      description: Last modified timestamp
                    fileSize:
                      type: number
                      description: Size of the file in bytes
            example:
              documents:
                - content: Customer asked about pricing for the Scale plan.
              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
      responses:
        '201':
          description: Context queued successfully
          content:
            application/json:
              schema:
                type: object
                required:
                  - queued
                  - jobId
                properties:
                  queued:
                    type: boolean
                    example: true
                  jobId:
                    type: string
                    example: context-add-123456
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - message
                  - status
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    description: Error details
                  status:
                    type: number
                    example: 400
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
        '402':
          description: Payment Required
          content:
            application/json:
              schema:
                type: object
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
        '404':
          description: Not Found - Invalid context data format
          content:
            application/json:
              schema:
                type: object
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  response:
                    type: string
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````