API v2 Overview
Heffl API v2 is the current REST API for programmatic access to your workspace. System and custom object records are exposed at resource paths such as/contacts, /companies, /deals, /quotations, and /tasks with a consistent response envelope and structured errors.
API v2 is in early preview. Endpoints will expand over time. Legacy API v1 remains fully supported for existing integrations.
Base URL
What’s new in v2
| Feature | v1 (legacy) | v2 |
|---|---|---|
| Response shape | Flat resource object | List: { data, meta } envelope; create/update/delete return the resource directly |
| Error shape | { code, message } | { error: { code, message, details? } } |
| Resource paths | Flat (/clients) | Resource-based (/contacts, /companies) |
| Contacts | POST /clients with type: "contact" | GET /contacts, POST /contacts, PATCH /contacts/{id}, DELETE /contacts/{id} |
| Companies | POST /clients with type: "company" | GET /companies, POST /companies, PATCH /companies/{id}, DELETE /companies/{id} |
| Deals | GET /deals, POST /deals, GET /deals/{id}, PATCH /deals/{id}, DELETE /deals/{id} | GET /deals, POST /deals, GET /deals/{id}, PATCH /deals/{id}, DELETE /deals/{id} |
| Quotations | — | GET /quotations, POST /quotations, GET /quotations/{id}, PATCH /quotations/{id}, DELETE /quotations/{id} |
| Tasks | GET /tasks, POST /tasks, GET /tasks/{id}, PATCH /tasks/{id}, DELETE /tasks/{id} | GET /tasks, POST /tasks, PATCH /tasks/{id}, DELETE /tasks/{id} |
Contacts
| Method | Path | Description |
|---|---|---|
GET | /contacts | List contacts (paginated, filterable) |
POST | /contacts | Create a contact |
PATCH | /contacts/{id} | Update a contact |
DELETE | /contacts/{id} | Delete a contact |
Companies
| Method | Path | Description |
|---|---|---|
GET | /companies | List companies (paginated, filterable) |
POST | /companies | Create a company |
PATCH | /companies/{id} | Update a company |
DELETE | /companies/{id} | Delete a company |
Deals
| Method | Path | Description |
|---|---|---|
GET | /deals | List deals (paginated, filterable) |
GET | /deals/{id} | Get a deal |
POST | /deals | Create a deal |
PATCH | /deals/{id} | Update a deal |
DELETE | /deals/{id} | Delete a deal |
Quotations
| Method | Path | Description |
|---|---|---|
GET | /quotations | List quotations (paginated, filterable) |
GET | /quotations/{id} | Get a quotation with line items and totals |
POST | /quotations | Create a quotation |
PATCH | /quotations/{id} | Update a quotation |
DELETE | /quotations/{id} | Delete a quotation |
clientId is a contact or company ID (clt_ prefix) — use the id from GET /contacts or GET /companies. Optional contactId (clt_) sets the contact person when the client is a company.
templateId is required (tpl_ prefix). List quotation templates with GET /document-templates?type=quotations — see Document templates. Pass dealId (dl_ prefix) to link the quote to a deal, and tags with tag_ IDs. Custom fields use cf_* keys — see Custom fields.
Document templates
Templates used for documents in Heffl — quotations, invoices, proforma invoices, purchase orders, and similar (not project or email templates). List bytype to get the templateId for API creates.
| Method | Path | Description |
|---|---|---|
GET | /document-templates | List document templates (filter by type, search by name) |
GET | /document-templates/{id} | Get a template with template-scoped custom fields |
Tasks
| Method | Path | Description |
|---|---|---|
GET | /tasks | List tasks (paginated, filterable) |
POST | /tasks | Create a task |
PATCH | /tasks/{id} | Update a task |
DELETE | /tasks/{id} | Delete a task |
entity and entityId:
Quick start
List contacts with your API key:400 if the contact has linked deals, invoices, or quotations.
Authentication
Same as v1 — include your API key in thex-api-key header on every request. See Authentication.
Response shape
List endpoints return a paginated envelope:data:
cf_* keys on each resource (for example cf_industry), not in a customFields object. See Custom fields.
Next steps
- Agent workflows — multi-step sequences (create deal, close deal, tasks)
- ID prefixes —
clt_,dpl_,dps_,dl_, and other ID formats - Authentication — API keys and permissions
- Errors — error codes and validation details
- Pagination — cursor-based paging with
pageSize - Listing & filters — search, sort, and structured filters
- Custom fields —
cf_*field conventions; discover keys viaGET /custom-fields - Document templates — templates for quotations, invoices, proforma invoices, and other documents
- Browse endpoint reference in the sidebar