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

Open in Claude
Open in ChatGPT

List Identities

identities.list(IdentityListParams**kwargs) -> SyncArrayPage[Identity]
get/v1/identities/

Get a list of all identities in the database

ParametersExpand Collapse
after: Optional[str]

Identity ID cursor for pagination. Returns identities that come after this identity ID in the specified sort order

before: Optional[str]

Identity ID cursor for pagination. Returns identities that come before this identity ID in the specified sort order

identifier_key: Optional[str]
identity_type: Optional[IdentityType]

Enum to represent the type of the identity.

Accepts one of the following:
"org"
"user"
"other"
limit: Optional[int]

Maximum number of identities to return

name: Optional[str]
order: Optional[Literal["asc", "desc"]]

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

Accepts one of the following:
"asc"
"desc"
order_by: Optional[Literal["created_at"]]

Field to sort by

Accepts one of the following:
"created_at"
project_id: Optional[str]
ReturnsExpand Collapse
class Identity:
id: str

The human-friendly ID of the Identity

Deprecatedagent_ids: List[str]

The IDs of the agents associated with the identity.

Deprecatedblock_ids: List[str]

The IDs of the blocks associated with the identity.

identifier_key: str

External, user-generated identifier key of the identity.

identity_type: IdentityType

The type of the identity.

Accepts one of the following:
"org"
"user"
"other"
name: str

The name of the identity.

project_id: Optional[str]

The project id of the identity, if applicable.

properties: Optional[List[IdentityProperty]]

List of properties associated with the identity

key: str

The key of the property

type: Literal["string", "number", "boolean", "json"]

The type of the property

Accepts one of the following:
"string"
"number"
"boolean"
"json"
value: Union[str, float, bool, Dict[str, object]]

The value of the property

Accepts one of the following:
ValueUnionMember0 = str
ValueUnionMember1 = float
ValueUnionMember2 = bool
ValueUnionMember3 = Dict[str, object]
List Identities
from letta_client import Letta

client = Letta(
    api_key="My API Key",
)
page = client.identities.list()
page = page.items[0]
print(page.id)
[
  {
    "id": "identity-123e4567-e89b-12d3-a456-426614174000",
    "agent_ids": [
      "string"
    ],
    "block_ids": [
      "string"
    ],
    "identifier_key": "identifier_key",
    "identity_type": "org",
    "name": "name",
    "project_id": "project_id",
    "properties": [
      {
        "key": "key",
        "type": "string",
        "value": "string"
      }
    ]
  }
]
Returns Examples
[
  {
    "id": "identity-123e4567-e89b-12d3-a456-426614174000",
    "agent_ids": [
      "string"
    ],
    "block_ids": [
      "string"
    ],
    "identifier_key": "identifier_key",
    "identity_type": "org",
    "name": "name",
    "project_id": "project_id",
    "properties": [
      {
        "key": "key",
        "type": "string",
        "value": "string"
      }
    ]
  }
]