API v1 reference
Base URL, pagination, response envelope, and the full list of REST API v1 resource groups.
This page covers the conventions shared by every /api/v1/* endpoint. Deep-dive pages for the most commonly integrated resources — Contacts, Properties, Deals, and Inquiries & leads — follow this one. For every other resource, the tables below list the exact routes; the full machine-readable spec is always at GET /api/v1/openapi.json.
Base URL
https://api.avensa.bg/api/v1
Requests are versioned at the path level (/api/v1). All endpoints require authentication — see Authentication and API keys.
Pagination
List endpoints share four query parameters:
| Parameter | Description |
|---|---|
limit | Results per page. 1–100, default 25. |
cursor | Opaque cursor from the previous response's meta.next_cursor. |
sort | Comma-separated sort fields; prefix with - for descending. Example: -created_at,price. |
fields | Comma-separated list to select a field subset. Example: id,title,price. |
List response envelope:
{
"data": [ { "...": "..." } ],
"meta": {
"count": 25,
"total": 340,
"has_more": true,
"next_cursor": "eyJpZCI6Ii4uLiJ9"
}
}
A single-resource response wraps the object in data: { "data": { "...": "..." } }.
Idempotency
POST endpoints that create a resource accept an optional Idempotency-Key header (any string, up to 255 characters). Retrying the same request with the same key (scoped to account + method + path) replays the original response instead of creating a duplicate — the replay carries X-Idempotency-Replay: true. A concurrent retry that's still in flight returns 409 Conflict. Recommended for anything wired through Zapier or a retrying job queue.
Idempotency-Key: a1b2c3d4-1234-5678-9abc-def012345678
Optimistic locking
Deals (and some other mutable resources) carry a version integer. Updates must include the version you last read; a stale version returns 409 Conflict so you can re-fetch and retry instead of silently overwriting a concurrent change.
Resource groups
| Group | Base path | Deep dive |
|---|---|---|
| Properties | /properties, /properties/{id} (GET, PATCH, PUT, DELETE), /properties/bulk (PATCH, up to 100), /properties/{id}/images, /properties/changes, /properties/duplicate-check | Properties |
| Units | /units, /units/{id} | Properties |
| Floor plans | /properties/{id}/floor-plans, /floor-plans/bulk, /floor-plans/{planId} | Floor plans |
| Contacts | /contacts, /contacts/{id}, /contacts/changes, /contacts/matches | Contacts |
| Deals | /deals, /deals/{id}, /deals/changes | Deals |
| Inquiries | /inquiries (create-only, from a website form) | Inquiries & leads |
| Leads | /leads (create-only, generic inbound lead) | Inquiries & leads |
| Tasks | /tasks, /tasks/{id}, /tasks/changes | — |
| Viewings | /viewings, /viewings/{id} | — |
| Calls | /calls, /calls/{id}, /calls/{id}/recording, /calls/voip-token | — |
| Notes | /notes, /notes/{id} | — |
| Documents | /documents, /documents/{id}, /documents/{id}/download, /documents/{id}/link | — |
| Conversations | /conversations, /conversations/timeline | — |
| Emails / Messages | /emails/send, /messages/send | — |
| Templates | /templates, /templates/{id} | — |
| Webhooks | /webhooks, /webhooks/{id}, /webhooks/{id}/deliveries | Webhooks and automation connectors |
| Automation rules | /automations/catalog (public), /automations/rules, /automations/rules/{id} | Webhooks and automation connectors |
| Exports | /exports, /exports/{id} | — |
| Imports | /imports, /imports/{id}, /imports/{id}/items | Data import formats |
| Custom fields | /custom-fields, /custom-fields/{id} (PATCH, incl. is_public) | Contacts |
| Dictionaries | /dictionaries/{category} | Properties |
| Companies | /companies, /companies/{id} | — |
| Commissions | /commissions, /commissions/{id} | — |
| Expenses | /expenses, /expenses/{id} | — |
| Invoices | /invoices, /invoices/{id} | — |
| Pipelines | /pipelines (read-only, pipelines with stages) | — |
| Agents (team members) | /agents | — |
| Batch | /batch | — |
| Feeds | /feeds/properties (JSON Feed / RSS / XML; recommended website source) | Property feed for your website |
| Events | /events/stream (SSE) | — |
| Changelog | /changelog | API changelog |
| Mapbox config | /mapbox/config | — |
| OAuth | /oauth/authorize, /oauth/token, /oauth/revoke, /oauth/userinfo, /oauth/register | Authentication and API keys |
For request/response schemas of any endpoint not covered by a deep-dive page, fetch GET /api/v1/openapi.json — it is generated from the same route definitions the app runs against, so it never drifts from this reference.
Errors
Errors and rate limiting share one shape across every endpoint — see Rate limits and errors.