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

# Add Memory Item

> Add an item (preference/guardrail/fact) to one of the caller's memories.



## OpenAPI

````yaml /api/openapi.json post /v1/memories/{slug_or_id}/items
openapi: 3.1.0
info:
  title: MeshAPI
  description: One key, all AI models.
  version: 0.1.0
servers:
  - url: https://api.meshapi.ai
security:
  - BearerAuth: []
paths:
  /v1/memories/{slug_or_id}/items:
    post:
      tags:
        - Memory
      summary: Add Memory Item
      description: Add an item (preference/guardrail/fact) to one of the caller's memories.
      operationId: add_memory_item
      parameters:
        - name: slug_or_id
          in: path
          required: true
          schema:
            type: string
            title: Slug Or Id
        - in: header
          name: X-Mesh-Version
          required: false
          schema:
            type: string
            enum:
              - 2026-08
            default: 2026-08
          example: 2026-08
          description: >-
            Dated version of the API contract to pin this request to. Omit it
            and the request is served under `2026-08` — the oldest supported
            version, so an existing integration is never moved by a release. A
            malformed or unsupported value is rejected with `400
            invalid_api_version` rather than falling back silently. The version
            actually served is echoed as `X-Mesh-Version` on every response,
            including errors.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMemoryItemRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MemoryItemSummary'
        '401':
          description: Missing or invalid credentials
        '404':
          description: Memory not found or not owned by caller
        '422':
          description: Invalid item_type, or blank content
      security:
        - BearerAuth: []
components:
  schemas:
    CreateMemoryItemRequest:
      properties:
        item_type:
          type: string
          title: Item Type
        key:
          anyOf:
            - type: string
            - type: 'null'
          title: Key
        content:
          type: string
          title: Content
        position:
          anyOf:
            - type: integer
            - type: 'null'
          title: Position
      type: object
      required:
        - item_type
        - content
      title: CreateMemoryItemRequest
      example:
        content: Always respond in a concise, professional tone.
        item_type: preference
        key: tone
        position: 0
    MemoryItemSummary:
      properties:
        id:
          type: string
          title: Id
        memory_id:
          type: string
          title: Memory Id
        item_type:
          type: string
          title: Item Type
        key:
          anyOf:
            - type: string
            - type: 'null'
          title: Key
        content:
          type: string
          title: Content
        position:
          type: integer
          title: Position
        created_at:
          type: string
          title: Created At
        updated_at:
          type: string
          title: Updated At
        expires_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Expires At
      type: object
      required:
        - id
        - memory_id
        - item_type
        - key
        - content
        - position
        - created_at
        - updated_at
      title: MemoryItemSummary
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Enter your MeshAPI key (`rsk_...`) — sent as `Authorization: Bearer
        <key>`.

````