Integrations
Your product
Tell the agent who it's talking to, and let your team and the agent act for the customer, through endpoints on your servers. The lookup endpoint answers with a customer's account, by their email address. The actions endpoint, if you add one, takes the actions the lookup lists. The agent looks up a customer only when their address is verified: by their mail server, by a code the contact widget emailed them, or by a signature from your own site. Your team also sees the account beside each ticket. Connect it under Integrations → Customer accounts → Your product, as an admin.
Both endpoints must be https on a public address. answerable doesn't follow redirects: answer at the configured address.
You decide what the agent sees. Return only what helps with support, and leave out anything you wouldn't want an agent to repeat to the customer. The answer has a fixed format: fields answerable understands, which it uses in the ticket's customer panel, its links, and billing, and a list of details for anything specific to your product. Every request and answer is also defined as JSON Schema, for your tests and your coding agent.
Request
POST <lookup endpoint>
Content-Type: application/json
Accept: application/json
User-Agent: answerable/1.0
webhook-id: msg_2b6f0c1e-…
webhook-timestamp: 1767225600
webhook-signature: v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2pj9o9NDN/H/pI4=
{"type":"account.lookup","email":"pat@example.com"}The body is type, always account.lookup, and the customer's email, lowercased.
Verifying the request
answerable signs every request with the secret shown on the Your product card (whsec_…), following Standard Webhooks, the same scheme as answerable's webhooks. Reject any request that doesn't verify, because the endpoint returns customer data.
- Take the secret after
whsec_and base64-decode it: that's the key. - Compute HMAC-SHA256 over
"<webhook-id>.<webhook-timestamp>.<raw request body>"with the key, and base64-encode it. - Compare it, in constant time, with the part after
v1,inwebhook-signature. - Reject timestamps more than 5 minutes from now.
Answer 401 to anything that doesn't verify, and when the secret isn't set at all: never check a signature against an empty secret.
In the common frameworks, an endpoint that checks the signature and answers with the account (findUserByEmail and accountForSupport stand for your own code):
// app/api/answerable/account/route.ts
import { createHmac, timingSafeEqual } from "node:crypto";
export async function POST(request: Request) {
const body = await request.text(); // the raw body, before parsing
const secret = process.env.ANSWERABLE_ACCOUNT_SECRET;
if (!secret || !verify(secret, request.headers, body)) {
return new Response("Invalid signature", { status: 401 });
}
const { email } = JSON.parse(body);
const user = await findUserByEmail(email); // case-insensitively
if (!user) return Response.json({ found: false });
return Response.json(accountForSupport(user)); // in the account format below
}
function verify(secret: string, headers: Headers, body: string) {
const id = headers.get("webhook-id");
const timestamp = headers.get("webhook-timestamp");
if (!id || !timestamp || Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false;
const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64");
const expected = Buffer.from(createHmac("sha256", key).update(`${id}.${timestamp}.${body}`).digest("base64"));
return (headers.get("webhook-signature") ?? "").split(" ").some((part) => {
const given = Buffer.from(part.replace(/^v1,/, ""));
return given.length === expected.length && timingSafeEqual(given, expected);
});
}Standard Webhooks also has libraries for most languages that check the signature for you (standardwebhooks.com). Actions are posted to your actions endpoint, signed the same way (see Actions below).
Response
200with the account as a JSON object in the format below.200with{ "found": false }when there's no account for the address.401when the signature doesn't verify. answerable tells the admin to check the secret.
Keep the response under 32 KB and answer within 5 seconds. Nothing from the response is stored in answerable; each lookup is recorded only as "found" or "not found" in the investigation's activity.
The account format
Every field is optional: send what you have. answerable ignores other top-level fields, and leaves out a value that doesn't fit its field rather than failing the lookup. Looking up an address on the Your product card, under Integrations → Customer accounts, lists both, and shows the account the way your team and the agent will see it. Times are ISO 8601 strings.
idstringnumberAgent sees it- The customer's ID in your product
namestringAgent sees it- Their name
avatar_urlhttps URL- Their picture, shown to your team
profile_urlhttps URLAgent sees it- Their public profile; the agent may share it
admin_urlhttps URL- Their page in your admin, for your team
planstringAgent sees it- Their plan's name, as customers see it
paidbooleanAgent sees ittruewhen they have a paid plancreated_atISO 8601Agent sees it- When they signed up
last_active_atISO 8601Agent sees it- When they were last active
stripe_customer_idcus_…- Their Stripe customer. Include it only when this person may see that customer's billing in your product
organizationobject- Their team or company (below)
Agent sees it: Yes, except its
admin_url linksarray- Up to 5 more buttons for your team (below)
detailsarrayAgent sees it- Anything else about the account, up to 30 (below)
statusstringAgent sees itactive,suspended, orclosedprioritystringAgent sees it"high"for customers who need extra care
organization
{ id, name, role, profile_url, admin_url }: the team or company the customer belongs to, their role in it (such as owner or member), its public page, and its page in your admin (for your team only). Other keys are ignored; put more about the organization in details with a "group".
links
Buttons beside the ticket for your team, never shown to the agent: [{ "label": "Projects in admin", "url": "https://…" }], https only. answerable already links admin_url, profile_url, the organization's admin_url, and the Stripe customer.
details
An ordered list; your team sees details in this order, under their groups, and the agent reads each as a line (Projects: 4 of 5 (Free accounts can have up to 5 projects.)).
labelRequired- Shown to your team and the agent. Up to 60 characters
valueRequired- Text (up to 500 characters), a number,
true/false, or an ISO 8601 date maxOptional- A number that makes the value a usage: "4 of 5" with a bar, highlighted at the limit. Leave it out when there's no limit
unitOptional- For example
"MB" groupOptional- A heading, such as
Account,Billing, orUsage descriptionOptional- A sentence telling the agent what the value means or why it matters. Up to 300 characters
Details are flat: no nested objects or lists. A detail whose label looks like a credential (password, token, api key…) is dropped as a safety net; don't rely on that, just don't send them.
Example
{
"id": "42",
"name": "Pat Lee",
"avatar_url": "https://example.com/avatars/42.jpg",
"profile_url": "https://example.com/patlee",
"admin_url": "https://example.com/admin/users/42",
"plan": "Pro",
"paid": true,
"created_at": "2023-04-02T10:15:00Z",
"last_active_at": "2026-10-10T08:42:00Z",
"stripe_customer_id": "cus_Q1w2e3r4",
"organization": { "id": "7", "name": "Acme", "role": "owner", "admin_url": "https://example.com/admin/teams/7" },
"details": [
{ "label": "Signs in with", "value": "Google", "group": "Account" },
{ "label": "Billing", "value": "Yearly", "group": "Billing" },
{ "label": "Renews", "value": "2027-03-02", "group": "Billing" },
{ "label": "Projects", "value": 4, "max": 5, "group": "Usage", "description": "Free accounts can have up to 5 projects." },
{ "label": "Storage", "value": 1240, "max": 5000, "unit": "MB", "group": "Usage" }
]
}Actions
The lookup can also list what can be done for the customer, such as resetting their credits or refunding an order, and a second endpoint on your server, the actions endpoint, does them when asked. Each action has one setting under Integrations → Actions: Off (where every action starts, new ones included), Team only (your team takes it from a ticket, with Take an action… in its menu, or ⇧A), Needs approval (answerable's agent proposes it too, for someone on your team to approve), or On its own. Each can also say when to use it, a note the agent only proposes it within, and your team sees when taking it from a ticket. Add the actions endpoint's address beside the lookup's, under Integrations → Customer accounts → Your product (Edit): every action is taken there, signed with the same secret. Until it's added, the actions your lookup lists show, but can't be taken.
Listing a customer's actions
Add actions to the account you return, with the choices this customer's account gives, such as their own orders:
{
"id": "42",
"name": "Pat Lee",
"actions": [
{
"id": "reset_credits",
"name": "Reset AI credits",
"description": "Sets the account's AI credits back to its plan's monthly amount."
},
{
"id": "refund_order",
"name": "Refund an order",
"kind": "money",
"inputs": [
{
"name": "order",
"label": "Order",
"type": "choice",
"required": true,
"options": [{ "value": "ord_19", "label": "Order #19", "detail": "3 Nov, Pro yearly", "amount": { "amount": 4900, "currency": "usd" } }]
},
{ "name": "amount", "label": "Amount", "type": "money", "of": "order" }
]
}
]
}Up to 20 actions, each with:
idRequired- Your name for it, such as
reset_credits: letters, numbers,_,.or-, up to 64 nameRequired- What it does, as a short instruction: "Reset AI credits". Up to 80 characters
descriptionOptional- A sentence or two for your team and the agent on what it does and when. Up to 500 characters
kindOptionalchange(the default),moneyfor one that moves money, ordestructivefor one that can't be undone. The team sees which, and the agent can't take a money action on its own above the limit the team setsunavailableOptional- Why it can't be done for this customer now, such as "No order can be refunded." Your team and the agent see the reason instead of the action's inputs
inputsOptional- Up to 10 things it needs (below)
Each input:
nameRequired- Letters, numbers, and
_, up to 40, unique in the action typeRequiredtext,number,boolean,choice, ormoneylabelOptional- Shown to your team. The
nameotherwise requiredOptionaltruewhen it can't be left outdescriptionOptional- What to put in it
optionsFor a choice- Up to 50, each with
value,label, an optionaldetail, and anamount({ "amount": 4900, "currency": "usd" }, in the currency's smallest unit) when money can be taken from it. Only these values are accepted ofFor money- The choice it's taken from, listed before it, whose options each have an
amount. The amount is in the smallest unit, such as cents, and never more than the chosen option's. Left out, it's all of it min, maxOptional- For a number
max_lengthOptional- For text: the most characters, up to 2,000
An action that doesn't read is left out, and looking up an address on the Your product card says why. A money action needs a money input, so its amount is always checked.
What an action is stays the same for every customer: its name, description, kind, and inputs, apart from their options. Only unavailable and the options change from one customer to the next. answerable keeps what each action is from each lookup, such as a ticket's account panel or Look up on the Your product card, and from every action, so it shows under Integrations → Actions, off, before anyone needs it. When what it is changes, answerable takes the change at once, keeping the action's setting, since it comes from your own servers; approving a proposal made before the change fails rather than running something other than what was proposed. A change to its kind while it's on is different: who may take an action depends on it, so the agent goes on using it as it was until someone reviews the change under Integrations → Actions.
Listing every action
answerable also asks the lookup endpoint for every action, without a customer, so they show under Integrations → Actions before anyone is looked up: when the lookup's address or the actions endpoint's is saved, and when an admin chooses Refresh actions in its ⋯ menu. The request is signed like a lookup:
POST <lookup endpoint>
Content-Type: application/json
webhook-id: msg_7d1a9e40-…
webhook-timestamp: 1767225600
webhook-signature: v1,Pq0iV7rT3o9E2h4mJxW1yLk8Zc5bN6uA0sD3fG7hJ2k=
{"type":"actions.list"}Answer 200 with all of them, as a lookup lists them but for no one customer: a choice's options can be empty, and unavailable is ignored.
{
"actions": [
{ "id": "reset_credits", "name": "Reset AI credits", "description": "Sets the account's AI credits back to its plan's monthly amount." },
{
"id": "refund_order",
"name": "Refund an order",
"kind": "money",
"inputs": [
{ "name": "order", "label": "Order", "type": "choice", "required": true, "options": [] },
{ "name": "amount", "label": "Amount", "type": "money", "of": "order" }
]
}
]
}An action you no longer list stays under Integrations → Actions, with its setting, but can't be taken until a lookup lists it again. A lookup that answers this request as it answers any other, such as with { "found": false }, keeps working: its actions show once someone is looked up.
Taking an action
To take one, answerable posts to the actions endpoint, signed the same way as the lookup, with the action's id in run.action:
POST <actions endpoint>
Content-Type: application/json
webhook-id: run_0193f7c2-…
webhook-timestamp: 1767225600
webhook-signature: v1,…
{
"type": "action.run",
"email": "pat@example.com",
"account": { "id": "42" },
"run": {
"action": "refund_order",
"inputs": { "order": "ord_19", "amount": 2000 },
"mode": "approved",
"actor": { "type": "agent", "name": "Ava" },
"approved_by": { "type": "person", "name": "Sam Rivera", "email": "sam@example.com" },
"reason": "Charged twice on 3 Nov; the customer asked for the second charge back.",
"ticket": { "number": 482, "url": "https://answerable.co/acme/inbox?view=all&ticket=482" }
}
}type- Always
action.run email- The customer's address, lowercased
account{ "id" }: the account your lookup returned when the action was proposed, ornullwhen it returned noid. If the email leads to another account by the time it runs, answerable doesn't send the request at all. Check it toorun.action- The action's
id run.inputs- Its inputs, by name, checked against what you listed
run.modeteamwhen a person took it from a ticket,approvedwhen the agent proposed it and a person approved it,agentwhen the agent took it on its ownrun.actor- Who took it, or proposed it:
{ "type": "person", "name", "email" }, withviawhen they worked through an app or API key ("Claude Code"), or{ "type": "agent", "name" } run.approved_by- The person who approved it, for
approved.nullotherwise run.reason- Why the agent proposed it, in its words, for your records, or
nullwhen a person took it. It isn't one of the action's inputs: list an input of your own when the action itself needs one run.ticket{ "number", "url" }: the ticket in answerable, for your own records
Handle each request in this order, so no action can skip a check:
- Verify the signature, as you do for the lookup, and answer
401to anything that doesn't. - Do it once per
webhook-id. Keep the ids you've handled in a table with a unique index, with the answer you gave, for at least 30 days, and answer a repeat with that answer instead of doing it again. The id stays the same whenever answerable asks for the same run again, such as after a timeout, and when someone tries again after a failure that may have gone through. - Check that
account.idis the account the email leads to. If it isn't, answer422with a Problem rather than act on another account. - Find
run.actionin your own list of actions, such as a map from eachidto the code that does it, and answer anidthat isn't there with422and a Problem. Never build a class, function or path name from it. - Check that it's allowed for the account now, and for
run.mode, as you would for a request from your own app: that the order is this customer's, that the amount isn't more than what's left of it, and, if you like, that an action you'd rather not leave to the agent wasn't taken on its own (agent). answerable checks the inputs against what you listed, but your endpoint has the last word. Answer anything it doesn't allow with422and a Problem saying why. - Do it, and answer within 15 seconds, as below.
Refuse with 422 and a Problem, whatever the reason. Keep 401 for a signature that doesn't verify, and don't refuse with 403, 404 or 409: answerable reads 401 and 403 as the secret, 404 as a wrong address, and 409 as still handling the same webhook-id.
What you answer decides what happens:
| Answer | What answerable does |
|---|---|
200 with { "ok": true }, and if you like a message saying what happened ("Refunded $20.00 of order #19.") and a url to what changed, in your admin say | Done. Your team sees the message and the link in the ticket's history. The agent reads the history on the customer's later messages and may repeat the message, so write it for the customer to read too |
Your first answer again, for a webhook-id you've handled | Done, as above |
422, or another 4xx not below, with Problem Details (below) | Failed. The detail, or the title, is shown on the ticket, so put it in words your team can act on. Trying again sends a new webhook-id |
401 or 403 | Failed: answerable tells the admin to check the secret |
404 | Failed: answerable tells the admin to check the actions endpoint's address |
409 while you're still handling the same webhook-id | It may have gone through. Trying again sends the same webhook-id |
5xx, a timeout, or no answer | It may have gone through. Trying again sends the same webhook-id |
200 without "ok": true | Failed, so an endpoint that answers every request as a lookup can't look as if it ran something |
Done:
{ "ok": true, "message": "Refunded $20.00 of order #19.", "url": "https://example.com/admin/orders/19" }A failure, as Problem Details:
HTTP/1.1 422 Unprocessable Content
Content-Type: application/problem+json
{ "title": "Credits can't be reset", "detail": "Credits can't be reset while an import is running. Try again once it's finished." }A reply that goes with an action waits until the action went through. When one fails, or may have gone through, your team sees why, and chooses to try again or send the reply without it.
What the agent may do
- It only sees actions for a customer whose address is verified, and that are set to Needs approval or On its own, with their when to use it.
- An action that needs approval waits on the ticket until someone on the team approves or declines it. Approving a reply the agent proposed with actions runs them before the reply goes out.
- An action set to run on its own does so before the reply that says it's done is sent, money actions only up to their limit. The agent takes at most 3 actions a day for one customer on its own; more wait for approval.
- While the workspace is in test mode, and on sample tickets, its replies aren't emailed to customers, so the actions that go with them wait for approval too.
Schema
Every request answerable sends and every answer it reads is defined in one JSON Schema file, account-lookup.json, each under $defs: LookupRequest and LookupAnswer (an Account, with its Actions, or NotFound) for the lookup, ActionsListRequest and ActionsList for every action, and ActionRequest, ActionDone and Problem for taking one. answerable reads answers with the same definitions, so your tests, or your coding agent, can check yours against it. A few rules are only on this page, because a schema can't say them: a money input is taken from a choice listed before it, ids and input names are used once, and a detail that looks like a credential is dropped.
Checklist
- A
POSTendpoint that verifies the Standard Webhooks signature, and answers anything else with401 - Looks up the user by the
emailin the body, case-insensitively - Answers in the account format: the fields above, and
detailsfor the rest -
stripe_customer_idonly for people who may see that customer's billing -
{ "found": false }for unknown addresses - The secret kept in your server's environment, never in code or the browser
- For actions: an actions endpoint, added beside the lookup's address, and each action listed the same for every customer
-
{"type":"actions.list"}answered with every action, so they show before anyone is looked up - Each action request verified, done once per
webhook-id(kept in a table with its answer), checked against the account as it is (account.idincluded), andrun.actionfound in your own list, allowed for the account andrun.mode - Answered with
{ "ok": true }only once it's done, and failures as Problem Details
For agents: this page as Markdown, and every page in llms.txt.