Add a destination to an endpoint
POST
/v1/endpoints/{id}/destinations
const url = 'https://api.hooks.events/v1/endpoints/example/destinations';const options = { method: 'POST', 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,"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 POST \ --url https://api.hooks.events/v1/endpoints/example/destinations \ --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, "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
required
string
headers
object
key
additional properties
string | null
timeoutMs
integer
retryPolicy
object
maxAttempts
integer
initialDelaySeconds
integer
maxDelaySeconds
integer
backoff
string
jitter
number
retryAfter
boolean
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
id
required
Resource id
string
endpointId
required
string
name
required
string | null
type
required
Target adapter id; http is the generic webhook
string
url
required
string
status
required
string
consecutiveFailures
required
integer
pauseReason
required
string | null
method
required
string
bodyMode
required
string
createdAt
required
ISO-8601 timestamp
string
updatedAt
required
ISO-8601 timestamp
string
usage
required
Rate-limit defaults and current usage
object
key
additional properties
key
additional properties
Example
{ "status": "active"}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