Skip to content
ContentsWebhooks

Webhooks

When a website asks one of your identities to verify, Joinpane can tell your own tools or a team chat as well as your phone. And an agent can have its events posted to its own server. This is what we send for each, and how to check it came from us.

Add a webhook

A webhook is yours, like your phone: it hears about the identities you're the phone owner for. In Joinpane, open Settings, then Your account, and under Sign-in codes choose Add URL.

  • A public https address. Joinpane doesn't send to private networks.
  • A signing secret, shown once. Your tool uses it to check each request. Changing the URL makes a new one.
  • At the same moment as the app's notification, once, with 5 seconds to answer. A code doesn't wait, so we don't retry. Your account shows how the last delivery went.
  • Never the code itself, nor a cookie, a password or an IP address. The code reaches the website only when a person types it.

What arrives

A POST with a JSON body. Any 2xx answer counts as delivered; we don't follow redirects.

Event types

Check it came from Joinpane

Joinpane-Signature holds when it was sent (t, in Unix seconds) and an HMAC-SHA256 of t, a full stop and the body, keyed with your signing secret (v1, in hex). Work it out from the body exactly as it arrived, before any JSON parsing, and compare in constant time.

Node.js

Python

Chat channels

Every delivery carries the whole message as one line in text, and again in content. So a channel's incoming webhook URL from Slack, Google Chat or Discord works as it is: paste it into Add URL and the channel shows the line, with the link to answer it. A chat channel ignores the signature.

Anyone in the channel sees which identity needs a code. Only people who can answer it in Joinpane can type one: the identity's phone owners and the people who can drive it.

More on phone owners and when we reach each of them is on the .

Agent events

An agent can have its events posted to its own server as they happen: a job is due, a person answered its question, someone took over its window. It's the same news the agent can pull or wait for over MCP (see ); a webhook saves it from asking.

Each agent has one. Admins set it on the agent's page: in Agents, open the agent, then Keys and events, and under Send events to a URL choose Add a URL. The app calls it the agent's event URL (webhook).

  • An https address on the public internet, on port 443 or 8443. No user name or password in it, no private network or local name, and not a Joinpane address. We don't follow redirects.
  • The events you choose. All of them by default, new kinds included, or only the ones you tick.
  • A signing secret, shown once, so your server can check each event came from Joinpane.
  • Tried again for a day when a delivery doesn't get through, and turned off after 3 days of nothing getting through.
  • Never a cookie, a password or a sign-in code. Events carry ids, names and reasons. job.due carries the job's instructions, which is why the address must be https.

Only admins see the webhook, its secret's start and its deliveries.

The signing secret

When you add the address, Joinpane shows its signing secret once: jp_whsec_ and 32 letters and numbers. Put it in your server's settings. After that the agent's page shows only its start, like jp_whsec_9f3K…, to tell secrets apart.

  • New secret makes another, shown once too. For 24 hours the old one keeps signing beside it, so each event carries two v1= values, the new secret's first. Switch your server over within the day; after that only the new one signs.
  • Accept a request when any v1 matches, so nothing is refused while you switch. The code in does.
  • Removing the address stops the posts, and its secret stops working. The events are still there to pull for 7 days.

What an agent's webhook gets

A POST with the event as its JSON body: the same JSON the agent would pull. Any 2xx answer within 10 seconds counts as delivered, and we don't read what you send back.

job.due: Mei's job for Uploader, due at 20:00 Tokyo time.

Agent event types

Pulled, waited for over MCP or posted to a webhook, an agent gets these. Events about someone's personal identity lent to the agent never go to a webhook: only keys the identity's owner made can pull them.

job.due
A job's run is due. Claim it before claimBy. See .Data: job (id, title), run (id, dueAt, claimBy, how: schedule or run_now), identity (id, name, access: drive or read), title, instructions, claimBy.
question.answered
A person answered a question the agent asked, or changed an answer they gave. A change withdraws the open question that relied on it: put things right, then ask again.Data: question (id, text), answer, answeredBy (name), identity (id, name) or null; on a change, changed (from, withdrew: the question's id and text).
window.taken_over
A person took over the agent's window. Its steps there answer 409 until they hand over.Data: window (id), identity (id, name), by (name).
window.handed_back
The person handed over, so the agent can carry on in its window.Data: window, identity (id, name), by (name).
window.closed
The agent's window closed.Data: window, identity (id, name), and reason: idle, closed_by_person, access_removed, lend_ended, used_alone, usage_stopped, identity_paused, identity_deleted, signed_out, workspace_suspended or failed.
identity.signed_out
An identity the agent can use was signed out. A person needs to sign in again.Data: identity (id, name, website).
identity.signed_in
It's signed in again.Data: identity (id, name, website).
identity.access_changed
What the agent may do in an identity changed: an admin changed its access, or a personal identity was lent to it, the lend was extended, or it ended.Data: identity (id, name), change: granted, raised, lowered, removed, lent, lend_extended or lend_ended; access now: drive, read or none; until, a lend's end while one runs.
download.saved
A website gave a file in the agent's window, and it was saved to Drive.Data: file (id, name, size in bytes), identity (id, name), window or null, by (kind: agent or user, name): who was driving.
agent.paused
The agent was paused, by a person or at its monthly budget of browser hours.Data: reason: person or budget; by (name) or null; budgetHours when it's the budget.
agent.resumed
The agent was resumed.Data: reason: person, budget_raised, budget_removed, new_month or under_budget; by (name) or null.
test
Send a test, on the agent's page. It's sent whatever events the webhook takes, even while it's off, and pulling gets it too.Data: Nothing: data is {}.
events.coalesced
Past 10,000 events in an hour, the rest of that hour's aren't kept one by one: this one says how many there were, and counts on while the hour lasts. Pulled only. A webhook's own summary is in Bursts, below.Data: count, since (when the hour began), kept: false.

Retries, turning off and bursts

  • Tried at once, then again after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 12 hours: 7 tries over about a day. Anything but a 2xx within 10 seconds is a failed try, a redirect included. Each try is signed afresh, so t is the time of that try.
  • At least once, out of order sometimes. An event can arrive twice, and a retried one can land after newer ones. Drop an id you've seen, and order by cursor; pulling after the last cursor you handled reads them in order.
  • Turned off after 3 days. When every delivery fails for 3 days, we turn the webhook off, stop trying the deliveries still waiting, and tell the workspace's admins and whoever made the agent, in the Inbox and by email. Fix the server, send a test, then turn it back on.
  • Back on, it starts from now. Nothing from while it was off is posted. Redeliver from the log, or pull: every event is kept for 7 days.
  • Bursts. Past 1,000 events in an hour, the webhook gets one events.coalesced summary at the end of the hour instead of each. data.count says how many, and data.after is the cursor to pull them from (data.kept is true). Up to 10,000 an hour are kept for pulling; past that, pulling gets one events.coalesced with kept: false instead.
Pull the 37 events it stands for with GET /v1/events?after=52040.

Deliveries and Redeliver

Under Deliveries, the agent's page lists the last 100, newest first: the event type, when, how it went (a status code, or why there was none, like “No answer in 10 seconds.”) and the tries. A row opens to its last tries, with how long each took. Events about identities you can't open aren't listed.

  • Redeliver sends a failed delivery once more, now, signed afresh. It works while the event is kept, 7 days.
  • Send a test posts a test event at once and shows the answer, even while the webhook is off.

Check an agent event

The signature works as for sign-in webhooks: t in Unix seconds, and v1, an HMAC-SHA256 of t, a full stop and the body, keyed with the signing secret, in hex. The difference: for 24 hours after a new secret there are two v1 values, so accept the request when any of them matches. Work it out from the body exactly as it arrived, and compare in constant time. This code checks sign-in webhooks too.

Node.js

Python

Then drop an event whose id you've had already, and answer with a 2xx within 10 seconds: start slow work after answering. For job.due, what counts is claiming the run within 15 minutes.