Skip to content
  • Auto
  • Light
  • Dark
DiscordForumGitHubSign up
View as Markdown
Copy Markdown

Open in Claude
Open in ChatGPT

List Blocks

get/v1/blocks/

List Blocks

Query ParametersExpand Collapse
after: optional string

Block ID cursor for pagination. Returns blocks that come after this block ID in the specified sort order

before: optional string

Block ID cursor for pagination. Returns blocks that come before this block ID in the specified sort order

connected_to_agents_count_eq: optional array of number

Filter blocks by the exact number of connected agents. If provided, returns blocks that have exactly this number of connected agents.

connected_to_agents_count_gt: optional number

Filter blocks by the number of connected agents. If provided, returns blocks that have more than this number of connected agents.

connected_to_agents_count_lt: optional number

Filter blocks by the number of connected agents. If provided, returns blocks that have less than this number of connected agents.

Search blocks by description. If provided, returns blocks that match this description. This is a full-text search on block descriptions.

identifier_keys: optional array of string

Search agents by identifier keys

identity_id: optional string

Search agents by identifier id

label: optional string

Labels to include (e.g. human, persona)

Search blocks by label. If provided, returns blocks that match this label. This is a full-text search on labels.

limit: optional number

Number of blocks to return

name: optional string

Name of the block

order: optional "asc" or "desc"

Sort order for blocks by creation time. 'asc' for oldest first, 'desc' for newest first

Accepts one of the following:
"asc"
"desc"
order_by: optional "created_at"

Field to sort by

Accepts one of the following:
"created_at"
project_id: optional string

Search blocks by project id

templates_only: optional boolean

Whether to include only templates

Search blocks by value. If provided, returns blocks that match this value.

ReturnsExpand Collapse
id: string

The id of the block.

value: string

Value of the block.

Deprecatedbase_template_id: optional string

(Deprecated) The base template id of the block.

created_by_id: optional string

The id of the user that made this Block.

Deprecateddeployment_id: optional string

(Deprecated) The id of the deployment.

description: optional string

Description of the block.

Deprecatedentity_id: optional string

(Deprecated) The id of the entity within the template.

Deprecatedhidden: optional boolean

(Deprecated) If set to True, the block will be hidden.

is_template: optional boolean

Whether the block is a template (e.g. saved human/persona options).

label: optional string

Label of the block (e.g. 'human', 'persona') in the context window.

last_updated_by_id: optional string

The id of the user that last updated this Block.

limit: optional number

Character limit of the block.

metadata: optional map[unknown]

Metadata of the block.

Deprecatedpreserve_on_migration: optional boolean

(Deprecated) Preserve the block on template migration.

project_id: optional string

The associated project id.

Deprecatedread_only: optional boolean

(Deprecated) Whether the agent has read-only access to the block.

Deprecatedtemplate_id: optional string

(Deprecated) The id of the template.

Deprecatedtemplate_name: optional string

(Deprecated) The name of the block template (if it is a template).

List Blocks
curl https://api.letta.com/v1/blocks/ \
    -H "Authorization: Bearer $LETTA_API_KEY"
[
  {
    "id": "id",
    "value": "value",
    "base_template_id": "base_template_id",
    "created_by_id": "created_by_id",
    "deployment_id": "deployment_id",
    "description": "description",
    "entity_id": "entity_id",
    "hidden": true,
    "is_template": true,
    "label": "label",
    "last_updated_by_id": "last_updated_by_id",
    "limit": 0,
    "metadata": {
      "foo": "bar"
    },
    "preserve_on_migration": true,
    "project_id": "project_id",
    "read_only": true,
    "template_id": "template_id",
    "template_name": "template_name"
  }
]
Returns Examples
[
  {
    "id": "id",
    "value": "value",
    "base_template_id": "base_template_id",
    "created_by_id": "created_by_id",
    "deployment_id": "deployment_id",
    "description": "description",
    "entity_id": "entity_id",
    "hidden": true,
    "is_template": true,
    "label": "label",
    "last_updated_by_id": "last_updated_by_id",
    "limit": 0,
    "metadata": {
      "foo": "bar"
    },
    "preserve_on_migration": true,
    "project_id": "project_id",
    "read_only": true,
    "template_id": "template_id",
    "template_name": "template_name"
  }
]