The Regenerate Token API for Chargeback allows you to regenerate authentication tokens with a specified expiration date. This endpoint is part of the Optimus platform and provides a secure way to refresh API tokens while maintaining authentication integrity.
Note: The Regenerate Token API is used to regenerate only. Use the Chargeback Dashboard to easily generate token in the Chargeback Dashboard. For more information, refer to Generate Token on Chargeback Dashboard
Environment
Production | <Optimus endpoint>/api/v1/tokens/regenerate |
Contact for Optimus endpoint: Contact your WIBMO key account manager or support for the Optimus endpoint.
Request header
Header | Description | Example |
---|---|---|
X-Optimus-API-Key |
| your_api_key_here |
Content-Type |
| application/json |
Request parameters
Parameter | Description | Example |
---|---|---|
expires_at mandatory |
String mandatory - Specifies the expiration date for the regenerated token. Must be in YYYY-MM-DD format and cannot be a past date. Note: The valid date format is YYYY-MM-DD. |
* 2025-12-21 * 2025-12-21 * 2025-01-15 * 2024-12-31 |
Sample request
curl --location 'http://localhost:3000/api/v1/tokens/regenerate' \
--header 'X-Optimus-API-Key: {your_old_api_key}' \
--header 'Content-Type: application/json' \
--data '{ "expires_at": "2025-12-21" }'
Sample response
Success scenario
{
"success": true,
"message": "Token regenerated successfully",
"token": "78fe93bd_5fc3_4df2_a54a_e04fdfbce95e",
"name": "test api token",
"expires_at": "2025-11-26 23:59:59"
}
Failure scenarios
- 400 Bad Request: Invalid request format or parameters
{
"error": "Invalid expiry date format",
"message": "Expiry date must be in YYYY-MM-DD format"
}
- 401 Unauthorized: Missing or invalid API key
{
"errors": "Invalid Token"
}
Response parameters
Parameter | Description | Example |
---|---|---|
Success scenario | ||
success | boolean - Indicates whether the request was successful | true |
message | string - Human-readable message about the result | "Token regenerated successfully" |
token | string - The newly generated authentication token | "78fe93bd_5fc3_4df2_a54a_e04fdfbce95e" |
name | string - The name of the regenerated token | "test api token" |
expires_at | string - Timestamp of the token's expiration in YYYY-MM-DD HH:MM:SS format | "2025-11-26 23:59:59" |
Failure scnario | ||
error | string - Error type identifier | "Invalid expiry date format" |
message | string - Detailed error description | "Expiry date must be in YYYY-MM-DD format" |
HTTP Status Codes
Status Code | Description |
---|---|
200 | OK - Token regenerated successfully |
400 | Bad Request - Invalid request format or parameters |
401 | Unauthorized - Missing or invalid API key |