Skip to content

A fresh token for an existing session: the id's owner must be the caller's install. The principal is the name the token will write as; the install vouches for it, as it did on dial.

GET
/sessions/{id}/token
curl --request GET \
--url 'https://api.canopyhq.dev/sessions/000000000000000000000000000000000000000000000000000000000000000000000000/token?principal=example' \
--header 'Authorization: Bearer <token>'
id
required

A stream id: 72 hex chars, the shard then the owner digest.

string

The session to mint a token for.

principal
required
string

The principal the session belongs to.

A fresh token for the session.

Media typeapplication/json
object
expires
required
integer format: int64
session
required

A stream id: 72 hex chars, the shard then the owner digest.

string
token
required
string
Example
{
"session": "000000000000000000000000000000000000000000000000000000000000000000000000"
}

No principal, or an id that is not 64 hex chars.

No install key, or one no install answers.

No such session under this caller.