Update Webhook Subscription
Description
Update a webhook subscription within your Bold Penguin tenant.
The endpoint returns a webhook subscription object.
Endpoint
Staging
https://hookshot-uat.beta.boldpenguin.com/hooks/<hook-id>
Production
https://hookshot.boldpenguin.com/hooks/<hook-id>
Authentication
This endpoint requires an access_token from the authentication endpoint in the same environment with the appropriate permissions. Include it as a bearer token in an Authorization header for the request.
Authorization: Bearer <access_token>
Methods
PUT PATCH
Request Syntax
PUT /hooks/<hook-id>
Request Payload
You do not need to supply a full payload on each update. You only need the pieces of the payload that have changed.
{
"active": boolean,
"events": [
"<string>",
"<string>",
...
],
"header": "<string>",
"secret": "<string>",
"url": "<string>"
}
Request Parameters
Remember, for a subscription to receive events it must have the following minimum configuration:
- A valid, accessible URL endpoint
- One or more valid event types (or a wildcard)
active
set totrue
URL Parameters
- hook-id
- A unique ID for this subscription within your tenant.
- Type: UUID (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)
- Required: Yes
JSON Parameters
- active
- Enable the delivery of webhook payloads by setting this to true
- You must have at least one event subscription to set to true
- Type: Boolean
- Required: No
- events
- An array of valid
subject
orsubject:action
strings (see Event Subjects & Payloads for allowed values) - Or the wildcard string ("*")
- Type: Array of strings
- Required: No
- An array of valid
- header
- Static HTTP header for authentication
- Type: String (format Name: Value)
- Required: No
- secret
- Shared secret for validating X-Signature headers
- Type: String
- Required: No
- url
- A valid URL string to receive events
- Type: URL string
- Required: No
Response Syntax
{
"id": "<UUID>",
"active": <boolean>,
"confirmed": false,
"events": [
"<string>",
"<string>",
...
],
"config": {
"url": "<string>",
"secret": "<string>",
"header": "<string>"
},
"owner_id": "<UUID>",
"tenant_id": "<UUID>",
"updated_at": "<Timestamp>",
"updated_at": "<Timestamp>"
}
Response Elements
- id
- A globally unique ID for this subscription within your tenant.
- Type: UUID
- active
- Is this subscription currently receiving events
- Type: Boolean
- confirmed
- Unused (always
false
) - Type: Boolean
- Unused (always
- events
- An array of valid
subject
orsubject:action
strings (see Event Subjects & Payloads for allowed values) - Or a wildcard ("*")
- Type: Array of strings
- An array of valid
- config
- Configuration object containing url, secret, and header
- Type: Configuration object
- Object elements:
- url
- A valid URL string to receive events
- Type: URL string
- Required: Yes
- header
- Static HTTP header for authentication or other purposes.
- Type: String (format Name: Value)
- Required: No
- secret
- Shared secret for validating X-Signature headers
- Type: String
- Required: No
- url
Validation Errors
The API performs specific validation on url
and header
values submitted as
part of create and update operations. Validation failures result in a 422
error with one of the following response payloads.
Header
{
"header": [
"colon separated key value pair"
]
}
URL
{
"url": [
"can't be blank"
]
}
Status Codes
- 200: Success
- 400: Bad request (verify JSON body is well formed)
- 401 Unauthorized: The necessary authentication credentials are not present in the request or are incorrect.
- 404 Not found (verify hook id is valid)
- 422: Parameter validation failure (verify the request body)
Examples
Example Request
curl --request PUT \
--url https://hookshot.boldpenguin.com/hooks/e6db9c1a-d15f-4248-81fa-5b61fc321def \
--header 'authorization: Bearer <access-token>' \
--header 'content-type: application/json' \
--data '{
"active": false,
}'
Example Responses
{
"id": "e6db9c1a-d15f-4248-81fa-5b61fc321def",
"active": false,
"confirmed": false,
"events": [
"*"
],
"config": {
"url": "https://chuck-webhook.ngrok.io",
"secret": "",
"header": "User: Chuck"
},
"owner_id": "46912066-9be9-4a04-97ea-5505a1acde",
"tenant_id": "94f43d40-a61c-4d4d-918e-d888aabe906a",
"created_at": "2020-09-11T14:04:44.053Z",
"updated_at": "2020-09-24T13:47:16.856Z"
}