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

# Ingest or update conversation

> Ingest or update a conversation



## OpenAPI

````yaml https://api.supermemory.ai/v4/openapi post /v4/conversations
openapi: 3.1.0
info:
  title: supermemory API
  description: >-
    The Memory API for the AI era. OpenAPI operations include x-codeSamples for
    the official TypeScript and Python SDKs (Mintlify-compatible).
  version: 3.0.0
servers:
  - description: Production Server
    url: https://api.supermemory.ai
security:
  - bearerAuth: []
tags:
  - name: Ingest
    description: Ingest documents, files, URLs, conversations, and other content
  - name: Recall (Search)
    description: >-
      Semantic recall across your content — supports memories, hybrid, and
      documents modes
  - name: Profiles
    description: >-
      Entity profiles for users, participants, or any entity — includes profile
      search
  - name: Content Management
    description: List, get, update, and delete content and memories
  - name: Spaces
    description: Organize content into spaces (container tags)
  - name: Knowledge Graph
    description: Knowledge graph and entity relationships
  - name: Connections
    description: External service integrations
  - name: Settings
    description: Organization settings
  - name: Analytics
    description: Usage analytics and insights
  - name: Documents
    description: List, get, and search documents
paths:
  /v4/conversations:
    post:
      tags:
        - Ingest
      summary: Ingest or update conversation
      description: Ingest or update a conversation
      operationId: postV4Conversations
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                conversationId:
                  type: string
                  minLength: 1
                  maxLength: 255
                messages:
                  minItems: 1
                  type: array
                  items:
                    type: object
                    properties:
                      role:
                        type: string
                        enum:
                          - user
                          - assistant
                          - system
                          - tool
                      content:
                        anyOf:
                          - type: string
                          - type: array
                            items:
                              anyOf:
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: text
                                    text:
                                      type: string
                                  required:
                                    - type
                                    - text
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: image_url
                                    imageUrl:
                                      type: object
                                      properties:
                                        url:
                                          type: string
                                          format: uri
                                      required:
                                        - url
                                  required:
                                    - type
                                    - imageUrl
                      name:
                        type: string
                      tool_calls:
                        type: array
                        items: {}
                      tool_call_id:
                        type: string
                    required:
                      - role
                      - content
                containerTags:
                  type: array
                  items:
                    type: string
                metadata:
                  type: object
                  propertyNames:
                    type: string
                  additionalProperties:
                    anyOf:
                      - type: string
                      - type: number
                      - type: boolean
              required:
                - conversationId
                - messages
      responses:
        '200':
          description: Conversation ingested/updated successfully
        '400':
          description: Invalid request parameters
        '401':
          description: Unauthorized
        '402':
          description: Quota exceeded
        '500':
          description: Internal server error
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl -X POST "https://api.supermemory.ai/v4/conversations" \
              -H "Authorization: Bearer $SUPERMEMORY_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                "messages": [
                  { "role": "user", "content": "Just got back from Tokyo." },
                  { "role": "assistant", "content": "Glad it went well!" },
                  { "role": "user", "content": "Sarah is being promoted to VP of Product." }
                ],
                "containerTag": "user_123",
                "customId": "chat_offsite_2026"
              }'
        - lang: typescript
          label: TypeScript SDK
          source: >-
            import Supermemory from "supermemory";


            const client = new Supermemory({
              apiKey: process.env.SUPERMEMORY_API_KEY,
            });


            // Prefer client.add with a conversation transcript for most apps.

            // Use /v4/conversations when you have structured turns:

            const res = await
            fetch("https://api.supermemory.ai/v4/conversations", {
              method: "POST",
              headers: {
                Authorization: `Bearer ${process.env.SUPERMEMORY_API_KEY}`,
                "Content-Type": "application/json",
              },
              body: JSON.stringify({
                messages: [
                  { role: "user", content: "Sarah is being promoted to VP of Product." },
                ],
                containerTag: "user_123",
                customId: "chat_offsite_2026",
              }),
            });
components:
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````