Letta Groups API

Coordinate multi-agent groups (supervisor/worker, round-robin, sleep-time).

Documentation

Specifications

Schemas & Data

📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-agent-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-block-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-tool-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-source-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-run-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-group-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-identity-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-message-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-passage-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-archive-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-job-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-llm-config-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-embedding-config-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-provider-schema.json

Other Resources

OpenAPI Specification

letta-groups-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Letta Admin Groups API
  version: 1.0.0
  description: REST API for Letta, the stateful agents platform. Manage agents, memory blocks, archival passages, sources, custom tools, MCP servers, multi-agent groups, runs, and streaming responses. Available as Letta Cloud (managed) at https://api.letta.com/v1 and as the self-hosted open-source server (Apache-2.0) typically run at http://localhost:8283.
  contact:
    name: Letta
    url: https://www.letta.com/
    email: support@letta.com
  license:
    name: Apache-2.0
    url: https://github.com/letta-ai/letta/blob/main/LICENSE
  x-logo:
    url: https://www.letta.com/favicon.ico
servers:
- url: https://api.letta.com
  description: Letta Cloud (managed)
- url: https://app.letta.com
  description: Letta Cloud (app)
- url: http://localhost:8283
  description: Self-hosted Letta server
security:
- bearerAuth: []
tags:
- name: Groups
  description: Coordinate multi-agent groups (supervisor/worker, round-robin, sleep-time).
paths:
  /v1/groups/:
    get:
      tags:
      - Groups
      summary: List Groups
      description: Fetch all multi-agent groups matching query.
      operationId: list_groups
      deprecated: true
      parameters:
      - name: manager_type
        in: query
        required: false
        schema:
          anyOf:
          - $ref: '#/components/schemas/ManagerType'
          - type: 'null'
          description: Search groups by manager type
          title: Manager Type
        description: Search groups by manager type
      - name: before
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Group ID cursor for pagination. Returns groups that come before this group ID in the specified sort order
          title: Before
        description: Group ID cursor for pagination. Returns groups that come before this group ID in the specified sort order
      - name: after
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Group ID cursor for pagination. Returns groups that come after this group ID in the specified sort order
          title: After
        description: Group ID cursor for pagination. Returns groups that come after this group ID in the specified sort order
      - name: limit
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
          - type: 'null'
          description: Maximum number of groups to return
          default: 50
          title: Limit
        description: Maximum number of groups to return
      - name: order
        in: query
        required: false
        schema:
          enum:
          - asc
          - desc
          type: string
          description: Sort order for groups by creation time. 'asc' for oldest first, 'desc' for newest first
          default: asc
          title: Order
        description: Sort order for groups by creation time. 'asc' for oldest first, 'desc' for newest first
      - name: order_by
        in: query
        required: false
        schema:
          const: created_at
          type: string
          description: Field to sort by
          default: created_at
          title: Order By
        description: Field to sort by
      - name: project_id
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Search groups by project id
          title: Project Id
        description: Search groups by project id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Group'
                title: Response List Groups
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
      - Groups
      summary: Create Group
      description: Create a new multi-agent group with the specified configuration.
      operationId: create_group
      deprecated: true
      parameters:
      - name: X-Project
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: The project slug to associate with the group (cloud only).
          title: X-Project
        description: The project slug to associate with the group (cloud only).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GroupCreate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Group'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/groups/count:
    get:
      tags:
      - Groups
      summary: Count Groups
      description: Get the count of all groups associated with a given user.
      operationId: count_groups
      deprecated: true
      parameters: []
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: integer
                title: Response Count Groups
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/groups/{group_id}:
    get:
      tags:
      - Groups
      summary: Retrieve Group
      description: Retrieve the group by id.
      operationId: retrieve_group
      deprecated: true
      parameters:
      - name: group_id
        in: path
        required: true
        schema:
          type: string
          minLength: 42
          maxLength: 42
          pattern: ^group-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: The ID of the group in the format 'group-<uuid4>'
          examples:
          - group-123e4567-e89b-42d3-8456-426614174000
          title: Group Id
        description: The ID of the group in the format 'group-<uuid4>'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Group'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
      - Groups
      summary: Modify Group
      description: Create a new multi-agent group with the specified configuration.
      operationId: modify_group
      deprecated: true
      parameters:
      - name: group_id
        in: path
        required: true
        schema:
          type: string
          minLength: 42
          maxLength: 42
          pattern: ^group-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: The ID of the group in the format 'group-<uuid4>'
          examples:
          - group-123e4567-e89b-42d3-8456-426614174000
          title: Group Id
        description: The ID of the group in the format 'group-<uuid4>'
      - name: X-Project
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: The project slug to associate with the group (cloud only).
          title: X-Project
        description: The project slug to associate with the group (cloud only).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GroupUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Group'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Groups
      summary: Delete Group
      description: Delete a multi-agent group.
      operationId: delete_group
      deprecated: true
      parameters:
      - name: group_id
        in: path
        required: true
        schema:
          type: string
          minLength: 42
          maxLength: 42
          pattern: ^group-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: The ID of the group in the format 'group-<uuid4>'
          examples:
          - group-123e4567-e89b-42d3-8456-426614174000
          title: Group Id
        description: The ID of the group in the format 'group-<uuid4>'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/groups/{group_id}/messages/{message_id}:
    patch:
      tags:
      - Groups
      summary: Modify Group Message
      description: Update the details of a message associated with an agent.
      operationId: modify_group_message
      deprecated: true
      parameters:
      - name: group_id
        in: path
        required: true
        schema:
          type: string
          minLength: 42
          maxLength: 42
          pattern: ^group-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: The ID of the group in the format 'group-<uuid4>'
          examples:
          - group-123e4567-e89b-42d3-8456-426614174000
          title: Group Id
        description: The ID of the group in the format 'group-<uuid4>'
      - name: message_id
        in: path
        required: true
        schema:
          type: string
          minLength: 44
          maxLength: 44
          pattern: ^message-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: The ID of the message in the format 'message-<uuid4>'
          examples:
          - message-123e4567-e89b-42d3-8456-426614174000
          title: Message Id
        description: The ID of the message in the format 'message-<uuid4>'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              anyOf:
              - $ref: '#/components/schemas/UpdateSystemMessage'
              - $ref: '#/components/schemas/UpdateUserMessage'
              - $ref: '#/components/schemas/UpdateReasoningMessage'
              - $ref: '#/components/schemas/UpdateAssistantMessage'
              title: Request
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                oneOf:
                - $ref: '#/components/schemas/SystemMessage'
                - $ref: '#/components/schemas/UserMessage'
                - $ref: '#/components/schemas/ReasoningMessage'
                - $ref: '#/components/schemas/HiddenReasoningMessage'
                - $ref: '#/components/schemas/ToolCallMessage'
                - $ref: '#/components/schemas/ToolReturnMessage'
                - $ref: '#/components/schemas/AssistantMessage'
                - $ref: '#/components/schemas/ApprovalRequestMessage'
                - $ref: '#/components/schemas/ApprovalResponseMessage'
                - $ref: '#/components/schemas/SummaryMessage'
                - $ref: '#/components/schemas/EventMessage'
                discriminator:
                  propertyName: message_type
                  mapping:
                    system_message: '#/components/schemas/SystemMessage'
                    user_message: '#/components/schemas/UserMessage'
                    reasoning_message: '#/components/schemas/ReasoningMessage'
                    hidden_reasoning_message: '#/components/schemas/HiddenReasoningMessage'
                    tool_call_message: '#/components/schemas/ToolCallMessage'
                    tool_return_message: '#/components/schemas/ToolReturnMessage'
                    assistant_message: '#/components/schemas/AssistantMessage'
                    approval_request_message: '#/components/schemas/ApprovalRequestMessage'
                    approval_response_message: '#/components/schemas/ApprovalResponseMessage'
                    summary_message: '#/components/schemas/SummaryMessage'
                    event_message: '#/components/schemas/EventMessage'
                title: Response Modify Group Message
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/groups/{group_id}/messages:
    get:
      tags:
      - Groups
      summary: List Group Messages
      description: Retrieve message history for an agent.
      operationId: list_group_messages
      deprecated: true
      parameters:
      - name: group_id
        in: path
        required: true
        schema:
          type: string
          minLength: 42
          maxLength: 42
          pattern: ^group-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: The ID of the group in the format 'group-<uuid4>'
          examples:
          - group-123e4567-e89b-42d3-8456-426614174000
          title: Group Id
        description: The ID of the group in the format 'group-<uuid4>'
      - name: before
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Message ID cursor for pagination. Returns messages that come before this message ID in the specified sort order
          title: Before
        description: Message ID cursor for pagination. Returns messages that come before this message ID in the specified sort order
      - name: after
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Message ID cursor for pagination. Returns messages that come after this message ID in the specified sort order
          title: After
        description: Message ID cursor for pagination. Returns messages that come after this message ID in the specified sort order
      - name: limit
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
          - type: 'null'
          description: Maximum number of messages to retrieve
          default: 10
          title: Limit
        description: Maximum number of messages to retrieve
      - name: order
        in: query
        required: false
        schema:
          enum:
          - asc
          - desc
          type: string
          description: Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first
          default: desc
          title: Order
        description: Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first
      - name: order_by
        in: query
        required: false
        schema:
          const: created_at
          type: string
          description: Field to sort by
          default: created_at
          title: Order By
        description: Field to sort by
      - name: use_assistant_message
        in: query
        required: false
        schema:
          type: boolean
          description: Whether to use assistant messages
          deprecated: true
          default: true
          title: Use Assistant Message
        description: Whether to use assistant messages
        deprecated: true
      - name: assistant_message_tool_name
        in: query
        required: false
        schema:
          type: string
          description: The name of the designated message tool.
          deprecated: true
          default: send_message
          title: Assistant Message Tool Name
        description: The name of the designated message tool.
        deprecated: true
      - name: assistant_message_tool_kwarg
        in: query
        required: false
        schema:
          type: string
          description: The name of the message argument.
          deprecated: true
          default: message
          title: Assistant Message Tool Kwarg
        description: The name of the message argument.
        deprecated: true
      - name: include_return_message_types
        in: query
        required: false
        schema:
          anyOf:
          - type: array
            items:
              $ref: '#/components/schemas/MessageType'
          - type: 'null'
          description: Message types to include in response. When null, all message types are returned.
          title: Include Return Message Types
        description: Message types to include in response. When null, all message types are returned.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LettaMessageUnion'
                title: Response List Group Messages
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/groups/{group_id}/reset-messages:
    patch:
      tags:
      - Groups
      summary: Reset Group Messages
      description: Delete the group messages for all agents that are part of the multi-agent group.
      operationId: reset_group_messages
      deprecated: true
      parameters:
      - name: group_id
        in: path
        required: true
        schema:
          type: string
          minLength: 42
          maxLength: 42
          pattern: ^group-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: The ID of the group in the format 'group-<uuid4>'
          examples:
          - group-123e4567-e89b-42d3-8456-426614174000
          title: Group Id
        description: The ID of the group in the format 'group-<uuid4>'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/groups/{group_id}/blocks/attach/{block_id}:
    patch:
      tags:
      - Groups
      summary: Attach Block to Group
      description: 'Attach a block to a group.

        This will add the block to the group and all agents within the group.'
      operationId: attach_block_to_group
      deprecated: true
      parameters:
      - name: block_id
        in: path
        required: true
        schema:
          type: string
          title: Block Id
      - name: group_id
        in: path
        required: true
        schema:
          type: string
          minLength: 42
          maxLength: 42
          pattern: ^group-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: The ID of the group in the format 'group-<uuid4>'
          examples:
          - group-123e4567-e89b-42d3-8456-426614174000
          title: Group Id
        description: The ID of the group in the format 'group-<uuid4>'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/groups/{group_id}/blocks/detach/{block_id}:
    patch:
      tags:
      - Groups
      summary: Detach Block from Group
      description: 'Detach a block from a group.

        This will remove the block from the group and all agents within the group.'
      operationId: detach_block_from_group
      deprecated: true
      parameters:
      - name: block_id
        in: path
        required: true
        schema:
          type: string
          title: Block Id
      - name: group_id
        in: path
        required: true
        schema:
          type: string
          minLength: 42
          maxLength: 42
          pattern: ^group-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: The ID of the group in the format 'group-<uuid4>'
          examples:
          - group-123e4567-e89b-42d3-8456-426614174000
          title: Group Id
        description: The ID of the group in the format 'group-<uuid4>'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SleeptimeManagerUpdate:
      properties:
        manager_type:
          type: string
          const: sleeptime
          title: Manager Type
          description: ''
          default: sleeptime
        manager_agent_id:
          anyOf:
          - type: string
            maxLength: 42
            minLength: 42
            pattern: ^agent-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
            description: The ID of the agent in the format 'agent-<uuid4>'
            examples:
            - agent-123e4567-e89b-42d3-8456-426614174000
          - type: 'null'
          title: Manager Agent Id
          description: ''
        sleeptime_agent_frequency:
          anyOf:
          - type: integer
          - type: 'null'
          title: Sleeptime Agent Frequency
          description: ''
      type: object
      title: SleeptimeManagerUpdate
    UpdateSystemMessage:
      properties:
        message_type:
          type: string
          const: system_message
          title: Message Type
          default: system_message
        content:
          type: string
          title: Content
          description: The message content sent by the system (can be a string or an array of multi-modal content parts)
      type: object
      required:
      - content
      title: UpdateSystemMessage
    ApprovalReturn:
      properties:
        type:
          type: string
          const: approval
          title: Type
          description: The message type to be created.
          default: approval
        tool_call_id:
          type: string
          title: Tool Call Id
          description: The ID of the tool call that corresponds to this approval
        approve:
          type: boolean
          title: Approve
          description: Whether the tool has been approved
        reason:
          anyOf:
          - type: string
          - type: 'null'
          title: Reason
          description: An optional explanation for the provided approval status
      type: object
      required:
      - tool_call_id
      - approve
      title: ApprovalReturn
    SystemMessage:
      properties:
        id:
          type: string
          title: Id
        date:
          type: string
          format: date-time
          title: Date
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
        message_type:
          type: string
          const: system_message
          title: Message Type
          description: The type of the message.
          default: system_message
        otid:
          anyOf:
          - type: string
          - type: 'null'
          title: Otid
          description: The offline threading id (OTID). Set by the client to deduplicate requests. Used for idempotency in background streaming mode — each message in a request must have a unique OTID. Retries of the same request should reuse the same OTIDs.
        sender_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Sender Id
        step_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Step Id
        is_err:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Is Err
        seq_id:
          anyOf:
          - type: integer
          - type: 'null'
          title: Seq Id
        run_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Run Id
        content:
          type: string
          title: Content
          description: The message content sent by the system
      type: object
      required:
      - id
      - date
      - content
      title: SystemMessage
      description: "A message generated by the system. Never streamed back on a response, only used for cursor pagination.\n\nArgs:\n    id (str): The ID of the message\n    date (datetime): The date the message was created in ISO format\n    name (Optional[str]): The name of the sender of the message\n    content (str): The message content sent by the system"
    CompactionStats:
      properties:
        trigger:
          type: string
          title: Trigger
          description: What triggered the compaction (e.g., 'context_window_exceeded', 'post_step_context_check')
        context_tokens_before:
          anyOf:
          - type: integer
          - type: 'null'
          title: Context Tokens Before
          description: Token count before compaction (from LLM usage stats, includes full context sent to LLM)
        context_tokens_after:
          anyOf:
          - type: integer
          - type: 'null'
          title: Context Tokens After
          description: Token count after compaction (message tokens only, does not include tool definitions)
        context_window:
          type: integer
          title: Context Window
          description: The model's context window size
        messages_count_before:
          type: integer
          title: Messages Count Before
          description: Number of messages before compaction
        messages_count_after:
          type: integer
          title: Messages Count After
          description: Number of messages after compaction
      type: object
      required:
      - trigger
      - context_window
      - messages_count_before
      - messages_count_after
      title: CompactionStats
      description: Statistics about a memory compaction operation.
    UpdateReasoningMessage:
      properties:
        reasoning:
          type: string
          title: Reasoning
        message_type:
          type: string
          const: reasoning_message
          title: Message Type
          default: reasoning_message
      type: object
      required:
      - reasoning
      title: UpdateReasoningMessage
    EventMessage:
      properties:
        id:
          type: string
          title: Id
        date:
          type: string
          format: date-time
          title: Date
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
        message_type:
          type: string
          const: event_message
          title: Message Type
          default: event_message
        otid:
          anyOf:
          - type: string
          - type: 'null'
          title: Otid
          description: The offline threading id (OTID). Set by the client to deduplicate requests. Used for idempotency in background streaming mode — each message in a request must have a unique OTID. Retries of the same request should reuse the same OTIDs.
        sender_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Sender Id
        step_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Step Id
        is_err:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Is Err
        seq_id:
          anyOf:
          - type: integer
          - type: 'null'
          title: Seq Id
        run_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Run Id
        event_type:
          type: string
          const: compaction
          title: Event Type
        event_data:
          additionalProperties: true
          type: object
          title: Event Data
      type: object
      required:
      - id
      - date
      - event_type
      - event_data
      title: EventMessage
      description: A message for notifying the developer that an event that has occured (e.g. a compaction). Events are NOT part of the context window.
    ImageContent:
      properties:
        type:
          type: string
          const: image
          title: Type
          description: The type of the message.
          default: image
        source:
          oneOf:
          - $ref: '#/components/schemas/UrlImage'
          - $ref: '#/components/schemas/Base64Image'
          - $ref: '#/components/schemas/LettaImage'
          title: Source
          description: The source of the image.
          discriminator:
            propertyName: type
            mapping:
              base64: '#/components/schemas/Base64Image'
              letta: '#/components/schemas/LettaImage'
              url: '#/components/schemas/UrlImage'
      type: object
      required:
      - source
      title: ImageContent
    UserMessage:
      properties:
        id:
          type: string
          title: Id
        date:
          type: string
          format: date-time
          title: Date
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
        message_type:
          type: string
          const: user_message
          title: Message Type
          description: The type of the message.
          default: user_message
        otid:
          anyOf:
          - type: string
          - type: 'null'
          title: Otid
          description: The offline threading id (OTID). Set by the client to deduplicate requests. Used for idempotency in background streaming mode — each message in a request must have a unique OTID. Retries of the same request should reuse the same OTIDs.
        sender_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Sender Id
        step_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Step Id
        is_err:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Is Err
        seq_id:
          anyOf:
          - type: integer
          - type: 'null'
          title: Seq Id
        run_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Run Id
        content:
          anyOf:
          - items:
              $ref: '#/components/schemas/LettaUserMessageContentUnion'
            type: array
          - type: string
          title: Content
          description: The message content sent by the user (can be a string or an array of multi-modal content parts)
      type: object
      required:
      - id
      - date
      - content
      title: UserMessage
      description: "A message sent by the user. Never streamed back on a response, only used for cursor pagination.\n\nArgs:\n    id (str): The ID of the message\n    date (datetime): The date the message was created in ISO format\n    name (Optional[str]): The name of the sender of the message\n    content (Union[str, List[LettaUserMessageContentUnion]]): The message content sent by the user (can be a string or an array of multi-modal content parts)"
    AssistantMessage:
      properties:
        id:
          type: string
          title: Id
        date:
          type: string
          format: date-time
          title: Date
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: N

# --- truncated at 32 KB (75 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/openapi/letta-groups-api-openapi.yml