Skip to main content

Generate JWT Token

Endpoint: POST /api/token

Generates a JWT token using either an access key/secret pair or email/password credentials (when local auth mode is enabled).

Request body

Format the request body as a JSON object with the following parameters:

ParameterDescriptionTypeRequired/ Optional
keyIdThe access key ID generated from the application in Conductor.stringRequired if authenticating using access keys.
keySecretThe access key secret generated from the application in Conductor.stringRequired if authenticating using access keys.
emailUser email address.stringRequired if authenticating using email and password.
passwordUser password.stringRequired if authenticating using email and password.
expirationToken expiration time in milliseconds. If not set, the default expiration applies. Pass a negative value for no expiration.integerOptional.

Response

Returns a JWT token string.

{
"token": "<JWT_TOKEN>"
}

Examples

Generate JWT token using access keys

Request

curl -X 'POST' \
'https://<YOUR-SERVER-URL>/api/token' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"keyId": "<YOUR-KEY-ID>",
"keySecret": "<YOUR-KEY-SECRET>"
}'

Response

{
"token": "<JWT_TOKEN>"
}