Skip to main content

Agent workflows

These sequences show how to chain API v2 calls for typical automation tasks. All requests require the x-api-key header. See ID prefixes for ID formats.

Create a deal in a pipeline

  1. List pipelines — get dpl_ and dps_ IDs:
Pick a pipeline id and an ACTIVE stage id from stages (check type is ACTIVE).
  1. Resolve the client — search contacts or companies, or create one:
  1. Optional: custom fields — discover valid cf_* keys:
  1. Create the deal:
stageId is optional; if omitted, the first ACTIVE stage in the pipeline is used.

Close a deal (won or lost)

Option A — update stage (recommended when matching your pipeline):
Use a stage with type WON or LOST from GET /pipelines. Option B — set status directly:

Create a follow-up task on a deal

entity and entityId must be sent together. List users with GET /users for assignee IDs.

Create a quotation

  1. List quotation document templates (layout presets for quotations, not project templates) — get a tpl_ ID:
  1. Optional: template custom fieldsGET /document-templates/{id} for customFields keys to send as cf_* on create.
  2. Create the quotation — see Document templates and API v2 overview — Quotations.

List open deals in a pipeline

Pass filters as a JSON-encoded query string (recommended for agents and curl):
Paginate with cursor from meta.nextCursor. See Listing & filters.

Delete a contact

Deletion fails with 400 if the contact has linked deals, invoices, or quotations:

Error handling

All errors use { "error": { "code", "message", "details?" } }. Validation failures include details.issues with field and message. See Errors. Retry 429 after the rate limit window; do not retry 400 without changing the request.