This page is for customer engineers building the APIs that Fini will call to read your data or take actions in your systems. Read this once before you start wiring endpoints, it covers the contract Fini expects, the auth pattern, and the request/response shapes that make your APIs easy to integrate. You build the endpoints. Fini’s team handles everything on the Fini side, naming them, mapping the response fields into agent-readable variables, and stitching them into Attributes (for reads) and Actions (for writes). You don’t need to know about Fini’s internal configuration. You just need to expose endpoints that match the contract below.Documentation Index
Fetch the complete documentation index at: https://docs.usefini.com/llms.txt
Use this file to discover all available pages before exploring further.
What you need to build
For most integrations you’ll expose two kinds of endpoints:| Endpoint type | Method | When Fini calls it | Example |
|---|---|---|---|
| Read | GET | When the agent needs context about a user mid-conversation | Look up a customer’s plan, account state, or recent orders |
| Write / action | POST or PUT | When the agent needs to perform an operation in your system | Cancel a subscription, update an address, escalate a ticket |
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
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.
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:
Your system’s primary identifier for this customer. Useful for downstream Actions that need to write back.
The customer’s current plan or tier. Low-cardinality enum recommended (e.g.,
Free, Pro, Enterprise).Whether this customer qualifies for VIP treatment. The agent can gate behavior on this in Reply Rules and Rulebook.
Whether the account is currently closed or suspended. Critical for the agent to know before attempting any writes.
E.164-formatted phone number, or any consistent format your system uses.
Postal code or ZIP. String, not number, leading zeros matter.
ISO 8601 year-month, e.g.,
2024-03. Useful for tenure-based logic.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:
| Status | When |
|---|---|
200 OK | Lookup succeeded, body contains the requested fields. |
400 Bad Request | Required parameter missing or malformed. |
401 Unauthorized | Missing or invalid x-api-key. |
404 Not Found | The customer exists in the request but not in your system. |
500 Internal Server Error | Anything else. Fini’s agent will catch this and fall back gracefully. |
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
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:
Whether the operation completed successfully. Fini branches deterministically on this, the agent composes one reply path when
true, another when false.Human-readable description of what happened. The agent can pass this through to the customer directly, or use it to compose a richer reply.
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:Endpoint list
For each endpoint: method, full URL (with any query parameter conventions), and a one-line description of what it does.
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.API key
Share the API key via a secure channel, see the Authentication section above for delivery guidance.
Environments
If you have sandbox / staging / production, list each environment’s base URL and its corresponding API key.

