Update a destination
PATCH
/v1/destinations/{id}
const url = 'https://api.hooks.events/v1/destinations/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","url":"example","headers":{"additionalProperty":"example"},"timeoutMs":1,"retryPolicy":{"maxAttempts":1,"initialDelaySeconds":1,"maxDelaySeconds":1,"backoff":"fixed","jitter":1,"retryAfter":true},"rateLimitPerMinute":1,"maxConcurrency":1,"status":"active","type":"example","config":{"additionalProperty":"example"},"method":"GET","params":[{"key":"example","value":"example","enabled":true}],"auth":{"mode":"none","token":"example","username":"example","password":"example","key":"example","value":"example","addTo":"header","secret":"example","header":"example","tokenUrl":"example","clientId":"example","clientSecret":"example","scope":"example"},"bodyMode":"none","bodyTemplate":"example","templateStrict":true,"filters":{"allow":[{"field":"example","op":"equals","value":["example"]}],"deny":[{"field":"example","op":"equals","value":["example"]}],"ignoreActors":["example"],"ignoreBots":true,"senders":{"allow":{"logins":["example"],"organizations":["example"],"associations":["OWNER"]},"requireAllowlist":true,"allowForkPrs":true,"frequency":{"max":1,"windowMinutes":1,"key":"actor"}}},"hooks":{"stages":{"received":[{"type":"drop","condition":{"field":"example","op":"equals","value":["example"]}}],"before_transform":[{"type":"drop","condition":{"field":"example","op":"equals","value":["example"]}}],"before_deliver":[{"type":"drop","condition":{"field":"example","op":"equals","value":["example"]}}],"after_deliver":[{"type":"drop","condition":{"field":"example","op":"equals","value":["example"]}}],"on_failure":[{"type":"drop","condition":{"field":"example","op":"equals","value":["example"]}}],"on_dead":[{"type":"drop","condition":{"field":"example","op":"equals","value":["example"]}}]}},"transform":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.hooks.events/v1/destinations/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "url": "example", "headers": { "additionalProperty": "example" }, "timeoutMs": 1, "retryPolicy": { "maxAttempts": 1, "initialDelaySeconds": 1, "maxDelaySeconds": 1, "backoff": "fixed", "jitter": 1, "retryAfter": true }, "rateLimitPerMinute": 1, "maxConcurrency": 1, "status": "active", "type": "example", "config": { "additionalProperty": "example" }, "method": "GET", "params": [ { "key": "example", "value": "example", "enabled": true } ], "auth": { "mode": "none", "token": "example", "username": "example", "password": "example", "key": "example", "value": "example", "addTo": "header", "secret": "example", "header": "example", "tokenUrl": "example", "clientId": "example", "clientSecret": "example", "scope": "example" }, "bodyMode": "none", "bodyTemplate": "example", "templateStrict": true, "filters": { "allow": [ { "field": "example", "op": "equals", "value": [ "example" ] } ], "deny": [ { "field": "example", "op": "equals", "value": [ "example" ] } ], "ignoreActors": [ "example" ], "ignoreBots": true, "senders": { "allow": { "logins": [ "example" ], "organizations": [ "example" ], "associations": [ "OWNER" ] }, "requireAllowlist": true, "allowForkPrs": true, "frequency": { "max": 1, "windowMinutes": 1, "key": "actor" } } }, "hooks": { "stages": { "received": [ { "type": "drop", "condition": { "field": "example", "op": "equals", "value": [ "example" ] } } ], "before_transform": [ { "type": "drop", "condition": { "field": "example", "op": "equals", "value": [ "example" ] } } ], "before_deliver": [ { "type": "drop", "condition": { "field": "example", "op": "equals", "value": [ "example" ] } } ], "after_deliver": [ { "type": "drop", "condition": { "field": "example", "op": "equals", "value": [ "example" ] } } ], "on_failure": [ { "type": "drop", "condition": { "field": "example", "op": "equals", "value": [ "example" ] } } ], "on_dead": [ { "type": "drop", "condition": { "field": "example", "op": "equals", "value": [ "example" ] } } ] } }, "transform": "example" }'Requires the endpoints:write scope.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
string
url
string
headers
object
key
additional properties
string | null
timeoutMs
integer
retryPolicy
status
string
type
string
config
object
key
additional properties
method
string
params
Array<object>
object
key
required
string
value
required
string
enabled
boolean
auth
object
mode
string
token
string
username
string
password
string
key
string
value
string
addTo
string
secret
string
header
string
tokenUrl
string
clientId
string
clientSecret
string
scope
string
bodyMode
string
bodyTemplate
string
templateStrict
boolean
filters
Any of:
object
allow
deny
ignoreActors
Array<string>
ignoreBots
boolean
senders
object
allow
object
logins
Array<string>
organizations
Array<string>
associations
Array<string>
requireAllowlist
boolean
allowForkPrs
boolean
frequency
object
max
required
integer
windowMinutes
required
integer
key
string
null
hooks
Any of:
object
stages
required
object
received
Array
One of:
object
type
required
string
path
required
string
object
type
required
string
destinationId
required
string
object
type
required
string
destinationId
required
string
object
type
required
string
url
required
string format: uri
method
string
before_transform
Array
One of:
object
type
required
string
path
required
string
object
type
required
string
destinationId
required
string
object
type
required
string
destinationId
required
string
object
type
required
string
url
required
string format: uri
method
string
before_deliver
Array
One of:
object
type
required
string
path
required
string
object
type
required
string
destinationId
required
string
object
type
required
string
destinationId
required
string
object
type
required
string
url
required
string format: uri
method
string
after_deliver
Array
One of:
object
type
required
string
path
required
string
object
type
required
string
destinationId
required
string
object
type
required
string
destinationId
required
string
object
type
required
string
url
required
string format: uri
method
string
on_failure
Array
One of:
object
type
required
string
path
required
string
object
type
required
string
destinationId
required
string
object
type
required
string
destinationId
required
string
object
type
required
string
url
required
string format: uri
method
string
on_dead
Array
One of:
object
type
required
string
path
required
string
object
type
required
string
destinationId
required
string
object
type
required
string
destinationId
required
string
object
type
required
string
url
required
string format: uri
method
string
null
Responses
Section titled “Responses”Success
Media typeapplication/json
object
ok
required
boolean
key
additional properties
Example generated
{ "ok": true}Validation error
Media typeapplication/json
object
error
required
object
code
required
Machine-readable error code
string
message
required
string
requestId
required
Request id, also echoed in x-request-id
string
key
additional properties
Example generated
{ "error": { "code": "example", "message": "example", "requestId": "example" }}Missing or invalid credentials
Media typeapplication/json
object
error
required
object
code
required
Machine-readable error code
string
message
required
string
requestId
required
Request id, also echoed in x-request-id
string
key
additional properties
Example generated
{ "error": { "code": "example", "message": "example", "requestId": "example" }}The credential lacks the required scope, or the workspace is not writable
Media typeapplication/json
object
error
required
object
code
required
Machine-readable error code
string
message
required
string
requestId
required
Request id, also echoed in x-request-id
string
key
additional properties
Example generated
{ "error": { "code": "example", "message": "example", "requestId": "example" }}Resource not found
Media typeapplication/json
object
error
required
object
code
required
Machine-readable error code
string
message
required
string
requestId
required
Request id, also echoed in x-request-id
string
key
additional properties
Example generated
{ "error": { "code": "example", "message": "example", "requestId": "example" }}Rate limited
Media typeapplication/json
object
error
required
object
code
required
Machine-readable error code
string
message
required
string
requestId
required
Request id, also echoed in x-request-id
string
key
additional properties
Example generated
{ "error": { "code": "example", "message": "example", "requestId": "example" }}Headers
Section titled “Headers”X-RateLimit-Limit
integer
Requests allowed per window
X-RateLimit-Remaining
integer
X-RateLimit-Reset
integer
Seconds until the window resets