Beta. These endpoints are switched on per organization. While they are off for yours, each one answers
404 not_found, as if it didn't exist. Ask Finn support to turn them on.
Overview
A flow runs a common job that takes several API calls, in the right order, as one request: set up a voice agent, import contacts, launch a calling campaign, or set up a new workspace. They are the API behind the MCP server's flow_setup_agent, flow_import_contacts, flow_launch_campaign and flow_setup_workspace tools.
Every flow is a dry run unless you say otherwise. A dry run checks everything, lists each step it would take, and changes nothing. Send "dry_run": false to do it.
Base URL: https://api.hirefinn.ai/api/v1. See authentication and scopes.
Endpoints
| Method | Path | Scope | What it does |
|---|---|---|---|
POST | /flows/agent_setup | finn:write | Set up a voice agent (flow). |
POST | /flows/contact_import | crm:import | Import contacts (flow). |
POST | /flows/campaign_launch | voice:write | Launch a calling campaign (flow). |
POST | /flows/workspace_setup | admin:write | Set up the workspace (flow). |
Each step runs as the caller, with that step's own scope, role and approval rules, exactly as if you had made the call yourself. The scope column shows the scope the main steps need.
Credential
| Flow | Credential | Role |
|---|---|---|
agent_setup | Org API key or member token | Renting a number (rent_number) needs an Admin. |
contact_import | Member token required | The commit step is held for approval. |
campaign_launch | Org API key or member token | A Supervisor or above when role rules are on. |
workspace_setup | Member token required | Admin or Owner. |
An org key acts as an Admin. A role below the one a flow needs gets 403 forbidden.
What each flow does
| Flow | Send | Steps |
|---|---|---|
agent_setup | The agent, its handbook, up to 10 knowledge documents, speech settings, and optionally a number to rent | create_agent (POST /finns), handbook, knowledge documents, speech_settings, enable_flow, then rent_number (POST /phone_numbers, costs money). Checks the voice exists first. |
contact_import | Up to 500 rows, and a column mapping if you have one | map_columns (skipped when you send a mapping), check_duplicates (a dry import), commit (POST /crm/imports). |
campaign_launch | finn_id, phone_number_id and audience_id (required), and optionally name, schedule, recording_enabled, redial, max_concurrency | One step, start_campaign (POST /deployments). It costs money and is held for approval. |
workspace_setup | A name, profile, timezone and up to 25 invitations | rename, profile, timezone, then each invitation (held for approval). Also reads the integrations checklist. Pipeline stages and calling hours aren't set here. |
Real runs
A real run ("dry_run": false) needs an Idempotency-Key header (400 idempotency_key_required). A retry with the same key doesn't repeat steps that are done. See idempotency.
A step that is held for approval stops the flow there with "status": "pending_approval". The step carries its approval details; the steps after it are not_run. Once it is approved, run the flow again with the same Idempotency-Key to carry on. If your organization can't resume held flows yet, that run answers 409 resume_unavailable. See requests held for approval.
The answer
| Field | Meaning |
|---|---|
flow, dry_run | What ran, and whether it was a dry run. |
status | planned (dry run, nothing blocks it), blocked (a check failed), pending_approval, failed or done. |
checks | Each check, with ok and a detail. |
blocked_by | The checks that failed. |
steps | Each step: step, method, path, body, why, costs_money, and its status: planned, blocked, done, pending_approval, failed or not_run. A step that ran adds http_status and result or error. |
next | What to do next, in plain words. |
Example: check a campaign before launching it
curl -X POST https://api.hirefinn.ai/api/v1/flows/campaign_launch \
-H "Authorization: Bearer $FINN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"finn_id": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
"phone_number_id": "5a4b3c2d-1e0f-4a9b-8c7d-6e5f4a3b2c1d",
"audience_id": "9f8e7d6c-5b4a-4c3d-8e2f-1a0b9c8d7e6f",
"name": "November renewals"
}'
{
"flow": "campaign_launch",
"dry_run": true,
"status": "planned",
"checks": [
{ "check": "agent_exists", "ok": true },
{ "check": "number_exists", "ok": true },
{ "check": "audience_ready", "ok": true, "detail": { "recipients": 412, "name": "Renewals due December" } },
{ "check": "call_credit", "ok": true, "detail": { "balance": 18450 } },
{ "check": "calling_window", "ok": true },
{ "check": "do_not_call", "ok": true, "detail": "Numbers on your do-not-call list are skipped when the campaign dials." }
],
"blocked_by": [],
"steps": [
{
"step": "start_campaign",
"method": "POST",
"path": "/deployments",
"body": {
"finn_id": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
"phone_number_id": "5a4b3c2d-1e0f-4a9b-8c7d-6e5f4a3b2c1d",
"audience_id": "9f8e7d6c-5b4a-4c3d-8e2f-1a0b9c8d7e6f",
"name": "November renewals"
},
"why": "Start the campaign (spends call credit: held for a person to approve; Supervisors and up)",
"costs_money": true,
"status": "planned"
}
],
"next": "Nothing was changed. Run again with dry_run: false and an Idempotency-Key to do it."
}
Rate limits
20 flow runs per minute per credential, dry runs included (429 rate_limited). The steps also count toward the limits of the endpoints they call. See rate limits.
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | The body isn't valid, for example dry_run isn't true or false, or a required field is missing. |
| 400 | idempotency_key_required | A real run without an Idempotency-Key. |
| 401 | api_key_required, invalid_api_key | The credential is missing, unknown or revoked. |
| 403 | forbidden | The caller's role is below what the flow needs. |
| 403 | insufficient_scope | A step needs a scope the credential lacks. The step shows the error. |
| 404 | not_found | Flows aren't turned on for your organization. |
| 409 | resume_unavailable | A step is held and this organization can't resume held flows yet. |
| 429 | rate_limited | Over 20 runs a minute. Wait Retry-After seconds. |
| 503 | unavailable | The organization's settings couldn't be read. Try again shortly. |