openapi: 3.1.0 info: title: Letta Admin Internal Agents 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: Internal Agents description: Internal Agents operations. paths: /v1/_internal_agents/count: get: tags: - Internal Agents summary: Count Agents description: Get the total number of agents for a user, with option to exclude hidden agents. operationId: count_internal_agents parameters: - name: exclude_hidden in: query required: false schema: type: boolean description: If True, excludes hidden agents from the count. If False, includes all agents. default: true title: Exclude Hidden description: If True, excludes hidden agents from the count. If False, includes all agents. responses: '200': description: Successful Response content: application/json: schema: type: integer title: Response Count Internal Agents '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /v1/_internal_agents/{agent_id}/core-memory/blocks/{block_label}: patch: tags: - Internal Agents summary: Modify Block for Agent description: Updates a core memory block of an agent. operationId: modify_internal_core_memory_block parameters: - name: block_label in: path required: true schema: type: string title: Block Label - name: agent_id in: path required: true schema: type: string minLength: 42 maxLength: 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-' examples: - agent-123e4567-e89b-42d3-8456-426614174000 title: Agent Id description: The ID of the agent in the format 'agent-' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/BlockUpdate' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/Block' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' components: schemas: ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type type: object required: - loc - msg - type title: ValidationError Block: properties: value: type: string title: Value description: Value of the block. limit: type: integer title: Limit description: Character limit of the block. default: 100000 project_id: anyOf: - type: string - type: 'null' title: Project Id description: The associated project id. template_name: anyOf: - type: string - type: 'null' title: Template Name description: Name of the block if it is a template. is_template: type: boolean title: Is Template description: Whether the block is a template (e.g. saved human/persona options). default: false template_id: anyOf: - type: string - type: 'null' title: Template Id description: The id of the template. base_template_id: anyOf: - type: string - type: 'null' title: Base Template Id description: The base template id of the block. deployment_id: anyOf: - type: string - type: 'null' title: Deployment Id description: The id of the deployment. entity_id: anyOf: - type: string - type: 'null' title: Entity Id description: The id of the entity within the template. preserve_on_migration: anyOf: - type: boolean - type: 'null' title: Preserve On Migration description: Preserve the block on template migration. default: false label: anyOf: - type: string - type: 'null' title: Label description: Label of the block (e.g. 'human', 'persona') in the context window. read_only: type: boolean title: Read Only description: Whether the agent has read-only access to the block. default: false description: anyOf: - type: string - type: 'null' title: Description description: Description of the block. metadata: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata description: Metadata of the block. default: {} hidden: anyOf: - type: boolean - type: 'null' title: Hidden description: If set to True, the block will be hidden. id: type: string pattern: ^block-[a-fA-F0-9]{8} title: Id description: The human-friendly ID of the Block examples: - block-123e4567-e89b-12d3-a456-426614174000 created_by_id: anyOf: - type: string - type: 'null' title: Created By Id description: The id of the user that made this Block. last_updated_by_id: anyOf: - type: string - type: 'null' title: Last Updated By Id description: The id of the user that last updated this Block. tags: anyOf: - items: type: string type: array - type: 'null' title: Tags description: The tags associated with the block. default: [] type: object required: - value title: Block description: A Block represents a reserved section of the LLM's context window. BlockUpdate: properties: value: anyOf: - type: string - type: 'null' title: Value description: Value of the block. limit: anyOf: - type: integer - type: 'null' title: Limit description: Character limit of the block. project_id: anyOf: - type: string - type: 'null' title: Project Id description: The associated project id. template_name: anyOf: - type: string - type: 'null' title: Template Name description: Name of the block if it is a template. is_template: type: boolean title: Is Template description: Whether the block is a template (e.g. saved human/persona options). default: false template_id: anyOf: - type: string - type: 'null' title: Template Id description: The id of the template. base_template_id: anyOf: - type: string - type: 'null' title: Base Template Id description: The base template id of the block. deployment_id: anyOf: - type: string - type: 'null' title: Deployment Id description: The id of the deployment. entity_id: anyOf: - type: string - type: 'null' title: Entity Id description: The id of the entity within the template. preserve_on_migration: anyOf: - type: boolean - type: 'null' title: Preserve On Migration description: Preserve the block on template migration. default: false label: anyOf: - type: string - type: 'null' title: Label description: Label of the block (e.g. 'human', 'persona') in the context window. read_only: type: boolean title: Read Only description: Whether the agent has read-only access to the block. default: false description: anyOf: - type: string - type: 'null' title: Description description: Description of the block. metadata: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata description: Metadata of the block. default: {} hidden: anyOf: - type: boolean - type: 'null' title: Hidden description: If set to True, the block will be hidden. tags: anyOf: - items: type: string type: array - type: 'null' title: Tags description: The tags to associate with the block. type: object title: BlockUpdate description: Update a block HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError securitySchemes: bearerAuth: type: http scheme: bearer