Truztcube Docs

Generate new API key

Generates a new API key for the organisation. The plain API key is only shown once.

POST/v1/api-keys
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/v1/api-keys" \  -H "Content-Type: application/json" \  -d '{    "type": "LIVE"  }'
{  "success": true,  "statusCode": 200,  "message": "Request processed successfully",  "timestamp": "2025-10-20T16:30:00.000Z",  "path": "/v1/auth/register",  "data": {    "id": "key_123",    "apiKey": "sk_test_4eC39HqLyjWDarjtT1zdp7dc",    "name": "Production API Key",    "type": "LIVE",    "keyPrefix": "sk_test",    "scopes": [      "payments:read",      "payments:write"    ],    "rateLimit": 100,    "expiresAt": "2026-10-20T12:00:00.000Z",    "createdAt": "2025-10-20T12:00:00.000Z"  }}