Skip to main content

Create JWT

POST 

/auth/v1/jwt

To create a JWT use your project's Service Account JWT to authenticate and authorize the request.

The 'kid' you supply must exist and will be used to sign the JWT. You can create a new KID by creating a new JWK in your dashboard.

Do not use the 'kid' of your project's Service Account JWT unless you want to give the JWT created access to your project.

Generate JWT

Request

Body

required

JWT options

    kid stringrequired

    Key ID of the JWK

    ttl integer

    ttl stands for time to live, a ttl of 300 will expire in 300 seconds. Either ttl or exp should be used but not both

    Example: 600
    exp timestamp (Unix epoch)

    The JWT will no longer be valid after this date. Either ttl or expire should be used but not both

    nbf timestamp (Unix epoch)

    The JWT will not be valid before this date

    sub string

    The subject of the JWT (the user id)

    roles string[]

    An array of roles that will be applied to the JWT. This will apper in the JWT as the claim roles

    permissions string[]

    An array of permissions that will be applied to the JWT. The permissions are a string representation of a uint64 bitmask. This will appear in the JWT as the claim prm

    claims

    object

    Additional claims to be stored with the JWT

    property name* any

    Additional claims to be stored with the JWT

    Default value: {}

Responses

JWT

Schema

    token stringrequired
Loading...