Create an endpoint
POST
/v1/endpoints
const url = 'https://api.hooks.events/v1/endpoints';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","environmentId":"example","provider":"generic","verificationMode":"none","secret":"example","sourceConfig":{"eventType":"example","deliveryId":"example","actor":"example","subjectTitle":"example","secretHeader":"example","dedupe":{"key":"example","windowSeconds":1}},"rateLimitPerMinute":1,"rateLimitAction":"store","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"]}}]}},"destinations":[{"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 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "environmentId": "example", "provider": "generic", "verificationMode": "none", "secret": "example", "sourceConfig": { "eventType": "example", "deliveryId": "example", "actor": "example", "subjectTitle": "example", "secretHeader": "example", "dedupe": { "key": "example", "windowSeconds": 1 } }, "rateLimitPerMinute": 1, "rateLimitAction": "store", "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" ] } } ] } }, "destinations": [ { "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”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
required
string
provider
string
verificationMode
string
secret
string
sourceConfig
object
eventType
string
deliveryId
string
actor
string
subjectTitle
string
secretHeader
string
dedupe
object
key
required
string
windowSeconds
integer
rateLimitAction
string
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
destinations
Array<object>
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
data
required
object
id
required
Resource id
string
projectId
required
string
environmentId
required
string | null
environment
required
Resolved environment name
string
name
required
string
publicId
required
Path segment of the inbound /in/{publicId} URL
string
publicUrl
required
string
provider
required
string
status
required
string
verificationMode
required
string
hasSecret
required
boolean
hasPreviousSecret
required
A rotation is in progress; both secrets verify
boolean
sourceConfig
required
object
key
additional properties
hooks
required
object
key
additional properties
rateLimitAction
required
string
createdAt
required
ISO-8601 timestamp
string
updatedAt
required
ISO-8601 timestamp
string
key
additional properties
key
additional properties
Example
{ "data": { "status": "active", "verificationMode": "none", "rateLimitAction": "store" }}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" }}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