POST
/
v1
/
auth
/
token
/
get
Generate Token
curl --request POST \
  --url https://api.velt.dev/v1/auth/token/get \
  --header 'Content-Type: <content-type>' \
  --data '{
  "data": {
    "apiKey": "<string>",
    "authToken": "<string>",
    "userId": "<string>",
    "userProperties": {
      "organizationId": "<string>",
      "isAdmin": true,
      "email": "<string>"
    }
  }
}'
{
  "result": {
    "status": "success",
    "message": "Token generated successfully.",
    "data": {
      "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
    }
  }
}
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

Headers

Content-Type
string
required
application/json

Body

Params

data
object
required

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