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

# Batch Create Memories

> Create up to 100 session memories in one request.



## OpenAPI

````yaml /openapi.yaml post /workspaces/{workspaceId}/agents/{agentId}/sessions/{sessionId}/memories/batch
openapi: 3.1.0
info:
  title: Actx0 API
  version: 1.0.0
  description: >-
    REST API for Actx0 workspaces, access keys, agents, sessions, messages,
    memories, prompts, and knowledge documents.


    Authenticate with `X-Access-Key` (workspace), `X-API-Key` (user), or a
    dashboard session.
servers:
  - url: https://app.actx0.com/api/v1
    description: Actx0 cloud
security: []
tags:
  - name: Me
    description: Inspect the authenticated access key or API key
  - name: API Keys
    description: User API keys for X-API-Key auth
  - name: Workspaces
    description: Team workspaces
  - name: Access Keys
    description: Scoped workspace keys for agents and SDKs
  - name: Agents
    description: Agents inside a workspace
  - name: Sessions
    description: Agent conversation sessions
  - name: Messages
    description: Session messages and semantic search
  - name: Memories
    description: Session memories, search, batch, and regenerate
  - name: Prompts
    description: Versioned prompts
  - name: Knowledge
    description: Document upload and semantic search
paths:
  /workspaces/{workspaceId}/agents/{agentId}/sessions/{sessionId}/memories/batch:
    post:
      tags:
        - Memories
      summary: Batch Create Memories
      description: Create up to 100 session memories in one request.
      operationId: batchCreateMemories
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - $ref: '#/components/parameters/AgentId'
        - $ref: '#/components/parameters/SessionId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchCreateMemoriesRequest'
            example:
              memories:
                - kind: preference
                  content: User prefers dark mode
                - kind: fact
                  content: User is on the Pro plan
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MemoryBatch'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - AccessKeyAuth: []
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >
            curl -X POST
            'https://app.actx0.com/api/v1/workspaces/<workspaceId>/agents/<agentId>/sessions/<sessionId>/memories/batch'
            \
              -H "X-Access-Key: YOUR_ACCESS_KEY" \
              -H "Content-Type: application/json" \
              -H "Accept: application/json" \
              -d '{"memories": [{"kind": "preference", "content": "User prefers dark mode"}, {"kind": "fact", "content": "User is on the Pro plan"}]}'
        - lang: python
          label: pctx0
          source: |
            from pctx0 import Pctx0Client

            client = Pctx0Client(
                access_key="YOUR_ACCESS_KEY",
                workspace_id="YOUR_WORKSPACE_ID",
            )

            memories = client.memory.create(
                "AGENT_ID",
                "SESSION_ID",
                [
                    {"kind": "fact", "content": "Uses TypeScript"},
                    {"kind": "preference", "content": "Prefers dark mode"},
                ],
            )
        - lang: javascript
          label: nctx0
          source: >
            import { Nctx0Client } from "@actx0/nctx0";


            const client = new Nctx0Client({
              accessKey: "YOUR_ACCESS_KEY",
              workspaceId: "YOUR_WORKSPACE_ID",
            });


            const memories = await client.memory.create("AGENT_ID",
            "SESSION_ID", [
              { kind: "fact", content: "Uses TypeScript" },
              { kind: "preference", content: "Prefers dark mode" },
            ]);
        - lang: go
          label: gtcx0
          source: "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/Actx0/Gctx0\"\n)\n\nfunc main() {\n\tclient := gctx0.NewClient(\n\t\tgctx0.WithAccessKey(\"YOUR_ACCESS_KEY\"),\n\t\tgctx0.WithWorkspaceId(\"YOUR_WORKSPACE_ID\"),\n\t)\n\tdefer client.Close()\n\tctx := context.Background()\n\tmemories, err := client.Memory.CreateBatch(ctx, \"AGENT_ID\", \"SESSION_ID\", []gctx0.MemoryInput{\n\t\t{Kind: gctx0.MemoryKindFact, Content: \"Uses TypeScript\"},\n\t\t{Kind: gctx0.MemoryKindPreference, Content: \"Prefers dark mode\"},\n\t})\n\t_ = memories\n\t_ = err\n}\n"
components:
  parameters:
    WorkspaceId:
      name: workspaceId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      example: 11111111-1111-1111-1111-111111111111
    AgentId:
      name: agentId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      example: 22222222-2222-2222-2222-222222222222
    SessionId:
      name: sessionId
      in: path
      required: true
      description: Internal session UUID (not externalId).
      schema:
        type: string
        format: uuid
      example: 33333333-3333-3333-3333-333333333333
  schemas:
    BatchCreateMemoriesRequest:
      type: object
      required:
        - memories
      properties:
        memories:
          type: array
          minItems: 1
          maxItems: 100
          items:
            $ref: '#/components/schemas/CreateMemoryRequest'
    MemoryBatch:
      type: object
      required:
        - memories
      properties:
        memories:
          type: array
          items:
            $ref: '#/components/schemas/Memory'
    Error:
      type: object
      required:
        - errorMessage
      properties:
        errorMessage:
          type: string
          example: Name is required
    CreateMemoryRequest:
      type: object
      required:
        - kind
        - content
      properties:
        kind:
          type: string
          enum:
            - summary
            - fact
            - preference
            - short_lived
            - long_lived
          example: preference
        content:
          type: string
          example: User prefers dark mode
        meta:
          type: string
          description: Optional JSON encoded as a string.
          example: '{"source":"chat"}'
    Memory:
      type: object
      required:
        - id
        - sessionId
        - kind
        - content
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
          format: uuid
          example: 44444444-4444-4444-4444-444444444444
        sessionId:
          type: string
          format: uuid
          example: 33333333-3333-3333-3333-333333333333
        kind:
          type: string
          enum:
            - summary
            - fact
            - preference
            - short_lived
            - long_lived
          example: preference
        content:
          type: string
          example: User prefers dark mode
        meta: {}
        createdAt:
          type: string
          format: date-time
          example: '2026-07-01T12:00:00Z'
        updatedAt:
          type: string
          format: date-time
          example: '2026-07-01T12:00:00Z'
  securitySchemes:
    AccessKeyAuth:
      type: apiKey
      in: header
      name: X-Access-Key
      description: Workspace access key for agent/runtime integrations.
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: User API key for management and automation.

````