Webhook events
Every webhook event onefold sends, when it is sent, which applications receive it, and its exact payload and headers.
This is the reference for each webhook event. To set up an endpoint, see Webhooks. To check a delivery's signature, see Verify webhooks.
The shape of a delivery
A delivery is an HTTP POST with a JSON body. The body is the event's own fields, with no
envelope. The event name is in a header, not in the body.
| Header | Value |
|---|---|
Content-Type | application/json |
X-Webhook-Event | The event name |
X-Webhook-Timestamp | Unix time in seconds when the delivery was signed |
X-Webhook-Signature | Hex HMAC-SHA256 signature |
X-Webhook-Delivery | The ID of this delivery. The same across its retries. |
X-Webhook-Event-Id | The ID of the original event. The same across retries and replays. |
Every event about a person names them the same way:
| Field | Value |
|---|---|
sub | The person's ID: the sub claim your application receives |
id | The same value as sub |
application_id | Your application |
organization_id | The organization that owns your application |
Every ID is a string. No event carries a username, an email address or any other account detail: read those from the management API with the scopes the person granted you.
Who receives an event
An event about a person is sent only to applications that person has authorized. Your application never receives an event about a person who has not authorized it, or about what they do in other applications.
An event that ends your application's standing with a person (consent.revoked,
access.blocked, profile.disabled) is sent to the applications that knew the person just
before the change. An event that names fields (profile.updated) names only the fields your
application's scopes can read.
Events
| Event | Sent when |
|---|---|
consent.granted | A person authorizes your application |
consent.revoked | A person's authorization of your application ends |
user.login | A person signs in to your application |
profile.updated | A profile field your scopes can read changes |
access.blocked | A person is blocked from your application or your organization |
access.unblocked | That block is lifted |
profile.disabled | A person's account is taken out of service |
profile.restored | A held account is put back in service |
subject.changed | A person your application knows is now known by another sub |
profile.succeeded | That person's profile continues as a new profile |
profile.merged | That person's profile joined a profile your organization already held |
entitlements.updated | Your application's plan or limits change |
consent.granted
A person approved scopes for your application. This is the event for "a new user arrived".
{
"sub": "7301234567890123456",
"id": "7301234567890123456",
"application_id": "7301234567890000001",
"organization_id": "7301234567890000003",
"scopes": ["identity", "openid"],
"client_id": null
}scopes is everything the person has approved for your application. A person who later
approves more scopes produces another consent.granted with the larger set.
client_id is null when the person authorized your application itself. When they approved
an MCP client signing them in to your own MCP server, it
is that client's metadata document URL, and the approval is separate from their own: ending
one leaves the other.
consent.revoked
A person's authorization of your application ended: they removed your application, you revoked their grant, they reset their password through recovery, they confirmed an email address that was not verified, or their account was disabled.
{
"sub": "7301234567890123456",
"id": "7301234567890123456",
"application_id": "7301234567890000001",
"organization_id": "7301234567890000003",
"client_id": null
}client_id names the MCP client whose approval ended, as on consent.granted, and is null
when the person's own authorization ended. Your tokens for the person no longer work. A move to another email address or a merge of two
accounts does not send this event: the authorization moves with the person, and
subject.changed tells you.
user.login
A person signed in through your application's sign-in page.
{
"sub": "7301234567890123456",
"id": "7301234567890123456",
"application_id": "7301234567890000001",
"organization_id": "7301234567890000003"
}A first sign-in that stops at the consent screen is not sent; consent.granted follows when
the person approves.
profile.updated
A field your scopes can read changed on the person's profile in your organization.
{
"sub": "7301234567890123456",
"id": "7301234567890123456",
"application_id": "7301234567890000001",
"organization_id": "7301234567890000003",
"changed": ["display_name", "username"]
}changed names the fields, not their new values. Read the new values from the
management API.
Name in changed | Sent when your scopes include |
|---|---|
username | identity or profile |
display_name | identity, profile or profile:edit |
given_name, middle_name, family_name, nickname, website, avatar, banner, gender | profile or profile:edit |
date_of_birth | identity or profile:edit |
locale | profile:edit |
fields.<key> | profile or profile:edit, for a shared field your application reads |
private_fields.<key> | profile or profile:edit, for a field of your application's own, such as a sign-up question |
An application whose scopes can read none of the changed fields receives nothing. A field your application's profile settings hide is not reported.
access.blocked
The person was blocked from your application, or from every application of your organization.
{
"sub": "7301234567890123456",
"id": "7301234567890123456",
"application_id": "7301234567890000001",
"organization_id": "7301234567890000003",
"level": "application"
}level is application for a block on your application alone and organization for a block
across the organization. Your tokens for the person are refused while the block stands. A block
on somebody who had not yet authorized your application sends nothing.
A block also ends the provider data the person shared with your application through a
socials:<provider> scope, and lifting the block restores none of it. See
Social login.
access.unblocked
A block was lifted. The body is the same as access.blocked, with the level of the block
that was lifted.
An organization-wide block that is lifted leaves any block on a single application in place.
profile.disabled
The person's account was taken out of service: onefold staff held it, disabled it, or marked its email address as not verified.
{
"sub": "7301234567890123456",
"id": "7301234567890123456",
"application_id": "7301234567890000001",
"organization_id": "7301234567890000003"
}Your tokens for the person are refused from then on. A disabled account also ends every
authorization, so consent.revoked follows. See
Account lifecycle.
profile.restored
onefold staff released a hold on the account, and it is in service again. The body is the
same as profile.disabled. Your tokens for the person work again.
A disabled account that its holder signs in to again does not bring its authorizations back,
so your application hears consent.granted when the person authorizes it again, not this
event.
subject.changed
A person your application knows is now known by another sub: they moved their profile to
another email address, or two of their accounts became one. Sent to each application in your
organization that knew the person, before the event that follows it.
{
"sub": "7301234567890123457",
"id": "7301234567890123457",
"application_id": "7301234567890000001",
"organization_id": "7301234567890000003",
"previous_sub": "7301234567890123456",
"reason": "reassociation",
"survivor_already_known": false
}sub and id are the person's new identifier, and previous_sub the old one. reason is
reassociation for a move to another address and merge for two accounts becoming one.
survivor_already_known is true when the new sub already had a profile in your
organization.
Re-key what you store under previous_sub. Your tokens for it no longer work. See
Account lifecycle.
profile.succeeded
The person's profile in your organization continues as a new profile on their new sub, with
the same details. Follows subject.changed when survivor_already_known is false.
{
"sub": "7301234567890123457",
"id": "7301234567890123457",
"application_id": "7301234567890000001",
"organization_id": "7301234567890000003",
"previous_sub": "7301234567890123456"
}profile.merged
The person's profile joined a profile your organization already held for their new sub.
Follows subject.changed when survivor_already_known is true.
{
"sub": "7301234567890123457",
"id": "7301234567890123457",
"application_id": "7301234567890000001",
"organization_id": "7301234567890000003",
"previous_sub": "7301234567890123456",
"conflicts": ["display_name"]
}conflicts names the profile fields on which the two profiles disagreed:
display_name, gender or date_of_birth. One value was kept; read the profile from the
management API for it.
entitlements.updated
Your application's plan or limits changed. This event is about your application, not about a
person, so it carries no sub. Read the new values from GET /api/v1/manage/entitlements/.
{
"application_id": "7301234567890000001",
"plan": "pro",
"reason": "subscription_changed"
}plan is the identifier of your application's plan. reason is subscription_changed when a
plan change takes effect and subscription_lapsed when a subscription ends. When an
organization's plan changes, each of its applications receives the event.
Test deliveries
The Test button sends a body that is not a real event:
{
"event": "consent.granted",
"test": true,
"application_id": "7301234567890000001",
"endpoint_id": "7301234567890000002"
}Real deliveries have no event key. Read the event name from the X-Webhook-Event header.