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

# Batch Update Memories

> Update multiple memories in a single batch request using the Mem0 API PUT endpoint.



## OpenAPI

````yaml put /v1/batch/
openapi: 3.0.1
info:
  title: Mem0 API Docs
  description: mem0.ai API Docs
  contact:
    email: support@mem0.ai
  license:
    name: Apache 2.0
  version: v1
servers:
  - url: https://api.mem0.ai/
security:
  - ApiKeyAuth: []
paths:
  /v1/batch/:
    put:
      tags:
        - memories
      description: Batch update multiple memories (up to 1000) in a single API call.
      operationId: memories_batch_update
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                memories:
                  type: array
                  items:
                    type: object
                    required:
                      - memory_id
                    properties:
                      memory_id:
                        type: string
                        format: uuid
                        description: The unique identifier of the memory to update
                      text:
                        type: string
                        description: The new text content for the memory
                      metadata:
                        type: object
                        additionalProperties: true
                        description: Updated metadata to associate with the memory.
                  maxItems: 1000
              required:
                - memories
        required: true
      responses:
        '200':
          description: Successfully updated memories
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Successfully updated 2 memories
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: >-
                      Maximum of 1000 memories can be updated in a single
                      request
      x-code-samples:
        - lang: Python
          source: |-
            # To use the Python SDK, install the package:
            # pip install mem0ai

            from mem0 import MemoryClient
            client = MemoryClient(api_key="your_api_key")

            update_memories = [
                {
                    "memory_id": "285ed74b-6e05-4043-b16b-3abd5b533496",
                    "text": "Watches football"
                },
                {
                    "memory_id": "2c9bd859-d1b7-4d33-a6b8-94e0147c4f07",
                    "text": "Likes to travel"
                }
            ]

            response = client.batch_update(update_memories)
            print(response)
        - lang: JavaScript
          source: |-
            // To use the JavaScript SDK, install the package:
            // npm i mem0ai

            import MemoryClient from 'mem0ai';
            const client = new MemoryClient({ apiKey: "your-api-key" });

            const updateMemories = [
                {
                    memoryId: "285ed74b-6e05-4043-b16b-3abd5b533496",
                    text: "Watches football"
                },
                {
                    memoryId: "2c9bd859-d1b7-4d33-a6b8-94e0147c4f07",
                    text: "Likes to travel"
                }
            ];

            client.batchUpdate(updateMemories)
                .then(response => console.log('Batch update response:', response))
                .catch(error => console.error(error));
        - lang: cURL
          source: |-
            curl -X PUT "https://api.mem0.ai/v1/batch/" \
                 -H "Authorization: Token your-api-key" \
                 -H "Content-Type: application/json" \
                 -d '{
                     "memories": [
                         {
                             "memory_id": "285ed74b-6e05-4043-b16b-3abd5b533496",
                             "text": "Watches football"
                         },
                         {
                             "memory_id": "2c9bd859-d1b7-4d33-a6b8-94e0147c4f07",
                             "text": "Likes to travel"
                         }
                     ]
                 }'
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API key authentication. Prefix your Mem0 API key with 'Token '. Example:
        'Token your_api_key'

````