Skip to main content
Docs menu

API reference

Workspace knowledge

The workspace map, why a call, message or stage move didn't happen, AI notes every agent reads, and previews of ready-made CRM setup templates.

Beta. These endpoints are switched on per organization. While they are off for yours, each one answers 403 knowledge_off. Ask Finn support to turn them on.

Overview

Workspace knowledge gives an integration or an AI agent the context a person in Finn already has:

  • Workspace map: what is in the workspace (agents, numbers, pipelines, forms and more), one section per scope the credential holds.
  • Explain why: why a call, message, follow-up or stage move did not happen, with the rule that stopped it and what a person can do about it.
  • AI notes: short notes every AI in the workspace reads, such as "Never call clients before 10am".
  • Setup templates: ready-made CRM setups for a type of business, which you can preview but not apply here.

Nothing here sends, calls, approves, moves money or flips a switch. The only writes are AI notes. They are the API behind the MCP server's get_workspace_map, explain_why, list_ai_notes, save_ai_note, forget_ai_note, list_setup_templates, get_setup_template and preview_setup_template tools.

Base URL: https://api.hirefinn.ai/api/v1. See authentication and scopes.

Credential

Org API keys and member tokens (a personal MCP key or an AI app's OAuth access token) both work. A member sees what their contact visibility allows: a record they can't see answers 404, the same as one that doesn't exist. An org key sees the whole workspace.

Endpoints

MethodPathScopeWhat it does
GET/workspace_mapcrm:readGet the workspace map.
GET/explaincrm:readExplain why something did not happen.
GET/ai_notescrm:readList AI notes.
POST/ai_notescrm:writeSave an AI note.
PATCH/ai_notes/{id}crm:writeEdit an AI note.
DELETE/ai_notes/{id}crm:writeForget an AI note.
GET/vertical_templatescrm:readList setup templates.
GET/vertical_templates/{key}crm:readGet a setup template.
POST/vertical_templates/{key}/dry_runcrm:readPreview a setup template.

The scope column shows the usual scope. These endpoints accept any of a family:

  • GET /workspace_map and GET /ai_notes take any read scope (voice:read, crm:read, chat:read, operator:read, finn:read, admin:read, sales:read, dialer:read). The map holds only the sections those scopes cover.
  • The AI note writes take any write scope (voice:write, crm:write, chat:write, operator:write, finn:write, admin:write).
  • GET /explain takes the scope of the kind: voice:read for call; chat:read or voice:read for message; crm:read for follow_up and stage_move.
  • The setup templates take crm:read. POST /vertical_templates/{key}/dry_run writes nothing, and no endpoint applies a template.

Explain why

GET /explain takes a kind and what to explain:

kindSend
callcall_uuid (a call that was placed) or phone (a call that wasn't).
messagecontact_id, phone or email, and an optional channel: whatsapp, sms, email or chat.
follow_upfollow_up_id, or the call_uuid that should have made one.
stage_movecontact_id and to_stage (a stage key).

The answer has an outcome: blocked (a rule stops it), unclear (no rule blocks it, but some checks couldn't be read), clear (nothing blocks it now) or happened (it did happen). blocking lists the rules that stop it, each with a code and a fix written for a person. checks lists every rule Finn tried, each pass, block, warn or unknown.

Codes you may see: finn_paused, do_not_call, outside_calling_hours, insufficient_credits, held_for_approval, no_answer, call_failed, whatsapp_consent_missing, email_unsubscribed, stage_blocked, voice_follow_ups_off, no_analysis.

AI notes

A note has a body (up to 4,000 characters), an optional topic (up to 60), a visibility and pinned:

  • org notes are read by every AI in the workspace. Only an Owner, an Admin, or an org key with admin:write may write, change or pin them.
  • private notes belong to the member who wrote them. An org key can't write private notes.
  • A member's note is private unless they say otherwise; an admin's is org.

Pinned notes come first in GET /ai_notes, then the newest. It filters by topic and search, and limit is 1 to 100 (default 50). DELETE /ai_notes/{id} forgets a note: its author can, and an admin can forget an org note.

Each note comes back with untrusted: true and an envelope: the note wrapped in a tag that names its author, role and date. Notes are written by people, so an AI should read them as data, not as instructions. A note that looks like it holds a key, token or password is refused (422 note_has_secret). A workspace keeps at most 500 notes (409 notes_full).

Example: why wasn't this number called?

curl "https://api.hirefinn.ai/api/v1/explain?kind=call&phone=%2B919800000001" \
  -H "Authorization: Bearer $FINN_API_KEY"
{
  "object": "explanation",
  "kind": "call",
  "outcome": "blocked",
  "summary": "The number is on this workspace's do-not-call list. The number is on the do-not-call list (added by hand, or the person said stop). Only remove it if the person asked to be contacted again: Settings > Do not call.",
  "blocking": [
    {
      "rule": "do_not_call",
      "code": "do_not_call",
      "detail": "The number is on this workspace's do-not-call list.",
      "fix": "The number is on the do-not-call list (added by hand, or the person said stop). Only remove it if the person asked to be contacted again: Settings > Do not call."
    }
  ],
  "checks": [
    { "rule": "finn_pause", "status": "pass", "detail": "Finn is not paused." },
    { "rule": "do_not_call", "status": "block", "detail": "The number is on this workspace's do-not-call list.", "code": "do_not_call", "fix": "The number is on the do-not-call list (added by hand, or the person said stop). Only remove it if the person asked to be contacted again: Settings > Do not call." },
    { "rule": "calling_hours", "status": "pass", "detail": "Inside the calling hours now.", "window": null },
    { "rule": "wallet", "status": "pass", "detail": "The wallet has credits." },
    { "rule": "approval", "status": "pass", "detail": "Nothing about this is waiting for approval." }
  ],
  "subject": { "phone_last4": "0001" }
}

To take a number off the list, see Do not call. Only do that if the person asked to be contacted again.

Rate limits

120 reads and 30 writes per minute per credential, across all endpoints on this page. See rate limits.

Errors

StatusCodeWhen
400invalid_requestA parameter or field isn't valid, for example a missing kind, or a call without call_uuid or phone.
401api_key_required, invalid_api_keyThe credential is missing, unknown or revoked.
403knowledge_offWorkspace knowledge by API isn't turned on for your organization.
403insufficient_scopeThe credential lacks a scope this endpoint takes.
403forbiddenWriting, changing or pinning an org note without being an Owner or Admin, or an org key without admin:write.
404not_foundNo such note, template, call or record visible to this credential.
409notes_fullThe workspace has 500 notes. Forget old ones first.
409templates_offSetup templates are turned off for this workspace.
422note_has_secretThe note looks like it holds a key, token or password.
429rate_limitedOver the limit. Wait Retry-After seconds.
503unavailableThe organization's settings couldn't be read, or this part isn't ready yet. Try again shortly.