What you need to build
For most integrations you’ll expose two kinds of endpoints:
A single integration usually involves several of each. The cancellation flow, for example, uses one
GET to look up the customer’s account (via Attributes), then a POST to execute the cancellation (via Actions).
The contract
Every endpoint Fini calls needs to satisfy four things:- HTTPS only. No HTTP fallback. Use a real TLS certificate; self-signed certs will fail.
- JSON in, JSON out. Request bodies (for
POST/PUT) and all responses must beapplication/json. No XML, no form-encoded. - API key auth via header. Every request from Fini carries an
x-api-keyheader. Validate it on every call. - Predictable response shapes. Return a flat JSON object with stable field names. The fields you return become the variables the agent can reference; they need to be the same every time.
Authentication
Fini sends a single header on every request:401 Unauthorized.
Sample GET endpoint
UseGET when the agent needs to read something from your system. The customer’s identifier (usually email, sometimes a customer ID) comes in as a query parameter. The response is a flat JSON object with all the fields the agent might need.
Query parameters
string
required
The customer’s identifier. Fini interpolates this from the conversation context when it makes the call. Use a customer ID instead if your system isn’t email-keyed.
string
Optional. If a single endpoint serves multiple lookup variants (phone-only details vs. full account details), use
flow to route within one endpoint instead of building several.Request
Response
Return200 OK with a flat JSON object containing every field the agent might want to reference:
string
Your system’s primary identifier for this customer. Useful for downstream Actions that need to write back.
string
The customer’s current plan or tier. Low-cardinality enum recommended (e.g.,
Free, Pro, Enterprise).boolean
Whether this customer qualifies for VIP treatment. The agent can gate behavior on this in Reply Rules and Rulebook.
boolean
Whether the account is currently closed or suspended. Critical for the agent to know before attempting any writes.
string
E.164-formatted phone number, or any consistent format your system uses.
string
Postal code or ZIP. String, not number, leading zeros matter.
string
ISO 8601 year-month, e.g.,
2024-03. Useful for tenure-based logic.string
ISO 8601 date the subscription next renews. Surface this in replies to set customer expectations.
is_vip is true…”), in Reply templates (interpolating plan and subscription_renews_at into the agent’s message), or as inputs to subsequent Actions.
Error responses should use the appropriate HTTP status code with a JSON body explaining what went wrong:
Sample POST / PUT endpoint
UsePOST or PUT when the agent needs to act on your system, change state, trigger a workflow, write to a database. Follow REST conventions: POST to create something new, PUT to update or replace existing state, DELETE to remove. If you only pick one, POST is the safest default.
Body parameters
string
required
The new phone number to set. Fini interpolates the value from the conversation context, typically extracted from the customer’s own message or collected via a form.
Request
Response
Return a flat JSON object with at minimumsuccess and message:
boolean
required
Whether the operation completed successfully. Fini branches deterministically on this, the agent composes one reply path when
true, another when false.string
required
Human-readable description of what happened. The agent can pass this through to the customer directly, or use it to compose a richer reply.
string
Required on failure. Machine-readable code (e.g.,
INVALID_PHONE_FORMAT, USER_NOT_FOUND) so the agent can route on specific failure modes in Rulebook.success: false and an error_code:
200 OK for “the operation completed, here’s the result” (even if success is false, a known business-rule failure isn’t an HTTP error). Reserve 4xx/5xx for protocol-level failures: bad input, missing auth, server crashes.
Response shape guidance
A few patterns that make your APIs much easier for Fini to consume: Flat is better than nested. Fini’s mapping layer expects top-level keys. Don’t bury values three levels deep in a nested object, flatten them at the response edge.phone_number and sometimes phoneNumber, the agent will look up phone_number from configuration and miss the other. Pick snake_case or camelCase and use it everywhere.
Include every field every time, even when empty. Return "refund_amount": null rather than omitting the field. The agent has conditions like “if refund_amount is greater than 0…”, a missing field is harder to reason about than a null.
Use consistent types. If is_vip is a boolean today, don’t return the string "true" tomorrow. Boolean values stay boolean; numbers stay numbers; dates stay ISO 8601 strings.
Pick stable, low-cardinality enums for status fields. "plan": "Pro" is easier to gate on than "plan": "Pro tier - $99/mo". Keep human-readable labels in a separate field if you need them.
What Fini does with your responses
Once your endpoints are live and Fini’s team has wired them in:- Read endpoints are exposed as Attributes, every field in the GET response becomes a variable the agent can reference anywhere (Reply Behavior conditions, Rulebook checks, message templates).
- Write endpoints are exposed as Actions, Rulebook rules can invoke them mid-conversation, binding their outputs (like
confirmation_idoreffective_date) into the agent’s reply.
Handoff checklist
When your endpoints are ready, send your Fini contact the following:1
Endpoint list
For each endpoint: method, full URL (with any query parameter conventions), and a one-line description of what it does.
2
Sample request and response
A
curl example for each endpoint with a real (sandbox) response body. Fini’s team uses these to configure the mappings on our side.3
API key
Share the API key via a secure channel, see the Authentication section above for delivery guidance.
4
Environments
If you have sandbox / staging / production, list each environment’s base URL and its corresponding API key.
5
Rate limits and SLAs
Tell us your endpoint’s rate limit (requests per minute) and expected p95 latency. Fini’s agent will respect these.

