Skip to 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:

Parameter Description Type Required/ Optional
keyId The access key ID generated from the application in Conductor. string Required if authenticating using access keys.
keySecret The access key secret generated from the application in Conductor. string Required if authenticating using access keys.
email User email address. string Required if authenticating using email and password.
password User password. string Required if authenticating using email and password.
expiration Token expiration time in milliseconds. If not set, the default expiration applies. Pass a negative value for no expiration. integer Optional.

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>"
}