pub enum WebhookPayload {
Show 21 variants
Variant0 {
connection_id: Uuid,
connection_type: String,
created_at: DateTime<Utc>,
environment: String,
key: String,
name: Option<String>,
organization_id: Option<Uuid>,
platform: String,
project_id: Option<Uuid>,
state: String,
type_: WebhookPayloadVariant0Type,
},
Variant1 {
authorized_at: DateTime<Utc>,
connection_id: Uuid,
key: String,
platform: String,
type_: WebhookPayloadVariant1Type,
user_id: Uuid,
},
Variant2 {
connection_id: Uuid,
key: String,
name: Option<String>,
organization_id: Option<Uuid>,
platform: String,
project_id: Option<Uuid>,
tags: Vec<String>,
type_: WebhookPayloadVariant2Type,
updated_at: DateTime<Utc>,
},
Variant3 {
connection_id: Uuid,
deleted_at: DateTime<Utc>,
key: Option<String>,
name: Option<String>,
organization_id: Option<Uuid>,
platform: String,
project_id: Option<Uuid>,
type_: WebhookPayloadVariant3Type,
},
Variant4 {
connection_type: String,
created_at: DateTime<Utc>,
environment: String,
event_access_id: String,
name: Option<String>,
organization_id: Option<Uuid>,
project_id: Option<Uuid>,
type_: WebhookPayloadVariant4Type,
},
Variant5 {
connection_type: String,
environment: String,
event_access_id: String,
name: Option<String>,
organization_id: Option<Uuid>,
project_id: Option<Uuid>,
revoked_at: DateTime<Utc>,
type_: WebhookPayloadVariant5Type,
},
Variant6 {
created_at: DateTime<Utc>,
id: Uuid,
name: String,
organization_id: Uuid,
type_: WebhookPayloadVariant6Type,
},
Variant7 {
id: Uuid,
name: String,
organization_id: Uuid,
type_: WebhookPayloadVariant7Type,
updated_at: DateTime<Utc>,
},
Variant8 {
deleted_at: DateTime<Utc>,
id: Uuid,
name: String,
organization_id: Uuid,
type_: WebhookPayloadVariant8Type,
},
Variant9 {
created_at: DateTime<Utc>,
id: Uuid,
name: String,
type_: WebhookPayloadVariant9Type,
},
Variant10 {
id: Uuid,
name: String,
type_: WebhookPayloadVariant10Type,
updated_at: DateTime<Utc>,
},
Variant11 {
deleted_at: DateTime<Utc>,
id: Uuid,
name: String,
type_: WebhookPayloadVariant11Type,
},
Variant12 {
connection_id: Uuid,
key: Option<String>,
platform: String,
refreshed_at: DateTime<Utc>,
type_: WebhookPayloadVariant12Type,
},
Variant13 {
connection_id: Option<Uuid>,
error: String,
failed_at: DateTime<Utc>,
key: Option<String>,
platform: String,
type_: WebhookPayloadVariant13Type,
},
Variant14 {
connection_id: Uuid,
duration_ms: i64,
error: Option<String>,
key: Option<String>,
method: String,
path: String,
platform: String,
status_code: Option<i32>,
timestamp: DateTime<Utc>,
type_: WebhookPayloadVariant14Type,
},
Variant15 {
added_at: DateTime<Utc>,
email: String,
organization_id: Option<Uuid>,
organization_name: Option<String>,
project_id: Option<Uuid>,
project_name: Option<String>,
type_: WebhookPayloadVariant15Type,
user_id: Uuid,
},
Variant16 {
email: String,
organization_id: Option<Uuid>,
organization_name: Option<String>,
project_id: Option<Uuid>,
project_name: Option<String>,
removed_at: DateTime<Utc>,
type_: WebhookPayloadVariant16Type,
user_id: Uuid,
},
Variant17 {
email: String,
new_role: String,
old_role: String,
organization_id: Option<Uuid>,
organization_name: Option<String>,
project_id: Option<Uuid>,
project_name: Option<String>,
type_: WebhookPayloadVariant17Type,
updated_at: DateTime<Utc>,
user_id: Uuid,
},
Variant18 {
client_id: String,
connect_user_id: String,
consent_surface: WebhookPayloadVariant18ConsentSurface,
created_at: DateTime<Utc>,
environment: WebhookPayloadVariant18Environment,
grant_id: String,
type_: WebhookPayloadVariant18Type,
version: i64,
},
Variant19 {
client_id: String,
connect_user_id: String,
environment: WebhookPayloadVariant19Environment,
grant_id: String,
source: WebhookPayloadVariant19Source,
type_: WebhookPayloadVariant19Type,
updated_at: DateTime<Utc>,
version: i64,
},
Variant20 {
client_id: String,
connect_user_id: String,
environment: WebhookPayloadVariant20Environment,
grant_id: String,
reason: Option<String>,
revoked_at: DateTime<Utc>,
revoked_by: WebhookPayloadVariant20RevokedBy,
type_: WebhookPayloadVariant20Type,
version: i64,
},
}Expand description
Every webhook event and the payload its deliveries carry.
The single declaration of the catalog: WebhookEventType is derived from
it, so an event cannot exist without a payload and the two cannot drift.
Never serialized: a delivery puts the bare payload under payload with the
discriminant in the sibling event field. The serde tag exists so utoipa
derives a oneOf with a discriminator whose mapping pairs every event
with its payload schema - that mapping is what the SDK generators read, and
it comes from this declaration rather than being restated anywhere.
JSON schema
{
"description": "Every webhook event and the payload its deliveries carry.\n\nThe single declaration of the catalog: [`WebhookEventType`] is derived from\nit, so an event cannot exist without a payload and the two cannot drift.\n\nNever serialized: a delivery puts the bare payload under `payload` with the\ndiscriminant in the sibling `event` field. The serde tag exists so utoipa\nderives a `oneOf` with a `discriminator` whose `mapping` pairs every event\nwith its payload schema - that mapping is what the SDK generators read, and\nit comes from this declaration rather than being restated anywhere.",
"oneOf": [
{
"description": "Emitted when a new non-OAuth connection is created",
"allOf": [
{
"$ref": "#/components/schemas/ConnectionCreatedPayload"
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"connection.created"
]
}
}
}
]
},
{
"description": "Emitted when an OAuth connection is created",
"allOf": [
{
"$ref": "#/components/schemas/ConnectionOAuthCreatedPayload"
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"connection.oauth.created"
]
}
}
}
]
},
{
"description": "Emitted when a connection's own fields change",
"allOf": [
{
"$ref": "#/components/schemas/ConnectionUpdatedPayload"
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"connection.updated"
]
}
}
}
]
},
{
"description": "Emitted when a connection is deleted",
"allOf": [
{
"$ref": "#/components/schemas/ConnectionDeletedPayload"
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"connection.deleted"
]
}
}
}
]
},
{
"description": "Emitted when an API key is created",
"allOf": [
{
"$ref": "#/components/schemas/ApiKeyCreatedPayload"
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"api_key.created"
]
}
}
}
]
},
{
"description": "Emitted when an API key is revoked",
"allOf": [
{
"$ref": "#/components/schemas/ApiKeyRevokedPayload"
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"api_key.revoked"
]
}
}
}
]
},
{
"description": "Emitted when a project is created",
"allOf": [
{
"$ref": "#/components/schemas/ProjectCreatedPayload"
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"project.created"
]
}
}
}
]
},
{
"description": "Emitted when a project is updated",
"allOf": [
{
"$ref": "#/components/schemas/ProjectUpdatedPayload"
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"project.updated"
]
}
}
}
]
},
{
"description": "Emitted when a project is deleted",
"allOf": [
{
"$ref": "#/components/schemas/ProjectDeletedPayload"
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"project.deleted"
]
}
}
}
]
},
{
"description": "Emitted when an organization is created",
"allOf": [
{
"$ref": "#/components/schemas/OrganizationCreatedPayload"
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"organization.created"
]
}
}
}
]
},
{
"description": "Emitted when an organization is updated",
"allOf": [
{
"$ref": "#/components/schemas/OrganizationUpdatedPayload"
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"organization.updated"
]
}
}
}
]
},
{
"description": "Emitted when an organization is deleted",
"allOf": [
{
"$ref": "#/components/schemas/OrganizationDeletedPayload"
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"organization.deleted"
]
}
}
}
]
},
{
"description": "Emitted when OAuth token is refreshed",
"allOf": [
{
"$ref": "#/components/schemas/OAuthRefreshedPayload"
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"oauth.refreshed"
]
}
}
}
]
},
{
"description": "Emitted when OAuth authorization fails",
"allOf": [
{
"$ref": "#/components/schemas/OAuthFailedPayload"
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"oauth.failed"
]
}
}
}
]
},
{
"description": "Emitted when a passthrough request is executed",
"allOf": [
{
"$ref": "#/components/schemas/PassthroughExecutedPayload"
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"passthrough.executed"
]
}
}
}
]
},
{
"description": "Emitted when a member is added to an organization or project",
"allOf": [
{
"$ref": "#/components/schemas/MemberAddedPayload"
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"member.added"
]
}
}
}
]
},
{
"description": "Emitted when a member is removed from an organization or project",
"allOf": [
{
"$ref": "#/components/schemas/MemberRemovedPayload"
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"member.removed"
]
}
}
}
]
},
{
"description": "Emitted when a member's role is updated",
"allOf": [
{
"$ref": "#/components/schemas/MemberRoleUpdatedPayload"
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"member.role_updated"
]
}
}
}
]
},
{
"description": "Emitted when a consent creates a grant: a user's first for an\napplication, or any after they revoked it.\n\nCaptured when the consent commits, before the authorization flow\nvalidates the requested scope, so the reach it describes is written\nmoments later when the code is issued.",
"allOf": [
{
"$ref": "#/components/schemas/GrantCreatedPayload"
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"grant.created"
]
}
}
}
]
},
{
"description": "Emitted when a live grant's reach changes, by re-consent or by the user\nediting it",
"allOf": [
{
"$ref": "#/components/schemas/GrantUpdatedPayload"
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"grant.updated"
]
}
}
}
]
},
{
"description": "Emitted when a grant is revoked, by its user or by the application's\ndeveloper",
"allOf": [
{
"$ref": "#/components/schemas/GrantRevokedPayload"
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"grant.revoked"
]
}
}
}
]
}
]
}Variants§
Variant0
Fields
type_: WebhookPayloadVariant0TypeVariant1
Variant2
Variant3
Fields
type_: WebhookPayloadVariant3TypeVariant4
Fields
type_: WebhookPayloadVariant4TypeVariant5
Fields
type_: WebhookPayloadVariant5TypeVariant6
Fields
type_: WebhookPayloadVariant6TypeVariant7
Fields
type_: WebhookPayloadVariant7TypeVariant8
Fields
type_: WebhookPayloadVariant8TypeVariant9
Variant10
Variant11
Variant12
Fields
type_: WebhookPayloadVariant12TypeVariant13
Fields
type_: WebhookPayloadVariant13TypeVariant14
Fields
type_: WebhookPayloadVariant14TypeVariant15
Fields
type_: WebhookPayloadVariant15TypeVariant16
Fields
type_: WebhookPayloadVariant16TypeVariant17
Fields
type_: WebhookPayloadVariant17TypeVariant18
Fields
consent_surface: WebhookPayloadVariant18ConsentSurfaceWhere the user answered: the page One renders, or the connect card framed inside the application’s own site.
environment: WebhookPayloadVariant18Environmenttype_: WebhookPayloadVariant18Typeversion: i64Which revision of this grant’s reach the delivery describes. Bumped by every consent and every edit, so an application can tell a change it has already applied from one it has not.
Two things it is not. It counts within one grant rather than across a
user, so a grant created after a revocation starts at 1 again and the
comparison has to be keyed by grant_id. And grant.revoked repeats
the version the grant last reached rather than taking a new one,
because revoking changes who may act and not what the grant describes -
so it is the one event in the family that must not be discarded as
already-seen. Deduplicate on X-Webhook-Event-Id, never on this.
Variant19
Fields
environment: WebhookPayloadVariant19Environmentsource: WebhookPayloadVariant19SourceWhat moved a live grant.
One field on grant.updated rather than two events: an application can
prompt the user to re-consent and cannot prompt them to un-edit, so it
branches on this, but it is one occurrence either way.
type_: WebhookPayloadVariant19Typeversion: i64Which revision of this grant’s reach the delivery describes. Bumped by every consent and every edit, so an application can tell a change it has already applied from one it has not.
Two things it is not. It counts within one grant rather than across a
user, so a grant created after a revocation starts at 1 again and the
comparison has to be keyed by grant_id. And grant.revoked repeats
the version the grant last reached rather than taking a new one,
because revoking changes who may act and not what the grant describes -
so it is the one event in the family that must not be discarded as
already-seen. Deduplicate on X-Webhook-Event-Id, never on this.
Variant20
Fields
environment: WebhookPayloadVariant20Environmentrevoked_by: WebhookPayloadVariant20RevokedByWho ended a grant, which decides how the application answers: after the user or a departure it may prompt the user to reconnect, and after the application’s owner or a tenant admin ended it deliberately it does not. One field rather than one event per actor.
type_: WebhookPayloadVariant20Typeversion: i64Which revision of this grant’s reach the delivery describes. Bumped by every consent and every edit, so an application can tell a change it has already applied from one it has not.
Two things it is not. It counts within one grant rather than across a
user, so a grant created after a revocation starts at 1 again and the
comparison has to be keyed by grant_id. And grant.revoked repeats
the version the grant last reached rather than taking a new one,
because revoking changes who may act and not what the grant describes -
so it is the one event in the family that must not be discarded as
already-seen. Deduplicate on X-Webhook-Event-Id, never on this.