events/list, events/subscribe and events/unsubscribe. A client subscribes with a callback URL and a signing secret, and StackOne POSTs each event to that URL. ChatGPT supports this mode today. To build your own client and its callback receiver, follow this page. Turning MCP Events on, choosing which events a connection gets and revoking subscriptions are covered in MCP Events in the Gateway tab.
The same mechanism carries two kinds of event:
- Native events come from the provider’s own webhooks and arrive in real time.
- Data Sync events come from Data Sync runs, which are scheduled, as often as every 15 minutes for actions that sync incrementally. They cover systems that send no webhooks.
events/list and subscribed to with events/subscribe, and both deliver the same identifiers-only payload.
Events are offered when all of these hold:
- MCP Events is on for the project.
- The client connects with a session token, such as a token URL, through OAuth, or with a user’s personal API key. A request authenticated with a project API key gets no events.
- The client speaks MCP over HTTP to
https://api.stackone.com/mcporhttps://mcp.stackone.com/mcp.
A backend that can’t act as an MCP Events client, or that calls StackOne with a project API key, receives the same native and Data Sync events through a webhook in your project. See Data Sync events for the Data Sync side.
Discover events
When events are on, theinitialize result advertises them:
events/list returns the events the connection can subscribe to, 50 per page. Pass the nextCursor from one page as cursor to get the next:
{action_id}.added, {action_id}.updated or {action_id}.removed. See What an agent can subscribe to for when each is offered.
account_id is the only argument. It is optional, with a default, when the session token is bound to one Linked Account or the event is available on only one. Otherwise it is required, and the description lists the choices.
Subscribe
events/subscribe takes the event, its arguments, the callback and a lifetime:
Before saving the subscription, StackOne verifies the callback URL. See Answer the verification request.
The result names the subscription and when to renew it:
Renew a subscription
A subscription is identified by the connection, the callback URL, the event name and its arguments, so callingevents/subscribe again with the same four renews it rather than creating a second one. Renew before refreshBefore, or the subscription expires.
A renewal’s result adds deliveryStatus, the subscription’s state before the call:
activeisfalsewhen deliveries had failed for an hour and the subscription was switched off. The renewal switches it back on.lastErroris one ofconnection_refused,timeout,tls_error,http_4xx,http_5xxorchallenge_failed.- A renewal with a different
secretrotates it. Deliveries are signed with both the new and the old secret for 10 minutes.
Unsubscribe
events/unsubscribe takes the same name, arguments and delivery.url as the subscription. It returns an empty result whether or not the subscription existed:
Errors
Build the callback receiver
Every request StackOne sends to the callback URL is a signed JSONPOST with these headers:
StackOne doesn’t follow redirects, and waits 10 seconds for a response (5 seconds for a verification request).
Verify the signature
The signature follows Standard Webhooks: an HMAC-SHA256 over{webhook-id}.{webhook-timestamp}.{raw body}, keyed with the bytes of the secret after whsec_, base64-decoded. Accept the request if any signature in the header matches.
Each attempt, retries included, is signed with the time it was sent. Reject a webhook-timestamp more than a few minutes from your clock, so a captured request can’t be replayed later.
For example:
Answer the verification request
When a client subscribes, StackOne sends the callback URL a verification request before saving the subscription:2xx response within 5 seconds whose JSON body echoes the challenge:
Handle events
Each event is its own request:datacarries identifiers only. Read the record with a tool call, such as the action named inrecord_typeor its_s1querycopy.- For a native event,
changeis the event name andrecord_typeis the connector’s event type. - Return
2xxto acknowledge. A delivery that gets any other response is tried up to 5 times over about 15 minutes. A4xxother than408,425and429isn’t retried, and aRetry-Afteron a429or503is honored within that window. - A delivery can arrive more than once, so deduplicate on
webhook-id. Events aren’t guaranteed to arrive in order.
Handle terminated
When the connection loses access to the event, StackOne sends one final message and deletes the subscription:
Stop renewing a terminated subscription. A renewal is checked like a new subscription, so it fails until access is restored.
Scope events on a session token
A session token minted withscopes receives only the events its permissions allow. Events are granted by a rule whose actions holds events alone, with the accounts named by ID:
eventstakes glob patterns or"*", matched against event names. Adenyrule removes events anallowrule matched.- When the scope has permissions, an account with no events rule gets no events. A token with no scopes gets every event on its accounts.
- An events rule grants no tools. A Data Sync event also needs its action, or the action’s
_s1querycopy, allowed by a tools rule on the same account.
Manage subscriptions from your backend
Your backend can list and revoke the project’s subscriptions with your API key:- List agent event subscriptions returns them newest first, filtered by Linked Account, OAuth client, user or credential.
- Revoke an agent event subscription deletes one by its
sub_ID.
STACKONE_API_KEY set to your API key (v1.eu1.xxxxx):
terminated event, and the agent can subscribe again while it still has access. To stop an agent receiving events for good, remove its access to the account or the event.
Next steps
MCP
Connect to the MCP server and call tools.
Data Sync events
When Data Sync events are produced, and what
removed means.Webhooks
Receive the same events in your backend, without an MCP client.
ChatGPT
Connect ChatGPT, which supports MCP Events, to StackOne.