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

# Update memory context data

> This endpoint updates memory context data.



## OpenAPI

````yaml POST /api/v1/context/memory/update
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/memory/update:
    post:
      tags:
        - context
      summary: Update memory context data
      description: This endpoint updates memory context data.
      operationId: updateContextAsMemory
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - sessionId
                - contents
              properties:
                sessionId:
                  type: string
                  description: The ID of the memory to update
                contents:
                  type: array
                  items:
                    type: object
                    properties:
                      content:
                        type: string
                        description: The content of the memory entry
                      metadata:
                        type: object
                        additionalProperties: true
                        description: Additional metadata for the memory entry
                      role:
                        type: string
                        description: Role of the message (e.g., user, assistant)
                      id:
                        type: string
                        description: Unique ID for the message
                      createdAt:
                        type: string
                        description: Creation timestamp
                  description: Array of updated content objects
            example:
              sessionId: support-thread-TCK-1234
              contents:
                - content: Customer asked about pricing for the Scale plan.
                  metadata:
                    messageId: msg-1
                  role: user
                  id: msg-1
                  createdAt: '2025-01-10T12:34:56.000Z'
                - content: Updated answer about the Scale plan pricing after discounts.
                  metadata:
                    messageId: msg-2
                  role: assistant
                  id: msg-2
                  createdAt: '2025-01-10T12:36:00.000Z'
      responses:
        '200':
          description: Memory context updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MemoryUpdateSuccess'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: Payment Required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    MemoryUpdateSuccess:
      type: object
      required:
        - success
        - memory_id
        - updated_entries
      properties:
        success:
          type: boolean
          example: true
        memory_id:
          type: string
          example: support-thread-TCK-1234
        updated_entries:
          type: number
          example: 2
    ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          example: Invalid job id
        status:
          type: number
          example: 400
        error:
          type: object
          example: Error details
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: UNAUTHORIZED
            message:
              type: string
              example: User not authenticated
            details:
              type: object
              additionalProperties: true
        statusText:
          type: string
          description: Error message (detailed in debug mode)
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````