POSThttps://www.prayerletters.com/api/v1/hooks

Subscribe to receive notifications about an event.

When a webhook subscription is created, we will immediately trigger an asynchronous ping event at the target URL, so that you can be sure the subscription is working. See the Ping a webhook target API call for details. Unlike normal notifications, this event will not be retried if there's an error.

Query Parameters

event

The name of the webhook event.

target

The URL that should be notified when the event occurs. The URL may contain query parameters, though a parameter will be overwritten if it has the same name as a query parameter provided by the webhook.

Response

201 Created

Response Body

hooks.hook.v1 Object

Example

{
   "event" : "...",
   "href" : "/api/v1/hooks/h-###-####",
   "id" : "h-###-####",
   "last_triggered" : "2024-04-25T15:58:31-04:00",
   "target" : "https://example.com/api/hooks?token=abc123"
}

Errors

400 hooks.invalid_target

The target must be an HTTP or HTTPS URL.

400 hooks.missing_event

The request didn't include an event.

403 hooks.missing_scope

You don't have the required scope (permission) to subscribe to the requested webhook. The error body will include the scope that you need.

400 hooks.missing_target

The request didn't include a target.

404 hooks.not_found

The webhook you requested doesn't exist.

403 hooks.unauthorized

You don't have access to the requested webhook for a reason other than scope. Contact us for more details.