Webhook

Call a URL whenever you create, update or delete a post on Able.

Able provides a webhook that lets you call any URL whenever you create, update or delete a post on Able. This is a convenient way to use the Able editor as a writing interface for other services.

Setting up a webhook

Your webhook can be created and managed under the Posts settings page of your account. You can also find a shortcut to your webhook settings from the editor’s options sidebar (click ••• in the editor).

Settings

A webhook on Able has the following settings that can be configured.

Setting

Explanation

Enabled

This is a global flag to enable webhook calls whenever you save, update or delete posts. When disabled, no webhook calls will be made. Be aware that there are some additional settings lower down that can limit the webhook from being called. For example: Events and Conditions.

Production URL

This is the URL that you can use to point to your production webhook handler.

Test URL

You might want to make changes to your handler and test these while still keeping your Production URL set. So you can use the Test URL for this instead.

Test mode

When enabled, the webhook will call the Test URL instead of the Production URL.

Format

Choose whether you want the webhook call to contain your post content as HTML or Markdown.

Events

You can specify which events should fire the webhook call. For example when posts are created, updated and deleted

Conditions

These are extra conditions that can limit when the webhook makes a request. For example, if you only want to make requests when your post is set to published.

‌Request example

When a webhook is enabled and you create or update a post on Able then a POST request is made to the specified Production or Test URL whenever you create, update or delete a post.

The request will include Authorization: Bearer <token> in the header which you can use to verify that the request has come from Able. Here's an example of a typical request body:

‌{
"event": "post_update",
"metadata": {
"slug_id": "421c5845",
"created_at": "2020-05-16T19:40:40.771527Z",
"updated_at": "2020-05-16T19:41:19.721800Z",
"body_type": "markdown",
},
"content": {
"body": "Some **body** text goes here…",
"title": "Example post",
"topics": [
"Able"
],
"published": false
}
}

When deleting a post on Able, a DELETE request will be sent.

{
"event": "post_delete",
"metadata": {
"created_at": "2020-05-16T22:52:56.989000Z",
"deleted_at": "2020-05-18T06:54:26.534549Z",
"slug_id": "421c5845",
}
}

Requests will only be made if the appropriate event is enabled in your webhook settings. Additionally, if you have enabled the condition setting to only make requests when your post is set to published then requests will not be made if your post set to draft status.

Testing a webhook

If you want to get familiar with what a webhook request looks like then we’d recommend using a simple service like Webhook.site to quickly create an endpoint and point your Able webhook at it.

When the webhook url gets called from the editor your will see a toast notification pop out that shows the HTTP status code and response from the server. This can be handy for debugging integrations.

Using extensions

We also have a Push to GitHub extension which you can use to push webhook requests into a GitHub repository that you specify.