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

# Delete memory context data

> Deletes memory context data based on provided parameters.



## OpenAPI

````yaml POST /api/v1/context/memory/delete
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/delete:
    post:
      tags:
        - context
      summary: Delete memory context data
      description: Deletes memory context data based on provided parameters.
      operationId: deleteContextAsMemory
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - memoryId
                - organization_id
              properties:
                memoryId:
                  type: string
                  description: The ID of the memory to delete
                user_id:
                  type: string
                  description: Optional user ID
                  deprecated: true
                  nullable: true
                organization_id:
                  type: string
                  description: Organization ID
                  nullable: true
                by_doc:
                  type: boolean
                  description: Delete by document flag
                  default: true
                  nullable: true
                by_id:
                  type: boolean
                  description: Delete by ID flag
                  default: false
                  nullable: true
            example:
              memoryId: support-thread-TCK-1234
              organization_id: org_01HXYZABC
              by_doc: true
              by_id: false
      responses:
        '204':
          description: Successfully deleted memory context
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          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:
    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

````