REST API v2
Connect with API keys or delegated OAuth, select a brand, and use the v2 contract.
REST API v2 provides a consistent interface for data, customer profiles and supported brand configuration. It is available on installations with API v2 enabled. Feature availability still depends on the selected brand and the caller's permissions; a server merge does not establish availability on your instance.
Existing REST API v1 integrations keep their own credentials, scopes and response formats. Moving to v2 requires an explicit client migration.
Make a first read
Ask an administrator to enable API v2 and provision an API key with read permission for the required resources and brands. In the dashboard, open Developer → API Keys, create the key, assign its roles and brand restrictions, and store its token securely. A valid key with no relevant permission cannot read customer data.
curl 'https://YOUR_BRAND_HOST/api/v2/data/users?page=1&per_page=25' \
-H 'Authorization: Bearer YOUR_API_KEY'Inspect records and meta.pagination. Save meta.request_id when reporting a failure, with credentials and customer data removed.
Authentication and brand selection
| Credential | Acts as | Requirements |
|---|---|---|
| API key | The key's own role assignments | Enabled, unexpired key with the required resource permissions. A personal key additionally identifies its owner for /me. |
OAuth access token with api_v2 | The authorizing user's current permissions | API v2 and its MCP/OAuth capability enabled; application explicitly configured for api_v2; Authorization Code with S256 PKCE. Client credentials cannot obtain this delegated access. |
An SDK application key and an ordinary v1 OAuth token do not substitute for these credentials. Delegated OAuth has additional restrictions on account-security operations and ticket movement; see Customer data and /me.
Data requests normally use the brand matching the request host. To select another permitted brand, send its name:
curl 'https://YOUR_BRAND_HOST/api/v2/data/tickets?page=1' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'X-Unidy-Brand: partners'The header selects a brand within the caller's allowed brands; it grants no additional access. An empty, unknown or inaccessible brand produces 404 not_found, rather than falling back to the host. Missing or invalid credentials produce 401 unauthorized before brand lookup.
Brand configuration routes select their brand from the URL instead.
Request and response contract
JSON writes wrap fields in payload.data. Operation options belong beside data, and optional attribution belongs in root meta.source:
{
"payload": {
"data": { "first_name": "Alex" }
},
"meta": { "source": "customer-portal" }
}Send Content-Type: application/json. Single reads and most writes return { "record": ..., "meta": ... }; collections return { "records": [...], "meta": ... }. Follow the operation for successful empty responses.
Errors use identifier, a details array and meta.request_id. Details can name a nested field, a stable code, and a batch entry index. Human-readable messages can be translated; branch on identifiers and codes.
| Status | Typical identifier | Recovery |
|---|---|---|
| 400 | bad_request, invalid_query | Correct JSON, pagination, filters or query values. |
| 401 | unauthorized | Check the credential and its expiry/revocation. |
| 403 | forbidden, feature_not_enabled, real_email_required | Check roles, operation restrictions and the required account step. |
| 404 | not_found | Verify the host, brand and accessible resource identifier. |
| 409 | conflict, multiple_matches | Inspect the operation-specific conflict; do not assume success. |
| 422 | unprocessable_content, field_not_findable | Correct the named fields or lookup constraints. |
| 429 | rate_limited | Honor Retry-After. |
After a timeout or server failure, reconcile a write before retrying. V2 has no universal idempotency-key guarantee; loyalty award ingestion has its own explicit contract.
Continue by task
- Collections, filters and lookup — page and cursor walks, counts, typed filters and unique-field discovery.
- Customer data and /me — administrative records, profile updates and customer-owned resources.
- Uploads and data workflows — category images, nested writes, newsletter confirmation and transfer offers.
- Brand configuration — configuration validation, menus, legal links, CSS and provider links.
- Loyalty — membership, awards, availability and seasonal state.
- Connect an MCP client — agent access with the same API permissions.
- Instance and principal discovery — connection capabilities and documentation/API access boundaries.
On your selected instance, open /swagger/v2/html for the interactive reference or download /swagger/v2/json. These routes require API v2 to be enabled. The older /api-docs/v2 URL redirects to the current viewer. Use the schema from the instance you call; enabled resources and deployed versions can differ.