Create Token

Generate an access token for the widget

Create Token

Generate a JWT access token for authenticating the widget.

Endpoint

POST {BASE_URL}/v1/widget/auth/create-token
EnvironmentBase URL
Developmenthttps://v2.dev-api-oobit.com
Productionhttps://v2.prod-api-oobit.com

Request

Headers

HeaderValueRequired
x-api-keyYour API keyYes

Example

curl -X POST {BASE_URL}/v1/widget/auth/create-token \
  -H "x-api-key: your-api-key"

Response

Success (200 OK)

{
  "success": true,
  "message": "Token created successfully",
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expiresAt": "2025-12-23T12:00:00.000Z"
}
FieldTypeDescription
successbooleanIndicates wether the token was created successfully
messagestringHuman-readable status message
tokenstringJWT access token for the widget
expiresAtstringISO 8601 timestamp indicating when the token expires and must be refreshed

Error Responses

401 Unauthorized

Invalid API key.

{
  "error": "Unauthorized",
  "message": "Invalid API key"
}

403 Forbidden

Provider not authorized for this operation.

{
  "error": "Forbidden",
  "message": "Provider not authorized"
}

429 Too Many Requests

Rate limit exceeded.

{
  "error": "Rate limit exceeded",
  "message": "Too many requests. Please try again later.",
}

500 Internal Server Error

Server-side error.

{
  "error": "Internal server error",
  "message": "An unexpected error occurred"
}

See Also