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
| Environment | Base URL |
|---|---|
| Development | https://v2.dev-api-oobit.com |
| Production | https://v2.prod-api-oobit.com |
Request
Headers
| Header | Value | Required |
|---|---|---|
x-api-key | Your API key | Yes |
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"
}| Field | Type | Description |
|---|---|---|
success | boolean | Indicates wether the token was created successfully |
message | string | Human-readable status message |
token | string | JWT access token for the widget |
expiresAt | string | ISO 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
- Authentication Guide - Token lifecycle management
Updated about 3 hours ago
