API Reference / Integrations
POST
/integrations/api-keysCreate a partner API key
Mint a partner API key. The raw key is returned once and must be stored securely — use it as the x-api-key header on /partner/* routes.
🔒 JWT BearerTry in Console →
Purpose
Generate a credential for server-to-server inbound sync (the /partner/* endpoints). The full key is shown ONLY in this response — store it immediately. Afterwards only the keyPrefix is visible. Treat it like a password.
Authentication
Send your access token as a Bearer header: Authorization: Bearer <token>. Obtain it from Authenticate a user.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| name* | body | string | Human label for the key |
| scopes | body | string[] | Optional permission scopes |
Request samples
bash
curl -X POST https://tourapi.nirajp.com.np/api/v1/integrations/api-keys \
-H "Content-Type: application/json" \
-d '{"name":"Server-to-server integration","scopes":["destinations:write"]}'Success response
Returns 200 OK with the shape below.
| Field | Type | Description |
|---|---|---|
| key | string | THE RAW KEY — shown once, store it securely |
| apiKey.id | number | Key id (use in delete-api-key) |
| apiKey.name | string | Label you provided |
| apiKey.keyPrefix | string | First characters, for identification later |
| apiKey.active | boolean | true when usable |
json
{
"success": true,
"message": "Request successful.",
"data": {
"key": "tk_live_9a5e8795...",
"apiKey": {
"id": 6,
"name": "Server-to-server integration",
"keyPrefix": "tk_live_9a5e",
"active": true
}
}
}Errors
All errors share the envelope { "success": false, "message": "..." }.
401No or invalid authentication token supplied.
json
{
"success": false,
"message": "Unauthorized"
}400A required field is missing or malformed (e.g. invalid email, short password).
json
{
"success": false,
"message": "Validation failed",
"errors": {
"email": "email must be a valid email"
}
}403Authenticated but the account/role lacks permission for this action.
json
{
"success": false,
"message": "Forbidden"
}500An unexpected error occurred on our side. Retry; if it persists, contact support.
json
{
"success": false,
"message": "Internal server error"
}