Skip to content

API reference

API: Lead routing

Markdown version

MethodPathWhat it doesScope
GET/v1/inbound/campaignsConversion by campaign (UTM): visitors, chats, qualified, bookedinbound:read
GET/v1/inbound/creditsMeetings booked for teammates and credited, per personinbound:read
GET/v1/inbound/formsForms: drafts and published, with the hosted link and the embed codeinbound:read
POST/v1/inbound/formsAdd a form (a draft until an owner publishes it)inbound:write
PATCH/v1/inbound/forms/:idChange a form (it goes back to draft)inbound:write
POST/v1/inbound/forms/:id/publishPublish or unpublish a form (owners: the approval for agent-drafted forms)settings:write
POST/v1/inbound/forms/draftHave the agent draft a form from a brief (a draft for an owner to review and publish)inbound:write
GET/v1/inbound/leadsInbound leads: source, grade, owner, how they were routed, and their response timeinbound:read
POST/v1/inbound/leadsSend a lead in (it's graded, routed and recorded like any other)inbound:write
GET/v1/inbound/leads/:idA lead and its routing decision: every rule evaluated, the candidates and why each was skippedinbound:read
POST/v1/inbound/leads/:id/touchAccept a lead (stops its response-time clock)inbound:write
POST/v1/inbound/meetings/book-forBook a meeting for a teammate (SDR → AE): the meeting is theirs, the credit yoursinbound:write
GET/v1/inbound/referralsPartner referrals (unknown partners wait for review)inbound:read
POST/v1/inbound/referrals/:id/decideAccept (creates and links the records) or reject a referralinbound:write
GET/v1/inbound/sourcesLead intake sources (webhook, Typeform, Google Forms, Facebook Lead Ads, CSV)inbound:read
POST/v1/inbound/sourcesAdd an intake source (owners); its signing secret is shown oncesettings:write
POST/v1/inbound/sources/:id/csvUpload leads to a CSV source (rows as JSON objects; up to 1,000)inbound:write
POST/v1/inbound/sources/:id/rotate-secretReplace a source's signing secret (owners); shown oncesettings:write
GET/v1/routing/decisionsRouting decisions, newest first (optionally for one queue)inbound:read
GET/v1/routing/graphThe current routing graph and its earlier versionsinbound:read
POST/v1/routing/graphPublish a new version of the routing graph (owners): condition, branch, account owner, territory, queue and person nodessettings:write
PUT/v1/routing/people/:id/awayMark someone away until a time (round-robin skips them); yourself, or anyone for ownersinbound:write
GET/v1/routing/queuesRound-robin queuesinbound:read
POST/v1/routing/queuesAdd a round-robin queue (owners)settings:write
PATCH/v1/routing/queues/:idChange a queue's name, members, weights or caps, or archive it (owners)settings:write
GET/v1/routing/settingsSLA by tier, escalation, the enterprise tier for demo prep, the partner manager, the meeting credit ruleinbound:read
PUT/v1/routing/settingsChange routing settings (owners)settings:write
POST/v1/routing/simulateDry run: what the current graph would decide for a lead (nothing is written)inbound:read

Examples

GET /v1/inbound/campaigns

Conversion by campaign (UTM): visitors, chats, qualified, booked

curl -s "https://api.closefinch.com/v1/inbound/campaigns" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/inbound/campaigns`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

GET /v1/inbound/credits

Meetings booked for teammates and credited, per person

curl -s "https://api.closefinch.com/v1/inbound/credits" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/inbound/credits`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

GET /v1/inbound/forms

Forms: drafts and published, with the hosted link and the embed code

curl -s "https://api.closefinch.com/v1/inbound/forms" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/inbound/forms`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

POST /v1/inbound/forms

Add a form (a draft until an owner publishes it)

curl -s -X POST "https://api.closefinch.com/v1/inbound/forms" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/inbound/forms`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

PATCH /v1/inbound/forms/$ID

Change a form (it goes back to draft)

curl -s -X PATCH "https://api.closefinch.com/v1/inbound/forms/$ID" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/inbound/forms/${id}`, {
  method: "PATCH",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

POST /v1/inbound/forms/$ID/publish

Publish or unpublish a form (owners: the approval for agent-drafted forms)

curl -s -X POST "https://api.closefinch.com/v1/inbound/forms/$ID/publish" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/inbound/forms/${id}/publish`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

POST /v1/inbound/forms/draft

Have the agent draft a form from a brief (a draft for an owner to review and publish)

curl -s -X POST "https://api.closefinch.com/v1/inbound/forms/draft" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/inbound/forms/draft`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

GET /v1/inbound/leads

Inbound leads: source, grade, owner, how they were routed, and their response time

curl -s "https://api.closefinch.com/v1/inbound/leads" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/inbound/leads`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

POST /v1/inbound/leads

Send a lead in (it's graded, routed and recorded like any other)

curl -s -X POST "https://api.closefinch.com/v1/inbound/leads" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/inbound/leads`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

GET /v1/inbound/leads/$ID

A lead and its routing decision: every rule evaluated, the candidates and why each was skipped

curl -s "https://api.closefinch.com/v1/inbound/leads/$ID" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/inbound/leads/${id}`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

POST /v1/inbound/leads/$ID/touch

Accept a lead (stops its response-time clock)

curl -s -X POST "https://api.closefinch.com/v1/inbound/leads/$ID/touch" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/inbound/leads/${id}/touch`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

POST /v1/inbound/meetings/book-for

Book a meeting for a teammate (SDR → AE): the meeting is theirs, the credit yours

curl -s -X POST "https://api.closefinch.com/v1/inbound/meetings/book-for" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/inbound/meetings/book-for`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

GET /v1/inbound/referrals

Partner referrals (unknown partners wait for review)

curl -s "https://api.closefinch.com/v1/inbound/referrals" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/inbound/referrals`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

POST /v1/inbound/referrals/$ID/decide

Accept (creates and links the records) or reject a referral

curl -s -X POST "https://api.closefinch.com/v1/inbound/referrals/$ID/decide" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/inbound/referrals/${id}/decide`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

GET /v1/inbound/sources

Lead intake sources (webhook, Typeform, Google Forms, Facebook Lead Ads, CSV)

curl -s "https://api.closefinch.com/v1/inbound/sources" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/inbound/sources`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

POST /v1/inbound/sources

Add an intake source (owners); its signing secret is shown once

curl -s -X POST "https://api.closefinch.com/v1/inbound/sources" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/inbound/sources`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

POST /v1/inbound/sources/$ID/csv

Upload leads to a CSV source (rows as JSON objects; up to 1,000)

curl -s -X POST "https://api.closefinch.com/v1/inbound/sources/$ID/csv" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/inbound/sources/${id}/csv`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

POST /v1/inbound/sources/$ID/rotate-secret

Replace a source's signing secret (owners); shown once

curl -s -X POST "https://api.closefinch.com/v1/inbound/sources/$ID/rotate-secret" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/inbound/sources/${id}/rotate-secret`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

GET /v1/routing/decisions

Routing decisions, newest first (optionally for one queue)

curl -s "https://api.closefinch.com/v1/routing/decisions" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/routing/decisions`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

GET /v1/routing/graph

The current routing graph and its earlier versions

curl -s "https://api.closefinch.com/v1/routing/graph" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/routing/graph`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

POST /v1/routing/graph

Publish a new version of the routing graph (owners): condition, branch, account owner, territory, queue and person nodes

curl -s -X POST "https://api.closefinch.com/v1/routing/graph" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/routing/graph`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

PUT /v1/routing/people/$ID/away

Mark someone away until a time (round-robin skips them); yourself, or anyone for owners

curl -s -X PUT "https://api.closefinch.com/v1/routing/people/$ID/away" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/routing/people/${id}/away`, {
  method: "PUT",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

GET /v1/routing/queues

Round-robin queues

curl -s "https://api.closefinch.com/v1/routing/queues" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/routing/queues`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

POST /v1/routing/queues

Add a round-robin queue (owners)

curl -s -X POST "https://api.closefinch.com/v1/routing/queues" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/routing/queues`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

PATCH /v1/routing/queues/$ID

Change a queue's name, members, weights or caps, or archive it (owners)

curl -s -X PATCH "https://api.closefinch.com/v1/routing/queues/$ID" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/routing/queues/${id}`, {
  method: "PATCH",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

GET /v1/routing/settings

SLA by tier, escalation, the enterprise tier for demo prep, the partner manager, the meeting credit rule

curl -s "https://api.closefinch.com/v1/routing/settings" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/routing/settings`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

PUT /v1/routing/settings

Change routing settings (owners)

curl -s -X PUT "https://api.closefinch.com/v1/routing/settings" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/routing/settings`, {
  method: "PUT",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

POST /v1/routing/simulate

Dry run: what the current graph would decide for a lead (nothing is written)

curl -s -X POST "https://api.closefinch.com/v1/routing/simulate" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/routing/simulate`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

Request and response schemas: https://www.closefinch.com/openapi.json. All resources: API reference.

Send feedback

Tell us what's broken, confusing or missing on this page, or an idea. It goes to the team that builds the product.

Please don't include passwords or card numbers.
Only to reply about this. Never added to any mailing list.