Skip to content

Create a webhook configuration.

POST
/api/admin/webhooks
Code sample: Shell / cURL
curl --request POST \
--url https://auth.example.com/api/admin/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "url": "https://example.com", "registrationStates": [], "payloadFields": [], "events": [ "example" ], "secret": "example", "headers": { "additionalProperty": "example" }, "retryPolicy": { "maxRetries": 1, "initialDelayMs": 1, "backoffMultiplier": 1, "maxDelayMs": 1 }, "timeoutMs": 1, "clientId": "example" }'

Create Webhook in the Webhooks area. The request body is JSON unless the detailed schema for this operation states otherwise.

X-Tenant-Id
string

Tenant selector for multi-tenant admin requests.

Idempotency-Key
string

Idempotency key for state-changing operations that support replay protection.

Media type application/json
object
name
required
string
>= 1 characters
url
required
string format: uri
registrationStates

Account-event registration-state filter. Empty accepts both states; other event families are unaffected.

Array<string>
default: <= 2 items unique items
Allowed values: guest registered
payloadFields

Opt-in event-time fields for account.email.changed and account deletion notifications. Tenant-scoped subscriptions only. Configuration requires admin:webhooks:payload:read in addition to webhook management permission. Existing subscriptions default to no additional fields. Selected email snapshots expire after seven days. Configuration changes cannot grant access to events older than the changed configuration.

Array<string>
default: <= 2 items unique items
Allowed values: email registration_state
events
required

Subscription patterns. Tenant-scoped account.* subscriptions receive durable human account notifications: account.created, account.updated, account.deleted, account.registration.changed, and account.email.changed. Use registrationStates to filter guest or registered accounts. Removed state-specific names and user.created, user.updated, and user.deleted have no compatibility mapping and are not delivered as webhooks. Account events are delivered asynchronously by scheduled maintenance.

Array<string>
>= 1 items
secret
string
headers
object
key
additional properties
string
retryPolicy
object
maxRetries
integer
<= 10
initialDelayMs
integer
backoffMultiplier
number
>= 1
maxDelayMs
integer
key
additional properties
timeoutMs
integer
>= 1000 <= 60000
clientId
string
key
additional properties

Webhook created.

Media type application/json
object
success
required
boolean
webhook
One of:
object
id
string
tenantId
string
clientId
string | null
scope
string
name
string
url
string format: uri
registrationStates

Account-event registration-state filter. Empty accepts both states; other event families are unaffected.

Array<string>
default: <= 2 items unique items
Allowed values: guest registered
payloadFields

Opt-in event-time fields for account.email.changed and account deletion notifications. Tenant-scoped subscriptions only. Configuration requires admin:webhooks:payload:read in addition to webhook management permission. Existing subscriptions default to no additional fields. Selected email snapshots expire after seven days. Configuration changes cannot grant access to events older than the changed configuration.

Array<string>
default: <= 2 items unique items
Allowed values: email registration_state
events
Array<string>
hasSecret
boolean
headers
object
key
additional properties
string
retryPolicy
object
maxRetries
integer
<= 10
initialDelayMs
integer
backoffMultiplier
number
>= 1
maxDelayMs
integer
key
additional properties
timeoutMs
integer
active
boolean
createdAt
string
updatedAt
string
lastSuccessAt
string | null
lastFailureAt
string | null
key
additional properties
Example
{
"webhook": {
"registrationStates": [],
"payloadFields": []
}
}

Error response.

Media type application/json
object
error
string
message
string
error_description
string
key
additional properties
Example generated
{
"error": "example",
"message": "example",
"error_description": "example"
}