Create a source
Add a source and get its receiving URL, with a destination if you like.
Adds a source and returns it with its receiving URL. Give that URL to the sender, such as Stripe, in place of your app's URL.
With forward_url, it also adds a destination at that URL and sends the source's
webhooks there. Without it, the source keeps its webhooks until you connect a
destination with Connect a destination.
Only admins can create sources. The change shows up in the audit log under the token's name.
A connected app needs the write scope: full access.
AuthorizationBearer <unm_ followed by 40 letters and digits>A token from the CLI page in Unmissed. Revoke it there to stop it working.
application/json- body
name*stringWho sends these webhooks. Each source needs its own name.
length <= 255forward_url?|Also adds a destination at this URL, so the source's webhooks go to your app.
length <= 2048signature_scheme?|nullsigning_secret?|The sender's signing secret. Never returned. Leave it out to add it later.
length <= 1000signature_header?|Required for hmac and supabase.
^[A-Za-z0-9-]+$length <= 100dedupe_by?|"content""id"nulldedupe_on?|"body""header"nulldedupe_field?|Required when dedupe_by is id.
length <= 200retention_days?|How many days to keep webhooks. Left out or null, forever.
7 <= value <= 3650The new source.
application/json- response
The service that sends webhooks, like Stripe, with where it sends them.
id*integerint64name*stringreceiving_url*|Where the sender posts webhooks. null for viewers, since anyone with it can send webhooks on to your app.
signature_scheme*|nullhas_signing_secret*booleanWhether a signing secret is saved. The secret itself is never returned.
signing_secret_unreadable*booleanThe secret was saved with another server key, so every webhook fails its check until you send it again.
signatures_unchecked*booleanA signature check is picked but has no secret yet, so every webhook gets through unchecked.
signature_header*|The header the signature or secret arrives in, for hmac and supabase.
dedupe_by*|How copies are dropped. content for the same body, id for the same event ID, null for off.
"content""id"nulldedupe_on*|Where the event ID is, when dedupe_by is id.
"body""header"nulldedupe_field*|The body field or header holding the event ID, like id.
retention_days*|How many days webhooks are kept, or null for forever.
destinations*array<>Where it sends webhooks, each with this source's filter.
created_at*stringdate-timeupdated_at*stringdate-timecurl -X POST 'http://localhost:8080/api/v1/sources' \
-H 'Authorization: Bearer ' \
-H 'Content-Type: application/json' \
-d '{
"name": "Stripe",
"forward_url": "https://app.example.com/webhooks/stripe",
"signature_scheme": "stripe",
"signing_secret": "whsec_...",
"retention_days": 30
}'{
"id": 0,
"name": "string",
"receiving_url": "string",
"signature_scheme": "stripe",
"has_signing_secret": true,
"signing_secret_unreadable": true,
"signatures_unchecked": true,
"signature_header": "string",
"dedupe_by": "content",
"dedupe_on": "body",
"dedupe_field": "string",
"retention_days": 0,
"destinations": [
{
"id": 0,
"url": "string",
"filter_on": "body",
"filter_field": "string",
"filter_values": "string"
}
],
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}