defineHttpEndpoint()
Defines an HTTP Endpoint
An HTTP endpoint allows you to create an HTTP Trigger, which means you can trigger your Jobs from any webhooks.
Parameters
The options for the HTTP endpoint.
Used to uniquely identify the HTTP Endpoint inside your Project.
Usually you would use the domain name of the service, e.g. cal.com
.
An optional icon name that’s displayed in the dashboard. Lots of company names are supported, e.g. github
, twilio
. You can also reference the name of any Tabler icon, e.g. brand-google-maps
, brand-twitch
.
An optional title, displayed in the dashboard.
Used to provide example payloads that are accepted by the job.
This will be available in the dashboard and can be used to trigger test runs.
Properties that are displayed in the logs.
Each property has the following fields:
This is compulsory, and is used to verify that the received webhook is authentic. It’s a function that expects you to return a result object like:
//if it's valid
return { success: true }
//if it's invalid, reason is optional
return { success: false, reason: "No header" }
In 90% of cases, you’ll want to use the verifyRequestSignature
helper function we provide.
This optional object allows you to immediately Respond to a Request. This is useful for some APIs where they do a GET
Request when the webhook is first setup and expect a specific Response.
Only use this if you really need to Respond to the Request that comes in. Most of the time you don’t.
Returns
The HTTP Endpoint that was created. You should assign this to a variable, as you’ll need it to create an HTTP Trigger.
Was this page helpful?