Base URL and responses
Foundation for every HTTP call: hosts, path versioning, required headers, and the common error and pagination envelopes.
Hosts
| Environment | Base URL | Purpose |
|---|---|---|
| Sandbox | https://sandbox-api.udai.live/v1 | Integrator testing |
| Staging | https://staging-api.udai.live/v1 | Pre-production rehearsal |
| Production | https://api.udai.live/v1 | Live national operations |
All REST paths in this documentation are relative to /v1 on the host you choose. Example:
GET https://sandbox-api.udai.live/v1/assetsSee Environments and the Sandbox for access policy.
Path versioning
Public routes are served under the /v1 path prefix. Breaking changes to request or response contracts increment the path version. Clients continue to call /v1 until they deliberately move to a later prefix.
Required headers
Most operational routes require:
| Header | Purpose |
|---|---|
partner-api-key | Identifies the integrating platform |
Authorization | Bearer user JWT for the acting user |
X-Organisation-ID | Organisation tenancy for the call |
Content-Type | application/json for JSON bodies |
Authentication routes and exceptions are defined in Access control. Session issuance is documented in Authentication.
Error response format
Errors use a single JSON shape:
{
"error": "Bad Request",
"message": "Missing required field 'email'",
"status_code": 400,
"timestamp": "2025-07-17T11:45:00Z",
"path": "/v1/auth/register"
}| Field | Type | Description |
|---|---|---|
error | string | Short error class |
message | string | Human-readable explanation |
status_code | int | HTTP status code |
timestamp | timestamp | ISO 8601 time of the error |
path | string | Request path that failed |
Common status codes
| Code | Meaning | Typical cause |
|---|---|---|
| 200 | OK | Successful read or update |
| 201 | Created | Successful create |
| 400 | Bad Request | Invalid body, parameters, or business rule |
| 401 | Unauthorized | Missing or invalid partner key or JWT |
| 403 | Forbidden | Authenticated but not authorised for the action or organisation |
| 404 | Not Found | Unknown UUID or resource |
| 409 | Conflict | Duplicate or incompatible state |
| 422 | Unprocessable Entity | Valid JSON but invalid references |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Unexpected failure |
| 503 | Service Unavailable | Dependency unavailable |
Endpoint pages document which of these codes that route returns.
Pagination
List endpoints that page results accept:
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number, starting at 1 |
limit | integer | 25 | Page size |
Successful list responses use:
{
"message": "Resources retrieved successfully",
"data": [],
"pagination": {
"total_records": 142,
"total_pages": 3,
"current_page": 1,
"per_page": 50,
"has_next": true,
"has_previous": false
}
}