Use this API to generate a JWT token used by your client to authenticate with Velt. The token encodes user information and optional properties such as organization and admin status.
JWT token expires in 48 hours.
For v1, apiKey and authToken are provided in the request body (not headers).
Endpoint
POST https://api.velt.dev/v1/auth/token/get
Body
Params
Your Auth Token from the Velt console. See Auth Tokens . Unique identifier for the user.
Organization ID. Should match the organizationId used in the identify call.
Whether the user has admin privileges. This is the only supported way to set a user as admin. Do not set this in the identify call.
User email. If provided, it is validated against the email used in the identify call.
Example Requests
Generate token with organization and admin
{
"data" : {
"apiKey" : "YOUR_API_KEY" ,
"authToken" : "YOUR_AUTH_TOKEN" ,
"userId" : "yourUserId" ,
"userProperties" : {
"isAdmin" : true ,
"organizationId" : "YOUR_ORGANIZATION_ID" ,
"email" : "user@example.com"
}
}
}
Minimal token request
{
"data" : {
"apiKey" : "YOUR_API_KEY" ,
"authToken" : "YOUR_AUTH_TOKEN" ,
"userId" : "yourUserId" ,
"userProperties" : {
"organizationId" : "YOUR_ORGANIZATION_ID"
}
}
}
Response
Generate the JWT token on your server, not your client, to keep your secrets secure.
Success Response
{
"result" : {
"status" : "success" ,
"message" : "Token generated successfully." ,
"data" : {
"token" : "YOUR_JWT_TOKEN"
}
}
}
Failure Response
{
"error" : {
"message" : "Auth token not found." ,
"status" : "INVALID_ARGUMENT"
}
}
{
"result" : {
"status" : "success" ,
"message" : "Token generated successfully." ,
"data" : {
"token" : "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
}
}