Skip to main content
Ready-to-copy usage patterns you can adapt, in the most common languages. For the full list of endpoints, use the API reference; to get a key, see the API Key guide. All calls use the base https://api.nuvia.ai with the /v1 prefix and the Authorization: Bearer <your-api-key> header. See Authentication.

Setup

Store the key in an environment variable (NUVIA_API_KEY), never in the code.

Authenticated request (GET)

Lists the company’s agents (GET /v1/agents, scope agents:read).

POST with a JSON body

Creates a contact (POST /v1/contacts, scope contacts:create).

Pagination

Listing endpoints return { data, meta }, with meta containing page, rowsPerPage, totalCount, hasNextPage, and hasPreviousPage. Use the page (starts at 1) and rowsPerPage query params, and iterate while meta.hasNextPage is true.

Error handling

Check the status code. Authentication errors return { statusCode, message, error } (see Authentication): 401 (invalid/expired/revoked token) and 403 (missing scope).

Retry with backoff on 429

Some flows respond with 429 Too Many Requests. Responses don’t include rate limit headers (nor Retry-After). See Rate limits and use your own exponential backoff.
These retry snippets are minimal examples. In production, add jitter (randomness in the wait time) and a wait cap, to avoid several clients retrying at the same time (thundering herd).

Next steps

Integration examples

End-to-end scenarios: messages, webhooks, campaigns, and contacts.

API reference

All endpoints, parameters, and responses.