v53

latestOpenAPI 3.1.1raw.githubusercontent.com2026-07-264065213.4 KB
Tokens

Create a signed user token

Provides a mechanism for having Surge create a signed token for embeds instead of signing with your own signing key.

post/users/{user_id}/tokens

Path parameters

user_idstring required

The user for which the token represents authentication.

Example:usr_01jymgdfrpec2asc5m0z3a6fr9

Request body

duration_secondsinteger

For how many seconds the token should be accepted. Defaults to 15 minutes.

Example request

{
  "duration_seconds": 900
}

Response

Created token

tokenstring

The created token.

Example response

{
  "token": "eyJhbGciOiJFZERTQSIsImtpZCI6InNnbl8wMWp5bWowZ3AwZjNidmJmMmpyazRoYnd0ayIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NTA4ODkyMDgsInN1YiI6InVzcl8wMWp5bWdkZnJwZWMyYXNjNW0wejNhNmZyOSJ9.zKayo3EDrUm1Hw8URrofuYwajgyTu6dH2H0FEuRExprP1IV66FHa8wC3SfdzV7sR3AjDGAwkuAXztScq6rBnBw"
}