Preview post per platform
curl --request GET \
--url https://app.getkavio.app/api/posts/{post}/preview \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.getkavio.app/api/posts/{post}/preview"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.getkavio.app/api/posts/{post}/preview', 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.getkavio.app/api/posts/{post}/preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.getkavio.app/api/posts/{post}/preview"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.getkavio.app/api/posts/{post}/preview")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.getkavio.app/api/posts/{post}/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyPosts
Preview post per platform
Preview how a post will render on each enabled platform — applies platform-specific HTML sanitization and shows length stats against each platform’s max.
GET
/
posts
/
{post}
/
preview
Preview post per platform
curl --request GET \
--url https://app.getkavio.app/api/posts/{post}/preview \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.getkavio.app/api/posts/{post}/preview"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.getkavio.app/api/posts/{post}/preview', 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.getkavio.app/api/posts/{post}/preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.getkavio.app/api/posts/{post}/preview"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.getkavio.app/api/posts/{post}/preview")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.getkavio.app/api/posts/{post}/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyPath parameters
string
required
The UUID of the post.
Behaviour
- The post must belong to the caller’s current workspace; otherwise the response is
404. - Returns the original content alongside per-platform sanitized versions and length statistics.
original_contentis the plain text stored on the post (the editor saves plain text, not HTML).sanitized_contentis the platform-specific rendering of that text. For most platforms this is identical to the original. Exceptions:- LinkedIn / LinkedIn Page — Unicode bold/underline substitution if the source contained
<strong>/<b>/<u>markers (used by the AI generator). - Mastodon — a small allow-list of inline HTML is preserved (
p,strong,em,a,br,span).
- LinkedIn / LinkedIn Page — Unicode bold/underline substitution if the source contained
truncatedistrueonly when sanitization actually shortened the byte count (e.g. an HTML entity got decoded). It is not a hard-cap signal — over-length content is rejected at publish time, never silently truncated. To detect over-limit content, comparesanitized_lengthagainstmax_content_lengthyourself.
Response
{
"post_id": "9f1a2b3c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
"original_content": "Launch day!\n\nExcited to share what we built.",
"original_length": 44,
"platforms": [
{
"post_platform_id": "a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d",
"platform": "x",
"content_type": "x_post",
"sanitized_content": "Launch day!\n\nExcited to share what we built.",
"sanitized_length": 44,
"max_content_length": 280,
"truncated": false
},
{
"post_platform_id": "b2c3d4e5-f6a7-8b9c-0d1e-2f3a4b5c6d7e",
"platform": "linkedin",
"content_type": "linkedin_post",
"sanitized_content": "Launch day!\n\nExcited to share what we built.",
"sanitized_length": 44,
"max_content_length": 3000,
"truncated": false
}
]
}
curl https://app.getkavio.app/api/posts/9f1a2b3c-4d5e-6f7a-8b9c-0d1e2f3a4b5c/preview \
-H "Authorization: Bearer YOUR_API_KEY"

