Create webhook
curl --request POST \
--url https://app.tryordinal.com/api/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "CRM Sync",
"url": "https://example.com/webhooks/ordinal",
"description": "Sync published posts to our CRM",
"topics": [
"post.published",
"post.archived"
]
}
'import requests
url = "https://app.tryordinal.com/api/v1/webhooks"
payload = {
"name": "CRM Sync",
"url": "https://example.com/webhooks/ordinal",
"description": "Sync published posts to our CRM",
"topics": ["post.published", "post.archived"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'CRM Sync',
url: 'https://example.com/webhooks/ordinal',
description: 'Sync published posts to our CRM',
topics: ['post.published', 'post.archived']
})
};
fetch('https://app.tryordinal.com/api/v1/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.tryordinal.com/api/v1/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'CRM Sync',
'url' => 'https://example.com/webhooks/ordinal',
'description' => 'Sync published posts to our CRM',
'topics' => [
'post.published',
'post.archived'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.tryordinal.com/api/v1/webhooks"
payload := strings.NewReader("{\n \"name\": \"CRM Sync\",\n \"url\": \"https://example.com/webhooks/ordinal\",\n \"description\": \"Sync published posts to our CRM\",\n \"topics\": [\n \"post.published\",\n \"post.archived\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.tryordinal.com/api/v1/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"CRM Sync\",\n \"url\": \"https://example.com/webhooks/ordinal\",\n \"description\": \"Sync published posts to our CRM\",\n \"topics\": [\n \"post.published\",\n \"post.archived\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.tryordinal.com/api/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"CRM Sync\",\n \"url\": \"https://example.com/webhooks/ordinal\",\n \"description\": \"Sync published posts to our CRM\",\n \"topics\": [\n \"post.published\",\n \"post.archived\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "550e8400-e29b-41d4-a716-446655440900",
"name": "CRM Sync",
"url": "https://example.com/webhooks/ordinal",
"topics": [
"post.published",
"post.archived"
],
"createdAt": "2026-01-15T10:00:00.000Z"
}{
"code": "BAD_REQUEST",
"message": "Bad Request",
"data": {
"errors": {
"publishAt": [
"Invalid date format"
],
"status": [
"Invalid enum value"
]
}
}
}{
"code": "UNAUTHORIZED",
"message": "Invalid or unauthorized API key"
}Webhooks
Create webhook
Create a webhook for the current workspace. The webhook will receive events for the specified topics.
POST
/
webhooks
Create webhook
curl --request POST \
--url https://app.tryordinal.com/api/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "CRM Sync",
"url": "https://example.com/webhooks/ordinal",
"description": "Sync published posts to our CRM",
"topics": [
"post.published",
"post.archived"
]
}
'import requests
url = "https://app.tryordinal.com/api/v1/webhooks"
payload = {
"name": "CRM Sync",
"url": "https://example.com/webhooks/ordinal",
"description": "Sync published posts to our CRM",
"topics": ["post.published", "post.archived"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'CRM Sync',
url: 'https://example.com/webhooks/ordinal',
description: 'Sync published posts to our CRM',
topics: ['post.published', 'post.archived']
})
};
fetch('https://app.tryordinal.com/api/v1/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.tryordinal.com/api/v1/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'CRM Sync',
'url' => 'https://example.com/webhooks/ordinal',
'description' => 'Sync published posts to our CRM',
'topics' => [
'post.published',
'post.archived'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.tryordinal.com/api/v1/webhooks"
payload := strings.NewReader("{\n \"name\": \"CRM Sync\",\n \"url\": \"https://example.com/webhooks/ordinal\",\n \"description\": \"Sync published posts to our CRM\",\n \"topics\": [\n \"post.published\",\n \"post.archived\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.tryordinal.com/api/v1/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"CRM Sync\",\n \"url\": \"https://example.com/webhooks/ordinal\",\n \"description\": \"Sync published posts to our CRM\",\n \"topics\": [\n \"post.published\",\n \"post.archived\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.tryordinal.com/api/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"CRM Sync\",\n \"url\": \"https://example.com/webhooks/ordinal\",\n \"description\": \"Sync published posts to our CRM\",\n \"topics\": [\n \"post.published\",\n \"post.archived\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "550e8400-e29b-41d4-a716-446655440900",
"name": "CRM Sync",
"url": "https://example.com/webhooks/ordinal",
"topics": [
"post.published",
"post.archived"
],
"createdAt": "2026-01-15T10:00:00.000Z"
}{
"code": "BAD_REQUEST",
"message": "Bad Request",
"data": {
"errors": {
"publishAt": [
"Invalid date format"
],
"status": [
"Invalid enum value"
]
}
}
}{
"code": "UNAUTHORIZED",
"message": "Invalid or unauthorized API key"
}Authorizations
API key authentication. Generate an API key from your workspace settings.
Body
application/json
The name of the webhook
The URL that will receive webhook events
The event types this webhook should listen to
Minimum array length:
1Available options:
social_profile.connected, social_profile.disconnected, social_profile.reconnect_needed, post.created, post.scheduled, post.rescheduled, post.unscheduled, post.published, post.publish_failed, post.archived, post.permanently_deleted, post.content.edited, post.comment.created, post.inline_comment.created, post.approval.requested, post.approval.approved, campaign.approval.requested, campaign.approval.approved, invite.created, invite.accepted An optional description for the webhook
Optional custom headers to include in webhook requests
Show child attributes
Show child attributes
Was this page helpful?
⌘I