Skip to content

API reference

API: Analytics

Markdown version

MethodPathWhat it doesScope
GET/v1/analytics-exportsYour exports (the last 20)search:read
POST/v1/analytics-exportsExport a dataset (CSV or NDJSON) or a view, gzipped, as you see the data; or the analysis pack (owners): every dataset plus a README.md data dictionary. Ready within minutes; kept 24 hourssearch:read
GET/v1/analytics-exports/:idOne of your exports, with its download link once it's ready (signed, until it expires)search:read
GET/v1/analytics/catalogThe semantic layer: every dataset, its fields (dimensions) and measures, for building view specssearch:read
GET/v1/analytics/dictionaryThe data dictionary (Markdown): every dataset and column, as in the analysis pack's README.mdsearch:read
GET/v1/attributionAttribution of meetings, opportunities, pipeline and closed-won revenue to touchpoints (by channel, kind, UTM source or campaign) under a model: w_shaped (default), u_shaped, first_touch, last_touch, linear, time_decay; 90-day lookbacksearch:read
DELETE/v1/dashboard-email-optouts/:ownerIdTake back stopping someone's dashboard emails (so they can add you again)search:read
GET/v1/dashboard-schedulesDashboard emails you set up (owners: all)search:read
POST/v1/dashboard-schedulesEmail a dashboard on days of the week at a local time (IANA time zone) to members; each email reruns its views as each recipient and shows the change since their last onerecords:write
DELETE/v1/dashboard-schedules/:idStop and delete a dashboard emailrecords:write
PATCH/v1/dashboard-schedules/:idChange, pause (status paused) or resume (status active) a dashboard emailrecords:write
POST/v1/dashboard-schedules/:id/leaveStop getting a dashboard email you receive (any recipient)search:read
GET/v1/dashboardsYour dashboards and those shared with the organizationsearch:read
POST/v1/dashboardsSave a dashboard: views (specs, or analyses with their code), private or shared with the organization (each viewer still sees only what they may)records:write
DELETE/v1/dashboards/:idDelete a dashboard and its email schedules (its owner, or an organization owner)records:write
GET/v1/dashboards/:idA dashboard's definitionsearch:read
PATCH/v1/dashboards/:idChange a dashboard (its owner, or an organization owner)records:write
GET/v1/dashboards/:id/runRun a dashboard's views as you see the data (analyses in the sandbox)search:read
GET/v1/datasets/:dataset/rowsA dataset's rows (every field), in pages with a cursor, as you see the datasearch:read
GET/v1/live/callsCalls in progress: people's dialer and desk calls, voice agents' calls with their live transcript (owners), and meetings a bot is in; for owners and the callers' managerscalls:read
PUT/v1/members/:userId/regionSet a member's region for the team view (owners); null clears itmembers:write
GET/v1/team-viewBookings, win rate, pipeline created, meetings held, activities and focus by rep, team or region, for a period (YYYY-MM or FYyyyy-Qn, with quotas and attainment) or a date rangesearch:read
POST/v1/views/analysisRerun an analysis (its view spec and code) in the sandbox, as you see the datarecords:write
POST/v1/views/analyzeAn analysis a view spec can't express: the model writes a view spec and JavaScript that runs in the sandbox (no network) over the rows you may see, returning a table, a chart or a text; the code comes back to save on a dashboardrecords:write
POST/v1/views/askAsk a question in plain English: the model writes a view spec over the semantic layer (never SQL), which is checked and run as you see the datasearch:read
POST/v1/views/runRun a view spec (dataset, measures, dimensions, filters, time grain, sort, limit, chart) as you see the data; format csv returns the same rows as CSV textsearch:read

Examples

GET /v1/analytics-exports

Your exports (the last 20)

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

POST /v1/analytics-exports

Export a dataset (CSV or NDJSON) or a view, gzipped, as you see the data; or the analysis pack (owners): every dataset plus a README.md data dictionary. Ready within minutes; kept 24 hours

curl -s -X POST "https://api.closefinch.com/v1/analytics-exports" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/analytics-exports`, {
  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/analytics-exports/$ID

One of your exports, with its download link once it's ready (signed, until it expires)

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

GET /v1/analytics/catalog

The semantic layer: every dataset, its fields (dimensions) and measures, for building view specs

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

GET /v1/analytics/dictionary

The data dictionary (Markdown): every dataset and column, as in the analysis pack's README.md

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

GET /v1/attribution

Attribution of meetings, opportunities, pipeline and closed-won revenue to touchpoints (by channel, kind, UTM source or campaign) under a model: w_shaped (default), u_shaped, first_touch, last_touch, linear, time_decay; 90-day lookback

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

DELETE /v1/dashboard-email-optouts/$OWNER_ID

Take back stopping someone's dashboard emails (so they can add you again)

curl -s -X DELETE "https://api.closefinch.com/v1/dashboard-email-optouts/$OWNER_ID" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/dashboard-email-optouts/${ownerId}`, {
  method: "DELETE",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

GET /v1/dashboard-schedules

Dashboard emails you set up (owners: all)

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

POST /v1/dashboard-schedules

Email a dashboard on days of the week at a local time (IANA time zone) to members; each email reruns its views as each recipient and shows the change since their last one

curl -s -X POST "https://api.closefinch.com/v1/dashboard-schedules" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/dashboard-schedules`, {
  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();

DELETE /v1/dashboard-schedules/$ID

Stop and delete a dashboard email

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

PATCH /v1/dashboard-schedules/$ID

Change, pause (status paused) or resume (status active) a dashboard email

curl -s -X PATCH "https://api.closefinch.com/v1/dashboard-schedules/$ID" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/dashboard-schedules/${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/dashboard-schedules/$ID/leave

Stop getting a dashboard email you receive (any recipient)

curl -s -X POST "https://api.closefinch.com/v1/dashboard-schedules/$ID/leave" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/dashboard-schedules/${id}/leave`, {
  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/dashboards

Your dashboards and those shared with the organization

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

POST /v1/dashboards

Save a dashboard: views (specs, or analyses with their code), private or shared with the organization (each viewer still sees only what they may)

curl -s -X POST "https://api.closefinch.com/v1/dashboards" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/dashboards`, {
  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();

DELETE /v1/dashboards/$ID

Delete a dashboard and its email schedules (its owner, or an organization owner)

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

GET /v1/dashboards/$ID

A dashboard's definition

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

PATCH /v1/dashboards/$ID

Change a dashboard (its owner, or an organization owner)

curl -s -X PATCH "https://api.closefinch.com/v1/dashboards/$ID" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/dashboards/${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/dashboards/$ID/run

Run a dashboard's views as you see the data (analyses in the sandbox)

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

GET /v1/datasets/$DATASET/rows

A dataset's rows (every field), in pages with a cursor, as you see the data

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

GET /v1/live/calls

Calls in progress: people's dialer and desk calls, voice agents' calls with their live transcript (owners), and meetings a bot is in; for owners and the callers' managers

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

PUT /v1/members/$USER_ID/region

Set a member's region for the team view (owners); null clears it

curl -s -X PUT "https://api.closefinch.com/v1/members/$USER_ID/region" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/members/${userId}/region`, {
  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/team-view

Bookings, win rate, pipeline created, meetings held, activities and focus by rep, team or region, for a period (YYYY-MM or FYyyyy-Qn, with quotas and attainment) or a date range

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

POST /v1/views/analysis

Rerun an analysis (its view spec and code) in the sandbox, as you see the data

curl -s -X POST "https://api.closefinch.com/v1/views/analysis" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/views/analysis`, {
  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/views/analyze

An analysis a view spec can't express: the model writes a view spec and JavaScript that runs in the sandbox (no network) over the rows you may see, returning a table, a chart or a text; the code comes back to save on a dashboard

curl -s -X POST "https://api.closefinch.com/v1/views/analyze" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/views/analyze`, {
  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/views/ask

Ask a question in plain English: the model writes a view spec over the semantic layer (never SQL), which is checked and run as you see the data

curl -s -X POST "https://api.closefinch.com/v1/views/ask" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/views/ask`, {
  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/views/run

Run a view spec (dataset, measures, dimensions, filters, time grain, sort, limit, chart) as you see the data; format csv returns the same rows as CSV text

curl -s -X POST "https://api.closefinch.com/v1/views/run" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/views/run`, {
  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.