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.
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.
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.
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.
Response | Query parameter example | Behavior |
---|---|---|
Empty | ?x-hookdeck-response=null or ?x-hookdeck-response | Hookdeck responds with an empty body |
Text | ?x-hookdeck-response[text]=Hello+World | Hookdeck responds with the text Hello World |
JSON | ?x-hookdeck-response[json]=%7B%22message%22%3A%22Hello%20World%22%7D | Hookdeck responds with the specified JSON |
XML | ?x-hookdeck-response[xml]=<root><child></child></root> | Hookdeck responds with the specified XML |
Add source authentication
Configuring how incoming requests from a source are authenticated.
- Open the Connections page.
- Click the source you want to authenticate.
- Click .
- Under Advanced Source Configuration, toggle the Source Authentication switch and select the appropriate authentication method from the dropdown.
- Enter the information required by the authentication method (HMAC, Basic Auth, or API Keys).
- Click .
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.
- Open the Connections page.
- Click the source you want to edit the authentication method for.
- Click .
- Scroll to Source Authentication under Advanced Source Configuration, and change the authentication method and related credentials.
- Click .
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.
- Open the Connections page.
- Click the source you want to remove authentication from.
- Click .
- Under Advanced Source Configuration, toggle off the Source Authentication switch.
- Click .
PUT /destinations/:id
Edit a source
Editing a source lets you change the name of a source in your workspace.
- Open the Connections page.
- Click the source you want to edit.
- You can edit the source from inside the popup or click to edit in full page.
- Click .
PUT /sources/:id
Once a source has been renamed, its name is updated throughout the workspace and within any associated connection(s).
Archive a source
Archiving a source temporarily disables 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 archives all the connections that are associated to that source.
- Open the Connections page.
- Click the source you wish to archive.
- Click button in the bottom right corner of the popup.
- Click .
PUT /sources/:id/archive
Unarchive a source
Unarchiving a source returns that source to its previously active state.
- Open the Connections page.
- Click the archived source you wish to unarchive.
- Click button in the bottom right corner of the popup.
- Click .
PUT /sources/:id/unarchive
Hookdeck will resume ingesting requests from the unarchived source. You may need to unarchive the associated connection(s) that were deactivated when the source was archived or create new connections. Requests received from the source while it was archived will not be available for replay.
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 deleted all the connections that relies on the source.
- Open the Connections page.
- Click the source you wish to delete.
- Click button in the bottom right corner of the popup.
- Click .
- Click 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.