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

Open in Claude
Open in ChatGPT

Create token (Cloud-only)

post/v1/client-side-access-tokens

Create a new client side access token with the specified configuration.

Body ParametersExpand Collapse
hostname: string

The hostname of the client side application. Please specify the full URL including the protocol (http or https).

formaturi
policy: array of object { id, access, type }
id: string
access: array of "read_messages" or "write_messages" or "read_agent" or "write_agent"
Accepts one of the following:
"read_messages"
"write_messages"
"read_agent"
"write_agent"
type: "agent"
Accepts one of the following:
"agent"
expires_at: optional string

The expiration date of the token. If not provided, the token will expire in 5 minutes

ReturnsExpand Collapse
token: string
expiresAt: string
hostname: string
policy: object { data, version }
data: array of object { id, access, type }
id: string
access: array of "read_messages" or "write_messages" or "read_agent" or "write_agent"
Accepts one of the following:
"read_messages"
"write_messages"
"read_agent"
"write_agent"
type: "agent"
Accepts one of the following:
"agent"
version: "1"
Accepts one of the following:
"1"
Create token (Cloud-only)
curl https://api.letta.com/v1/client-side-access-tokens \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $LETTA_API_KEY" \
    -d '{
          "hostname": "https://example.com",
          "policy": [
            {
              "id": "id",
              "access": [
                "read_messages"
              ],
              "type": "agent"
            }
          ]
        }'
{
  "token": "token",
  "expiresAt": "expiresAt",
  "hostname": "hostname",
  "policy": {
    "data": [
      {
        "id": "id",
        "access": [
          "read_messages"
        ],
        "type": "agent"
      }
    ],
    "version": "1"
  }
}
Returns Examples
{
  "token": "token",
  "expiresAt": "expiresAt",
  "hostname": "hostname",
  "policy": {
    "data": [
      {
        "id": "id",
        "access": [
          "read_messages"
        ],
        "type": "agent"
      }
    ],
    "version": "1"
  }
}