Sources

A source is any service that sends the Hookdeck platform HTTP requests. For example, a third-party service sending webhooks such as Shopify and Stripe, or an internal service making an HTTP request to distribute an event to other services, external or internal.

How sources work

Each source is given a unique Hookdeck URL that can be pasted into the HTTP or webhook URL field of the sender platform, or used within code when making the HTTP request.

Once HTTP requests are received by Hookdeck via the source URL, events are ingested and routed according to your connection rules.

Hookdeck is a platform for asynchronous messaging and therefore returns a basic customizable synchronous HTTP response to the client that has invoked the source URL. It is not possible to synchronously return a response from a destination to the client (for example, the result of an API call). However, you can use an asynchonous workflow to achieve this and send the result of any work done by a destination via a webhook callback. See the Hookdeck destination response FAQ for more information.

You can customize the source URL to use your own custom domain name. See Custom Domain for more information.

Content-types

Hookdeck aims to be compatible with every API provider and with common HTTP event payloads. To accomplish this, we remain platform-agnostic and ingest requests (up to 10 MiB) with one of the following content-types:

  • text/plain
  • text/xml
  • application/json
  • application/x-www-form-urlencoded
  • application/xml
  • application/*+json
  • application/jwt
  • application/x-ndjson
  • multipart/form-data

If you encounter a problem integrating a specific API provider, send us a message.

Create a source

Creating a source allows Hookdeck to begin receiving and routing events sent from a specific origin.

To create a source, follow the instructions for creating a connection.

POST /sources

Custom methods

POST, PUT, PATCH, and DELETE requests are accepted by default. GET requests are not accepted by default, but you can enable them in the Source Configuration > Advanced Source Configuration section when creating or updating your sources.

HTTP Methods in the advanced configuration section in Source form

You can also enable them explicitly by using a x-hookdeck-allow-methods query string parameter in your Hookdeck source URL.

?x-hookdeck-allow-methods=get

Custom responses

Some API vendors modify their behavior based on the response they receive from a request. For these providers, Hookdeck supports setting custom responses to satisfy their requirements.

Customize Response in Source form

You can also use query string parameter x-hookdeck-response to explicitly customize the response. Append one of the following query parameters to the Hookdeck-provided source URL to achieve the desired response.

ResponseQuery parameter exampleBehavior
Empty?x-hookdeck-response=null or ?x-hookdeck-responseHookdeck responds with an empty body
Text?x-hookdeck-response[text]=Hello+WorldHookdeck responds with the text Hello World
JSON?x-hookdeck-response[json]=%7B%22message%22%3A%22Hello%20World%22%7DHookdeck responds with the specified JSON
XML?x-hookdeck-response[xml]=<root><child></child></root>Hookdeck responds with the specified XML

Add source authentication

Requests can optionally be authenticated. Hookdeck supports generic authentication options, HMAC, Basic Auth, and API Keys, which cover the majority of authentication providers. Additionally, Hookdeck has built-in support for a number of third-party providers. See source authentication providers for a full list of providers.

Configure how incoming requests from a source are authenticated.

  1. Open the Connections page.
  2. Click the source you want to authenticate.
  3. Click Open Source.
  4. Under Advanced Source Configuration, toggle the Source Authentication switch and select the appropriate authentication method from the dropdown.
  5. Enter the information required by the authentication method.
  6. Click Save.
PUT /destinations/:id

All secrets are AES encrypted.

In the connection's page, your source will now have a shield icon next to it.

Edit source authentication

Edit a source to update the authentication method or change the credentials.

  1. Open the Connections page.
  2. Click the source you want to edit the authentication method for.
  3. Click Open Source.
  4. Scroll to Source Authentication under Advanced Source Configuration, and change the authentication method and related credentials.
  5. Click Save.
PUT /destinations/:id

Remove source authentication

Removing authentication from a source will stop the authentication and verification of any incoming requests and all requests will be accepted.

  1. Open the Connections page.
  2. Click the source you want to remove authentication from.
  3. Click Open Source.
  4. Under Advanced Source Configuration, toggle off the Source Authentication switch.
  5. Click Save.
PUT /destinations/:id

Edit a source

Editing a source lets you change the name of a source in your project.

  1. Open the Connections page.
  2. Click the source you want to edit.
  3. You can edit the source from inside the popup or click Open Source to edit in full page.
  4. Click Save.
PUT /sources/:id

Once a source has been renamed, its name is updated throughout the project and within any associated connection(s).

Disable a source

Disabling a source temporarily halts inbound requests at the associated Hookdeck URL. An HTTP 200 status code will still be returned for any request received on your Source URL.

This process also disables all the connections that are associated to that source.

  1. Open the Connections page.
  2. Click the source you wish to disable.
  3. Click ••• button in the bottom right corner of the popup.
  4. Click Disable Source.
PUT /sources/:id/disable

Enable a source

Enabling a source returns that source to its previously active state.

  1. Open the Connections page.
  2. Click the disabled source you wish to enable.
  3. Click ••• button in the bottom right corner of the popup.
  4. Click Enable Source.
PUT /sources/:id/enable

Hookdeck will resume ingesting requests from the enabled source. You may need to enable the associated connection(s) when the source was disabled or create new connections. Requests received from the source while it was disabled will not be available for replay.

Delete a source

Deleting a source permanently disables inbound requests at the associated Hookdeck URL. Hookdeck will return an HTTP 410 status code for any request received on your Source URL.

Associated event and request data is retained for the remainder of your retention window and will be displayed with a Source Deleted label.

This process also deletes all the connections that rely on the source.

  1. Open the Connections page.
  2. Click the source you wish to delete.
  3. Click ••• button in the bottom right corner of the popup.
  4. Click Delete Source.
  5. Click Delete in the confirmation dialog.
DELETE /sources/:id

Once a source has been deleted, it will disappear from your list of sources and the Connections page.