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

    kidstringrequired

    Key ID of the JWK

    ttlinteger

    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
    exptimestamp (Unix epoch)

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

    nbftimestamp (Unix epoch)

    The JWT will not be valid before this date

    substring

    The subject of the JWT (the user id)

    rolesstring[]

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

    permissionsstring[]

    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

    tokenstringrequired