Update a Webhook API
On this page
This API is used to update an existing Webhook.
You must specify all of the properties of the Webhook when calling this API with the PUT HTTP method. When used with PUT, this API doesn't merge the existing Webhook and your new data. It replaces the existing Webhook with your new data.
Utilize the PATCH HTTP method to send specific changes to merge into an existing Webhook.
Request#
Send the full Webhook with your changes applied.
OpenAPI Spec
OpenAPI Spec
For backward compatibility, a PATCH request with a Content-Type of application/json accepts the same body as the PUT request. FusionAuth merges the request into the existing object:
- FusionAuth keeps every field that the request leaves out, so send only the fields you want to change.
- FusionAuth merges a map, such as
data, by key. To remove a key, set the key tonull. - FusionAuth appends the values in a request array to the existing array, unless this API documents otherwise. An empty array leaves the existing array unchanged, so you can't remove values from an appending array.
- FusionAuth adds each object in an array of objects as a new element. FusionAuth doesn't match the object to an existing element by Id or by position.
- Don't send a value that an array of Ids already contains, such as a key Id or a Tenant Id. Some of these arrays then return a
500status code. - Don't set an array to
null. Depending on the field, FusionAuth clears the array or returns a500status code.
To remove values from an array, PUT the full object, or set the Content-Type to one of the following media types:
application/json-patch+jsonfor JSON Patch (RFC 6902)application/merge-patch+jsonfor JSON Merge Patch (RFC 7396)
For more information, see The PATCH HTTP Method.
Path Parameters#
webhookIdThe Id of the Webhook to update.
Request Body#
webhook.applicationIds The Ids of the Applications that this Webhook should be associated with. If no Ids are specified and the global field is false, this Webhook will not be used. Typically global should be set to true.
1.37.0In version 1.37.0 and beyond, Webhooks are optionally associated with Tenants instead of Applications. See new field tenantIds.
webhook.connectTimeout The connection timeout in milliseconds used when FusionAuth sends events to the Webhook.
webhook.data An object that can hold any information about the Webhook that should be persisted.
webhook.description A description of the Webhook. This is used for display purposes only.
webhook.eventsEnabled A mapping for the events that are enabled for this Webhook. The key of the Object property is the name of the event and the value is a boolean. It should look like this:
{
"user.create": true,
"user.delete": false
}
The possible event types are listed below. For each event's payload, see Events.
audit-log.create- When an audit log is created Available since1.30.0cimd.registration.failed- When a CIMD client registration fails (non-transactional) Available since1.70.0cimd.registration.success- When a CIMD client registration is created or updated (non-transactional) Available since1.70.0entity.create- When an entity is created Available since1.69.0entity.create.complete- When an entity create transaction has completed Available since1.69.0entity.delete- When an entity is deleted Available since1.69.0entity.delete.complete- When an entity delete transaction has completed Available since1.69.0entity.update- When an entity is updated Available since1.69.0entity.update.complete- When an entity update transaction has completed Available since1.69.0event-log.create- When an event log is created Available since1.30.0jwt.public-key.update- When a JWT signing Public / Private keypair may have been changedjwt.refresh- When an access token is refreshed using a refresh token Available since1.16.0jwt.refresh-token.revoke- When a JWT Refresh Token is revokedkickstart.success- When kickstart has successfully completed Available since1.30.0token.exchange- When a token exchange is attempted (transactional) Available since1.70.0token.exchange.complete- When a token exchange transaction has completed (non-transactional) Available since1.70.0user.action- When a user action is triggereduser.bulk.create- When multiple users are created in bulk (i.e. during an import)user.create- When a user is createduser.create.complete- When a user create transaction has completed Available since1.30.0user.deactivate- When a user is deactivateduser.delete- When a user is deleteduser.delete.complete- When a user delete transaction has completed Available since1.30.0user.email.update- When a user updates their email address Available since1.30.0user.email.verified- When a user verifies their email address Available since1.8.0user.identity-provider.link- When a link is created from a user to an Identity Provider Available since1.36.0user.identity-provider.unlink- When an existing Identity Provider link is removed from a User Available since1.36.0user.identity.update- When a user's phone number is added, changed, or removed Available since1.59.0user.identity.verified- When a user's identity is verified Available since1.59.0user.loginId.duplicate.create- When a request to create a user with a login Id (email or username) which is already in use has been received Available since1.30.0Enterprise planuser.loginId.duplicate.update- When a request to update a user and change their login Id (email or username) to one that is already in use has been received Available since1.30.0Enterprise planuser.login.failed- When a user fails a login request Available since1.6.0user.login.new-device- When a user begins a login request with a new device Available since1.30.0Enterprise planuser.login.success- When a user completes a login request Available since1.6.0user.login.suspicious- When a user logs in and is considered to be a potential threat Available since1.30.0Enterprise planuser.password.breach- When Reactor detects a user is using a potentially breached password Available since1.15.0Starter+ planuser.password.reset.send- When a forgot password email has been sent to a user Available since1.30.0Enterprise planuser.password.reset.start- When the process to reset a user password has started Available since1.30.0Enterprise planuser.password.reset.success- When a user has successfully reset their password Available since1.30.0Enterprise planuser.password.update- When a user has updated their password Available since1.30.0Enterprise planuser.reactivate- When a user is reactivateduser.registration.create- When a user registration is created Available since1.6.0user.registration.create.complete- When a user registration create transaction has completed Available since1.30.0user.registration.delete- When a user registration is deleted Available since1.6.0user.registration.delete.complete- When a user registration delete transaction has completed Available since1.30.0user.registration.update- When a user registration is updated Available since1.6.0user.registration.update.complete- When a user registration update transaction has completed Available since1.30.0user.registration.verified- When a user completes registration verification Available since1.8.0user.two-factor.challenge- When a user is presented a two-factor challenge Available since1.68.0Enterprise planuser.two-factor.failed-attempt- When a user submits an incorrect answer to a two-factor challenge Available since1.68.0Enterprise planuser.two-factor.method.add- When a user has added a two-factor method Available since1.30.0Enterprise planuser.two-factor.method.remove- When a user has removed a two-factor method Available since1.30.0Enterprise planuser.two-factor.success- When a user submits a correct answer to a two-factor challenge Available since1.68.0Enterprise planuser.update- When a user is updateduser.update.complete- When a user update transaction has completed Available since1.30.0
webhook.global Whether or not this Webhook is used for all Tenants or only for specific Tenants.
Whether or not this Webhook is used for all events or only for specific Applications. In almost all cases you want to set this field to true and filter on the application Id when processing the webhook.
webhook.headers An object that contains headers that are sent as part of the HTTP request for the events. See Secure Webhooks for using headers to authenticate requests.
webhook.httpAuthenticationPassword The HTTP basic authentication password that is sent as part of the HTTP request for the events.
webhook.httpAuthenticationUsername The HTTP basic authentication username that is sent as part of the HTTP request for the events.
webhook.readTimeout The read timeout in milliseconds used when FusionAuth sends events to the Webhook.
webhook.signatureConfiguration.enabled Whether or not webhook events are signed. See Sign Webhooks to set up signing and verify signatures.
webhook.signatureConfiguration.signingKeyId The Id of the key used to sign webhook events. Required when webhook.signatureConfiguration is set to true.
webhook.sslCertificate An SSL certificate in PEM format that is used to establish the SSL (TLS specifically) connection to the Webhook.
1.48.0In version 1.48.0 and beyond, the webhook SSL certificate can be managed via webhook.sslCertificateKeyId. This field is not allowed on a request when webhook.sslCertificateKeyId is provided.
webhook.sslCertificateKeyId The Id of an existing Key. The X.509 certificate is used for client certificate authentication in requests to the Webhook. See Secure Webhooks.
webhook.tenantIds The Ids of the Tenants that this Webhook should be associated with. If no Ids are specified and the global field is false, this Webhook will not be used.
webhook.url The fully qualified URL of the Webhook's endpoint that will accept the event requests from FusionAuth. See Write a Webhook for what this endpoint must handle.
{
"webhook": {
"connectTimeout": 1000,
"data": {
"updatedBy": "richard"
},
"description": "The standard game Webhook",
"eventsEnabled": {
"user.create": true,
"user.delete": false
},
"global": false,
"headers": {
"Header 1": "value 1",
"Header 2": "value 2"
},
"httpAuthenticationPassword": "password",
"httpAuthenticationUsername": "username",
"readTimeout": 2000,
"signatureConfiguration": {
"enabled": true,
"signingKeyId": "401c9046-b274-403f-963d-adc5024c6ef0"
},
"sslCertificateKeyId": "e31e242b-4eca-4309-921f-48cb72ec9bfb",
"tenantIds": [
"32306536-3036-6431-3865-646430303332",
"30663132-6464-6665-3032-326466613934"
],
"url": "http://mygameserver.local:7001/fusionauth-webhook"
}
}Response#
The response for this API contains the new information for the Webhook that was updated.
| Code | Description |
|---|---|
| 200 | The request succeeded. The response contains a JSON body. |
| 400 | The request was invalid or malformed. The response contains an Errors JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present. |
| 401 | FusionAuth didn't authorize the request. The Authorization header is missing, the API key isn't valid, or the API key doesn't have permission for this endpoint and method. The response is empty. For more information, see Unauthorized Responses. |
| 500 | FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response usually contains an Errors JSON object with the [Exception] general error code. On MySQL, a data field larger than the database column also returns 500. For more information, see Data Field Sizes. |
| 503 | The search index is unavailable or returned an error, so FusionAuth can't complete the request. The response contains a JSON body. |
Response Body#
webhook.applicationIds The Ids of the Applications that this Webhook is associated with. If no Ids are returned and the global field is false, this Webhook is not used. Typically global should be set to true.
1.37.0In version 1.37.0 and beyond, Webhooks are optionally associated with Tenants instead of Applications. See new field tenantIds.
webhook.connectTimeout The connection timeout in milliseconds used when FusionAuth sends events to the Webhook.
webhook.data An object that can hold any information about the Webhook that should be persisted.
webhook.description A description of the Webhook. This is used for display purposes only.
webhook.eventsEnabled A mapping for the events that are enabled for this Webhook. The key of the Object property is the name of the event and the value is a boolean. It should look like this:
{
"user.create": true,
"user.delete": false
}
The possible event types are:
audit-log.create- When an audit log is created Available since1.30.0cimd.registration.failed- When a CIMD client registration fails (non-transactional) Available since1.70.0cimd.registration.success- When a CIMD client registration is created or updated (non-transactional) Available since1.70.0entity.create- When an entity is created Available since1.69.0entity.create.complete- When an entity create transaction has completed Available since1.69.0entity.delete- When an entity is deleted Available since1.69.0entity.delete.complete- When an entity delete transaction has completed Available since1.69.0entity.update- When an entity is updated Available since1.69.0entity.update.complete- When an entity update transaction has completed Available since1.69.0event-log.create- When an event log is created Available since1.30.0jwt.public-key.update- When a JWT signing Public / Private keypair may have been changedjwt.refresh- When an access token is refreshed using a refresh token Available since1.16.0jwt.refresh-token.revoke- When a JWT Refresh Token is revokedkickstart.success- When kickstart has successfully completed Available since1.30.0token.exchange- When a token exchange is attempted (transactional) Available since1.70.0token.exchange.complete- When a token exchange transaction has completed (non-transactional) Available since1.70.0user.action- When a user action is triggereduser.bulk.create- When multiple users are created in bulk (i.e. during an import)user.create- When a user is createduser.create.complete- When a user create transaction has completed Available since1.30.0user.deactivate- When a user is deactivateduser.delete- When a user is deleteduser.delete.complete- When a user delete transaction has completed Available since1.30.0user.email.update- When a user updates their email address Available since1.30.0user.email.verified- When a user verifies their email address Available since1.8.0user.identity-provider.link- When a link is created from a user to an Identity Provider Available since1.36.0user.identity-provider.unlink- When an existing Identity Provider link is removed from a User Available since1.36.0user.identity.update- When a user's phone number is added, changed, or removed Available since1.59.0user.identity.verified- When a user's identity is verified Available since1.59.0user.loginId.duplicate.create- When a request to create a user with a login Id (email or username) which is already in use has been received Available since1.30.0Enterprise planuser.loginId.duplicate.update- When a request to update a user and change their login Id (email or username) to one that is already in use has been received Available since1.30.0Enterprise planuser.login.failed- When a user fails a login request Available since1.6.0user.login.new-device- When a user begins a login request with a new device Available since1.30.0Enterprise planuser.login.success- When a user completes a login request Available since1.6.0user.login.suspicious- When a user logs in and is considered to be a potential threat Available since1.30.0Enterprise planuser.password.breach- When Reactor detects a user is using a potentially breached password Available since1.15.0Starter+ planuser.password.reset.send- When a forgot password email has been sent to a user Available since1.30.0Enterprise planuser.password.reset.start- When the process to reset a user password has started Available since1.30.0Enterprise planuser.password.reset.success- When a user has successfully reset their password Available since1.30.0Enterprise planuser.password.update- When a user has updated their password Available since1.30.0Enterprise planuser.reactivate- When a user is reactivateduser.registration.create- When a user registration is created Available since1.6.0user.registration.create.complete- When a user registration create transaction has completed Available since1.30.0user.registration.delete- When a user registration is deleted Available since1.6.0user.registration.delete.complete- When a user registration delete transaction has completed Available since1.30.0user.registration.update- When a user registration is updated Available since1.6.0user.registration.update.complete- When a user registration update transaction has completed Available since1.30.0user.registration.verified- When a user completes registration verification Available since1.8.0user.two-factor.challenge- When a user is presented a two-factor challenge Available since1.68.0Enterprise planuser.two-factor.failed-attempt- When a user submits an incorrect answer to a two-factor challenge Available since1.68.0Enterprise planuser.two-factor.method.add- When a user has added a two-factor method Available since1.30.0Enterprise planuser.two-factor.method.remove- When a user has removed a two-factor method Available since1.30.0Enterprise planuser.two-factor.success- When a user submits a correct answer to a two-factor challenge Available since1.68.0Enterprise planuser.update- When a user is updateduser.update.complete- When a user update transaction has completed Available since1.30.0
webhook.global Whether or not this Webhook is used for all Tenants or only for specific Tenants.
Whether or not this Webhook is used for all events or only for specific Applications.
webhook.headers An object that contains headers that are sent as part of the HTTP request for the events.
webhook.httpAuthenticationPassword The HTTP basic authentication password that is sent as part of the HTTP request for the events.
webhook.httpAuthenticationUsername The HTTP basic authentication username that is sent as part of the HTTP request for the events.
webhook.id The Id of the Webhook.
webhook.insertInstant The instant that the Webhook was added to the FusionAuth database.
webhook.lastUpdateInstant The instant that the Webhook was last updated in the FusionAuth database.
webhook.readTimeout The read timeout in milliseconds used when FusionAuth sends events to the Webhook.
webhook.signatureConfiguration.enabled Whether or not webhook events are signed.
webhook.signatureConfiguration.signingKeyId The Id of the key used to sign webhook events.
webhook.sslCertificate An SSL certificate in PEM format that is used to establish the SSL (TLS specifically) connection to the Webhook.
1.48.0In version 1.48.0 and beyond, the webhook SSL certificate can be managed via webhook.sslCertificateKeyId.
webhook.sslCertificateKeyId The Id of an existing Key. The X.509 certificate is used for client certificate authentication in requests to the Webhook.
webhook.tenantIds The Ids of the Tenants that this Webhook is associated with. If no Ids are returned and the global field is false, this Webhook is not used.
webhook.url The fully qualified URL of the Webhook's endpoint that will accept the event requests from FusionAuth.
{
"webhook": {
"connectTimeout": 1000,
"data": {
"updatedBy": "richard"
},
"description": "The standard game Webhook",
"eventsEnabled": {
"user.create": true,
"user.delete": false
},
"global": false,
"headers": {
"Header 1": "value 1",
"Header 2": "value 2"
},
"httpAuthenticationPassword": "password",
"httpAuthenticationUsername": "username",
"id": "00000000-0000-0000-0000-000000000042",
"insertInstant": 1471786482322,
"lastUpdateInstant": 1595361143101,
"readTimeout": 2000,
"signatureConfiguration": {
"enabled": true,
"signingKeyId": "401c9046-b274-403f-963d-adc5024c6ef0"
},
"sslCertificateKeyId": "e31e242b-4eca-4309-921f-48cb72ec9bfb",
"tenantIds": [
"32306536-3036-6431-3865-646430303332",
"30663132-6464-6665-3032-326466613934"
],
"url": "http://mygameserver.local:7001/fusionauth-webhook"
}
}Related
API documentation for the FusionAuth Create a Webhook API.
Learn how to secure your Webhooks so that events coming from FusionAuth are not at risk of leaking.
Learn how to sign your Webhook events so you can verify they were sent by FusionAuth.
Learn how to write a webhook to handle and process FusionAuth events.