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

# Add messages [OSS + Cloud]



## OpenAPI

````yaml /api-reference/openapi.json post /api/v2/memory/add
openapi: 3.1.0
info:
  title: EverOS Cloud Memory API
  version: 2.0.0
  license:
    name: Apache-2.0
    identifier: Apache-2.0
  contact:
    name: EverMind AI
    email: service@evermind.ai
    url: https://github.com/EverMind-AI/everos-cloud-sdk-python
  description: >-
    Official Python client for the EverOS Cloud Memory API. Add, search,
    retrieve, and manage long-term memory for your AI applications over a typed
    interface (pydantic v2, with full type hints). Install and usage guides:
    https://github.com/EverMind-AI/everos-cloud-sdk-python
servers:
  - url: https://api.evermind.ai
    description: Production
security:
  - BearerAuth: []
paths:
  /api/v2/memory/add:
    post:
      tags:
        - Memory
      summary: Add messages [OSS + Cloud]
      operationId: addMemory
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddInput'
        required: true
      responses:
        '200':
          description: Synchronous write result (async_mode=false).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessEnvelope_AddData_'
        '202':
          description: Accepted for asynchronous processing (async_mode=true, default).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessEnvelope_AddData_'
        '401':
          description: Missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
        '403':
          description: Authenticated but not permitted for this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Rate limit or quota exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
components:
  schemas:
    AddInput:
      properties:
        app_id:
          type: string
          title: App Id
          default: default
        project_id:
          type: string
          title: Project Id
          default: default
        session_id:
          type: string
          maxLength: 128
          minLength: 1
          title: Session Id
        mode:
          type: string
          enum:
            - chat
            - agent
          title: Mode
          default: chat
        messages:
          items:
            $ref: '#/components/schemas/MessageItem'
          type: array
          maxItems: 500
          minItems: 1
          title: Messages
        async_mode:
          type: boolean
          default: true
          title: Async Mode
          description: >-
            Selects the write path. true (default): validated and enqueued
            asynchronously → HTTP 202 with status "queued". false: forwarded
            synchronously to the engine, returning its 200 result and surfacing
            write errors directly. Extraction is always asynchronous
            (flush-triggered).
      type: object
      required:
        - session_id
        - messages
      title: AddInput
      example:
        session_id: session-1
        messages:
          - sender_id: user-1
            role: user
            timestamp: 1700000000
            content: I love hiking in the mountains
    SuccessEnvelope_AddData_:
      properties:
        request_id:
          type: string
          title: Request Id
          description: Request trace id (peer to data)
        data:
          $ref: '#/components/schemas/AddData'
          description: Endpoint-defined business result
      type: object
      required:
        - request_id
        - data
      title: SuccessEnvelope[AddData]
    GatewayError:
      type: object
      additionalProperties: true
      description: >-
        Gateway error body. NOTE: shape is not yet uniform across auth/quota/
        rate-limit paths — treat fields as best-effort. Commonly includes a
        `code`/`message` (flat) or an `error` object/string with a `message`.
      title: GatewayError
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MessageItem:
      properties:
        sender_id:
          type: string
          title: Sender Id
        sender_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Sender Name
        role:
          type: string
          enum:
            - user
            - assistant
            - tool
          title: Role
        timestamp:
          type: integer
          title: Timestamp
        content:
          anyOf:
            - type: string
            - items:
                $ref: '#/components/schemas/ContentItem'
              type: array
          title: Content
        tool_calls:
          anyOf:
            - items:
                $ref: '#/components/schemas/ToolCall'
              type: array
            - type: 'null'
          title: Tool Calls
        tool_call_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Call Id
      type: object
      required:
        - sender_id
        - role
        - timestamp
        - content
      title: MessageItem
      description: >-
        One message in an /add batch (spec §2). ``content`` accepts a plain
        string

        (shorthand for a single text ContentItem) or an explicit ContentItem
        list.
    AddData:
      properties:
        message_count:
          type: integer
          title: Message Count
        status:
          type: string
          enum:
            - accumulated
            - extracted
            - queued
          title: Status
          description: >-
            "queued" — async enqueue accepted (HTTP 202).
            "accumulated"/"extracted" — synchronous write outcome (HTTP 200,
            async_mode=false).
      type: object
      required:
        - message_count
        - status
      title: AddData
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ContentItem:
      properties:
        type:
          type: string
          enum:
            - text
            - audio
            - image
            - doc
            - pdf
            - html
            - email
          title: Type
        text:
          anyOf:
            - type: string
            - type: 'null'
          title: Text
        source:
          anyOf:
            - type: string
            - type: 'null'
          title: Source
        base64:
          anyOf:
            - type: string
            - type: 'null'
          title: Base64
        uri:
          anyOf:
            - type: string
            - type: 'null'
          title: Uri
        ext:
          anyOf:
            - type: string
            - type: 'null'
          title: Ext
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        source_info:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Source Info
        extras:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Extras
      type: object
      required:
        - type
      title: ContentItem
      description: >-
        A single content element (appendix A). Current phase: only
        ``type="text"``.
    ToolCall:
      properties:
        id:
          type: string
          title: Id
        type:
          type: string
          title: Type
          default: function
        function:
          $ref: '#/components/schemas/ToolCallFunction'
      type: object
      required:
        - id
        - function
      title: ToolCall
    ToolCallFunction:
      properties:
        name:
          type: string
          title: Name
        arguments:
          type: string
          title: Arguments
      type: object
      required:
        - name
        - arguments
      title: ToolCallFunction
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 'API key issued by EverOS, sent as `Authorization: Bearer <api_key>`.'

````