Skip to main content

Custom API

A Custom API channel sends each post to an HTTPS endpoint you own, such as a custom website, your own CMS or an internal system. You decide which fields go into the JSON body and where each value comes from.

Before you start​

  • The endpoint uses https://, port 443, and a public internet address.
  • The endpoint accepts JSON and returns a success code (2xx) once it has received the post.
  • The endpoint doesn’t redirect to another address. The app doesn’t follow redirects.
  • If the endpoint needs a key, have the header name and key value ready.

Connect​

  1. Open the Channels page and click Connect Custom API.
  2. Enter a Channel name. It appears in the channel list and when choosing channels for a post.
  3. Under Endpoint, pick the method POST, PUT or PATCH, then paste the endpoint address.
  4. Under Auth header, enter the header name, for example Authorization or X-Api-Key, and the key value. Leave it blank if the endpoint needs no key.
  5. Under Body JSON, add the fields to send. See the section below.
  6. Under Read response, enter the paths to the post id and link in the returned JSON, if any.
  7. Click Connect.
Custom API connect form with Channel name, Endpoint, Auth header and Read response
Set the endpoint and auth key for a Custom API channel
note

The app doesn’t call your endpoint when you click Connect, because a test call would create real data on your side. Publish a test post to check it.

Auth header​

  • For Authorization, if you paste just a token, the app adds Bearer in front. Values that already include Bearer, Basic… are kept as is.
  • The key is encrypted when saved and is never shown on the page again.
  • In Edit settings, leave the value blank to keep the current key. Tick Remove the current key (send without the auth header) to drop it.
  • If you move the endpoint to another server, you must enter the key again or choose to remove it.

Build the JSON body​

Each row in Body JSON is one field. Each field has:

  • key: the field name. Keys with dots, such as data.title, create nested objects.
  • Value source: where the value comes from.
  • Value type and Value: only used when the source is Fixed value. The type is Text, Number or True/false.

Click Add field to add a row. You need at least 1 field and can have up to 50. Click Body preview (sample data) to see the JSON that will be sent.

Body JSON field list with key, Value source and the Add field button
Choose fields and value sources for the JSON body

Value sources:

Value sourceValue sent
Post contentThe post’s text.
HTML contentThe Article (WordPress, Custom API) panel as HTML. If the panel is empty, it is built from the post text.
Markdown contentSame as above, as Markdown.
TitleThe channel’s Title field in the Customize per channel step.
Media link listAn array of public links to every image and video in the post.
First media linkThe link to the first image or video.
Publish time (ISO 8601)The send time, in the workspace time zone.
Post IDA unique ID for this publish to this channel.
Channel nameThe Custom API channel’s name.
Fixed valueA value you type yourself.

Example of a built body:

{
"data": {
"title": "Our new branch is open",
"content": "<p>Come and visit us…</p>",
"images": ["https://…/photo-1.jpg"]
},
"source": "kdt-sharing"
}

Duplicate protection​

Every request carries an Idempotency-Key header set to the Post ID. If the app sends the same post again, for example after a lost connection, your system can use this header to skip the duplicate.

Read response​

  • The first field is the path to the post id in the returned JSON, for example data.id. If left blank, the app uses the Post ID as the id.
  • The second field is the path to the post link, for example data.url. When a link is found, the app shows it on the published post.

Posting limits​

  • Media is optional. Up to 10 files, images and videos can be mixed.
  • Title up to 255 characters.
  • No first comment.
  • The app waits up to 30 seconds for the endpoint to respond. Responses larger than 10 MB are dropped.
  • The app doesn’t read Custom API post metrics.

Common errors​

MessageWhat to do
The endpoint rejected the auth keyClick Edit settings on the Channels page and enter the key again.
The endpoint returned a redirectChange the endpoint to the final address.
The endpoint rejected the requestRead the endpoint’s error included in the message, then fix the body or the receiving system.
The endpoint is rate limiting. Will retry later.Nothing to do. The app retries automatically.
No response from the endpoint (connection lost or timed out). Check the receiving system before publishing again.Check whether your system received the post before publishing again, to avoid duplicates.
The endpoint had a server errorCheck the receiving system, then publish again.
Changing the receiving server requires entering the auth header value again, or choosing to remove the key.Enter the key again when saving the settings.

Next steps​