Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.heffl.com/llms.txt

Use this file to discover all available pages before exploring further.

Listing & filters

List endpoints in API v2 share the same query model used in the Heffl app. This applies to GET /contacts, GET /companies, GET /deals, GET /quotations, GET /leads, and GET /tasks.
Pass filters as a JSON-encoded string in the query (use curl -G with --data-urlencode). Example: filters={"status":{"operator":"is","values":["ACTIVE"]}}. Do not rely on nested query-object encoding — JSON in one query parameter is the supported approach for agents and integrations.

Query parameters

ParameterTypeDefaultDescription
cursorstringnoneCursor from the previous response (meta.nextCursor)
pageSizenumber30Items per page (max 100)
searchstringnoneFull-text search (fields vary by endpoint — see below)
orderBystringcreatedAtSort field (allowed values vary by endpoint)
orderDirstringdescSort direction: asc or desc
filtersobjectnoneStructured filters (see below)
API v2 list endpoints use pageSize, not limit. Legacy v1 endpoints still use limit.

Basic list

curl "https://api.heffl.com/api/v2/contacts?pageSize=25" \
  -H "x-api-key: YOUR_API_KEY"
curl "https://api.heffl.com/api/v2/contacts?search=jane%40example.com" \
  -H "x-api-key: YOUR_API_KEY"

Sorting

curl "https://api.heffl.com/api/v2/contacts?orderBy=name&orderDir=asc" \
  -H "x-api-key: YOUR_API_KEY"

Structured filters

Each filter field accepts an object with operator and values:
{
  "stageId": {
    "operator": "is",
    "values": ["cs_abc123"]
  }
}
Pass filters as a JSON-encoded query parameter:
curl -G "https://api.heffl.com/api/v2/contacts" \
  -H "x-api-key: YOUR_API_KEY" \
  --data-urlencode 'filters={"stageId":{"operator":"is","values":["cs_abc123"]}}'

Available contact and company filters

FieldTypeValue typeExample operators
stageIdoptionstring (ID)is, is_not, is_any_of, is_none_of
leadStageIdoptionstring (ID)is, is_not, is_any_of, is_none_of
ownerUserIdoptionstring (ID)is, is_not, is_any_of, is_none_of
createdByIdoptionstring (ID)is, is_not, is_any_of, is_none_of
listIdoptionstring (ID)is, is_not, is_any_of, is_none_of
tagIdmulti-optionstring (ID)include, exclude, include_any_of, include_all_of, exclude_if_any_of, exclude_if_all
createdAtdateISO 8601 date-timeis, is_before, is_after, is_between, …
Option and tag filters take string IDs — the same prefixed IDs returned by the API (for example cs_abc123, usr_xyz789, tag_def456). Date filters take ISO 8601 strings. GET /contacts always returns contacts only and GET /companies always returns companies only — you do not need to pass a type filter. Both support search on name, number, email, and phone, and orderBy of createdAt, name, or number.

Available deal filters

FieldTypeValue typeExample operators
clientIdoptioncontact or company ID (clt_)is, is_not, is_any_of, is_none_of
pipelineIdoptionstring (ID)is, is_not, is_any_of, is_none_of
stageIdoptionstring (ID)is, is_not, is_any_of, is_none_of
statusoptionACTIVE, WON, LOSTis, is_not, is_any_of, is_none_of
priorityoptionLOW, MEDIUM, HIGHis, is_not, is_any_of, is_none_of
ownerUserIdoptionstring (ID)is, is_not, is_any_of, is_none_of
crmSourceIdoptionstring (ID)is, is_not, is_any_of, is_none_of
createdByIdoptionstring (ID)is, is_not, is_any_of, is_none_of
listIdoptionstring (ID)is, is_not, is_any_of, is_none_of
tagIdmulti-optionstring (ID)include, exclude, include_any_of, include_all_of, exclude_if_any_of, exclude_if_all
servicesmulti-optionstring (ID)include, exclude, include_any_of, include_all_of, exclude_if_any_of, exclude_if_all
createdAtdateISO 8601 date-timeis, is_before, is_after, is_between, …
expectedCloseDatedateISO 8601 date-timeis, is_before, is_after, is_between, …
Deals support search on title, number, and client name, and orderBy of createdAt, position, expectedCloseDate, or price. Client IDs use the clt_ prefix; pipeline and stage IDs use dpl_ and dps_; product filters use prd_. See ID prefixes.

Available lead filters

FieldTypeValue typeExample operators
stageIdoptionstring (ID)is, is_not, is_any_of, is_none_of
ownerUserIdoptionstring (ID)is, is_not, is_any_of, is_none_of
assignedTomulti-optionstring (ID)include, exclude, include_any_of, include_all_of, exclude_if_any_of, exclude_if_all
tagIdmulti-optionstring (ID)include, exclude, include_any_of, include_all_of, exclude_if_any_of, exclude_if_all
crmSourceIdoptionstring (ID)is, is_not, is_any_of, is_none_of
listIdoptionstring (ID)is, is_not, is_any_of, is_none_of
archivedoptionbooleanis, is_not
createdAtdateISO 8601 date-timeis, is_before, is_after, is_between, …
nextActivityDatedateISO 8601 date-timeis, is_before, is_after, is_between, …
createdByIdoptionstring (ID)is, is_not, is_any_of, is_none_of
Leads support search on name, title, mobile, email, secondary mobile, and website, and orderBy of createdAt, position, name, or value. Stage IDs use the lstg_ prefix; assignee and owner filters use usr_; tags use tag_.

Available task filters

FieldTypeValue typeExample operators
statusoptionOPEN, IN_PROGRESS, ON_HOLD, COMPLETED, CANCELLEDis, is_not, is_any_of, is_none_of
typeoptioncall, todo, meetingis, is_not, is_any_of, is_none_of
priorityoptionLOW, MEDIUM, HIGHis, is_not, is_any_of, is_none_of
createdByIdoptionstring (ID)is, is_not, is_any_of, is_none_of
assigneeIdsmulti-optionstring (ID)include, exclude, include_any_of, include_all_of, exclude_if_any_of, exclude_if_all
tagIdsmulti-optionstring (ID)include, exclude, include_any_of, include_all_of, exclude_if_any_of, exclude_if_all
createdAtdateISO 8601 date-timeis, is_before, is_after, is_between, …
startDatedateISO 8601 date-timeis, is_before, is_after, is_between, …
dueDatedateISO 8601 date-time (due date)is, is_before, is_after, is_between, …
Tasks support search on title, number, and description, and orderBy of createdAt, dueDate, startDate, number, or title. Assignee and tag filters use usr_ and tag_ prefixes.

Available quotation filters

FieldTypeValue typeExample operators
statusoptionDRAFT, SENT, ACCEPTED, REJECTEDis, is_not, is_any_of, is_none_of
clientIdoptioncontact or company ID (clt_)is, is_not, is_any_of, is_none_of
contactIdoptioncontact person ID (clt_)is, is_not, is_any_of, is_none_of
salesPersonIdoptionstring (ID)is, is_not, is_any_of, is_none_of
createdByIdoptionstring (ID)is, is_not, is_any_of, is_none_of
tagIdmulti-optionstring (ID)include, exclude, include_any_of, …
productIdmulti-optionstring (ID)include, exclude, include_any_of, …
templateIdoptionstring (ID)is, is_not, is_any_of, is_none_of
dealIdoptionstring (ID)is, is_not, is_any_of, is_none_of
subjecttextstringcontains, does_not_contain, …
numbertextstringcontains, does_not_contain, …
datedateISO 8601 date-timeis, is_before, is_after, is_between, …
expiryDatedateISO 8601 date-timeis, is_before, is_after, is_between, …
markedAcceptedOndateISO 8601 date-timeis, is_before, is_after, is_between, …
createdAtdateISO 8601 date-timeis, is_before, is_after, is_between, …
Quotations support search on number, subject, client name, and line item text. orderBy accepts createdAt, date, number, or expiryDate. Client IDs use clt_; deal IDs use dl_; template IDs use tpl_; product filters use prd_. See ID prefixes.
curl -G "https://api.heffl.com/api/v2/deals" \
  -H "x-api-key: YOUR_API_KEY" \
  --data-urlencode 'filters={"pipelineId":{"operator":"is","values":["dpl_abc123"]},"status":{"operator":"is","values":["ACTIVE"]}}'

Filter examples

Owner is a specific user:
{
  "ownerUserId": {
    "operator": "is",
    "values": ["usr_xyz789"]
  }
}
Contacts tagged with any of several tags:
{
  "tagId": {
    "operator": "include_any_of",
    "values": ["tag_abc", "tag_def"]
  }
}
Created in a date range:
{
  "createdAt": {
    "operator": "is_between",
    "values": ["2025-01-01T00:00:00.000Z", "2025-01-31T23:59:59.999Z"]
  }
}

Permissions

List results respect the API key user’s permissions:
  • Contacts and companies — If the user cannot view records owned by others, results are limited to records they own.
  • Deals — If the user cannot view deals owned by others, results include only deals they own or are assigned to.
  • Leads — If the user cannot view leads owned by others, results include only leads they own or are assigned to.
  • Tasks — If the user cannot view tasks assigned to others, results include only tasks they created or are assigned to.
  • Quotations — If the user cannot view quotations owned by others, results include only quotations where they are the sales person (or salesPersonId is unset).

Response

{
  "data": [
    {
      "id": "clt_abc123",
      "number": "CON001",
      "firstName": "Jane",
      "lastName": "Smith",
      "email": "[email protected]",
      "phone": "+971501234567",
      "salutation": "Ms.",
      "jobTitle": "Operations Manager",
      "companyId": "clt_company456",
      "createdAt": "2025-01-15T10:30:00.000Z",
      "cf_industry": "Technology"
    }
  ],
  "meta": {
    "nextCursor": "clt_xyz789",
    "hasMore": true
  }
}
Fetch the next page with the cursor:
curl "https://api.heffl.com/api/v2/contacts?cursor=clt_xyz789&pageSize=25" \
  -H "x-api-key: YOUR_API_KEY"