Skip to main content

API reference

Agency

Run client workspaces: clients, limits, usage (CSV), templates and sign-up requests. Agency home workspaces only.

Beta. Off until Finn turns the Agency API on for your agency. Shapes can still change before general availability.

Overview

The Agency API lets an approved agency run its client workspaces from its own systems: list and create clients, pause and reactivate them, set usage limits across clients, push templates, and read usage per client (also as CSV, for billing your clients).

Base URL: https://api.hirefinn.ai/api/v1. Auth: Authorization: Bearer finn_live_.... See authentication and scopes.

Who can call it

  • Only an approved agency's home workspace. Make the key in that workspace (Settings › Integrations › API keys, group "Agency"). The agency:read and agency:write scopes are offered there and nowhere else.
  • Never a client workspace. A key made in a client workspace answers 403 agency_client_org, even with agency scopes. A client never manages its siblings.
  • Any other workspace answers 403 not_agency; an agency that is applied for, suspended or closed answers 403 agency_not_approved.
  • The API is off by default for each agency (403 agency_api_off). Ask Finn support to turn it on.

Endpoints

MethodPathScopeRate limit (per API key)
GET/agencyagency:read120 per minute, shared by all agency reads
GET/agency/clientsagency:readRead bucket
POST/agency/clientsagency:write30 per minute, shared by all agency writes
GET/agency/clients/{client_id}agency:readRead bucket
POST/agency/clients/{client_id}/suspendagency:writeWrite bucket
POST/agency/clients/{client_id}/resumeagency:writeWrite bucket
GET/agency/clients/{client_id}/limitsagency:readRead bucket
PUT/agency/clients/{client_id}/limitsagency:writeWrite bucket
PATCH/agency/clients/{client_id}/limitsagency:writeWrite bucket
GET/agency/limitsagency:readRead bucket
PUT/agency/limitsagency:writeWrite bucket
GET/agency/usageagency:readRead bucket
GET/agency/templatesagency:readRead bucket
GET/agency/template_pushesagency:readRead bucket
POST/agency/template_pushesagency:writeWrite bucket
GET/agency/template_pushes/{push_id}agency:readRead bucket
GET/agency/signupsagency:readRead bucket
POST/agency/signups/{signup_id}/approveagency:writeWrite bucket
POST/agency/signups/{signup_id}/rejectagency:writeWrite bucket

Every write takes an Idempotency-Key header. See idempotency.

Clients and the client cap

POST /agency/clients takes name and owner_email, creates the client workspace and emails its first Owner an invite. It counts against your client cap, checked again under a lock, so two creates at once can never both take the last place. At the cap it answers 409 cap_reached. A client above your plan's included clients may be billed as an extra client place.

Closing a client is not in the API: do it in Settings › Agency.

Limits across clients

PUT /agency/limits sets the same limits on many clients at once: { "client_ids": "all" | [ids], "limits": { ... } }. The limit fields are max_agents, monthly_minutes and monthly_spend_minor; null removes a limit. The answer lists each client's result.

Usage

GET /agency/usage?month=YYYY-MM returns minutes, calls and spend per client for one UTC month. Add client_id for one client, and format=csv for a CSV with one row per client (the same file as Settings › Agency › Usage).

Sign-up requests

When your agency turns on sign-up requests (Settings › Agency), businesses can ask for a workspace at /join/request on your white-label domain. Each request waits as pending. approve creates the client exactly like POST /agency/clients (the sign-up email becomes its Owner); at the cap it answers 409 cap_reached and the request stays pending. reject takes an optional reason.

Errors

StatusCodeMeaning
403agency_api_offThe Agency API is not on for your agency.
403agency_client_orgThe key belongs to a client workspace.
403not_agencyThe workspace is not an agency's home workspace.
403agency_not_approvedThe agency is not approved (applied, suspended or closed).
409cap_reachedYou are at your client cap.
409already_decidedSomeone already approved or rejected this sign-up request.

See errors for the shared codes.