Create User Webhook
POST/api/v2/public/webhooks/user
We strongly recommend you set up webhooks for better and easier integration.
Creates a new User webhook. Use this endpoint to register a new webhook by specifying the URL and the events you want to subscribe to.
With User Webhook you'll ne notified whenever a facility creation or connection request is either accepted or rejected.
Request
- application/json
Body
required
The URL that will be called when an event is triggered.
Possible values: [all
, facility.user-connection.accepted
, facility.user-connection.rejected
, facility.creation.accepted
, facility.creation.rejected
]
The events that this webhook will listen to.
The secrets that will be used to verify the authenticity of the webhook.
If no value is provided it will auto generate a secret.
Secrets are used to sign and validate the payload of the webhook.
It will accept 2 secrets to allow a rotation strategy without service downtime.
Responses
- 201
- 400
- 401
- 403
- application/json
- Schema
- Example (from schema)
Schema
data object
If of the Webhook
Url of the Webhook
Possible values: [all
, facility.user-connection.accepted
, facility.user-connection.rejected
, facility.creation.accepted
, facility.creation.rejected
]
List of events that this webhook will listen to
List of webhook secrets
{
"data": {
"id": "fb656bc5-8ed0-40ee-ae42-66dd8549a2bb",
"url": "https://exemple.com/webhook",
"events": [
"facility.creation.accepted",
"facility.user-connection.accepted"
],
"clientId": "string",
"secrets": [
"sDV1aKqitCLClI12m7UPFbAAvZfZquJw",
"mryefgHPBVHJwux0o3BYW7hPM0BZlcCa"
]
}
}
Bad request
- application/json
- Schema
- Example (from schema)
- Request Validation
Schema
Error description
The type of error
Status code of the error
{
"message": [
"Property must be a string"
],
"error": "Bad Request",
"statusCode": 400
}
Request Validation Error
{
"message": [
"should be a secure URL with HTTPS",
"url must be a string",
"events must contain at least 1 elements",
"events must be an array",
"each value in events must be one of the following values: all, facility.user-connection.accepted, facility.user-connection.rejected, facility.creation.accepted, facility.creation.rejected",
"secrets must contain no more than 2 elements",
"secrets must be an array"
],
"error": "Bad Request",
"statusCode": 400
}
Unauthorized
- application/json
- Schema
- Example (from schema)
Schema
Error description
Status code of the error
{
"message": "Unauthorized",
"statusCode": 401
}
Forbidden
- application/json
- Schema
- Example (from schema)
Schema
Error description
The type of error
Status code of the error
{
"message": "Forbidden Resource",
"error": "Forbidden",
"statusCode": 403
}