curl --request PATCH \
--url https://api.example.com/v1/blog-posts/{post_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"slug": "<string>",
"excerpt": "<string>",
"content": "<string>",
"tags": [
"<string>"
],
"featured_image": "<string>",
"author": "<string>",
"category": "<string>",
"date": "<string>",
"publish_to_website": true,
"publish_to_portal": true,
"scheduled_at": "<string>"
}
'import requests
url = "https://api.example.com/v1/blog-posts/{post_id}"
payload = {
"title": "<string>",
"slug": "<string>",
"excerpt": "<string>",
"content": "<string>",
"tags": ["<string>"],
"featured_image": "<string>",
"author": "<string>",
"category": "<string>",
"date": "<string>",
"publish_to_website": True,
"publish_to_portal": True,
"scheduled_at": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
slug: '<string>',
excerpt: '<string>',
content: '<string>',
tags: ['<string>'],
featured_image: '<string>',
author: '<string>',
category: '<string>',
date: '<string>',
publish_to_website: true,
publish_to_portal: true,
scheduled_at: '<string>'
})
};
fetch('https://api.example.com/v1/blog-posts/{post_id}', 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://api.example.com/v1/blog-posts/{post_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'slug' => '<string>',
'excerpt' => '<string>',
'content' => '<string>',
'tags' => [
'<string>'
],
'featured_image' => '<string>',
'author' => '<string>',
'category' => '<string>',
'date' => '<string>',
'publish_to_website' => true,
'publish_to_portal' => true,
'scheduled_at' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://api.example.com/v1/blog-posts/{post_id}"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"slug\": \"<string>\",\n \"excerpt\": \"<string>\",\n \"content\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"featured_image\": \"<string>\",\n \"author\": \"<string>\",\n \"category\": \"<string>\",\n \"date\": \"<string>\",\n \"publish_to_website\": true,\n \"publish_to_portal\": true,\n \"scheduled_at\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.patch("https://api.example.com/v1/blog-posts/{post_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"slug\": \"<string>\",\n \"excerpt\": \"<string>\",\n \"content\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"featured_image\": \"<string>\",\n \"author\": \"<string>\",\n \"category\": \"<string>\",\n \"date\": \"<string>\",\n \"publish_to_website\": true,\n \"publish_to_portal\": true,\n \"scheduled_at\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/blog-posts/{post_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"slug\": \"<string>\",\n \"excerpt\": \"<string>\",\n \"content\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"featured_image\": \"<string>\",\n \"author\": \"<string>\",\n \"category\": \"<string>\",\n \"date\": \"<string>\",\n \"publish_to_website\": true,\n \"publish_to_portal\": true,\n \"scheduled_at\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"target": "<string>",
"brand": "<string>",
"organization_id": "<string>",
"title": "<string>",
"slug": "<string>",
"status": "<string>",
"excerpt": "<string>",
"content": "<string>",
"author": "<string>",
"tags": [],
"featured_image": "<string>",
"category": "<string>",
"date": "<string>",
"publish_to_website": true,
"publish_to_portal": true,
"is_pinned": true,
"published_at": "<string>",
"scheduled_at": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}Update Blog Post
Update fields and/or flip status to ‘published’. brand/target are immutable.
Re-publishing an already-published post is a no-op success (no duplicate rebuild
dispatch). Cross-scope id → 404. Requires blog:write.
curl --request PATCH \
--url https://api.example.com/v1/blog-posts/{post_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"slug": "<string>",
"excerpt": "<string>",
"content": "<string>",
"tags": [
"<string>"
],
"featured_image": "<string>",
"author": "<string>",
"category": "<string>",
"date": "<string>",
"publish_to_website": true,
"publish_to_portal": true,
"scheduled_at": "<string>"
}
'import requests
url = "https://api.example.com/v1/blog-posts/{post_id}"
payload = {
"title": "<string>",
"slug": "<string>",
"excerpt": "<string>",
"content": "<string>",
"tags": ["<string>"],
"featured_image": "<string>",
"author": "<string>",
"category": "<string>",
"date": "<string>",
"publish_to_website": True,
"publish_to_portal": True,
"scheduled_at": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
slug: '<string>',
excerpt: '<string>',
content: '<string>',
tags: ['<string>'],
featured_image: '<string>',
author: '<string>',
category: '<string>',
date: '<string>',
publish_to_website: true,
publish_to_portal: true,
scheduled_at: '<string>'
})
};
fetch('https://api.example.com/v1/blog-posts/{post_id}', 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://api.example.com/v1/blog-posts/{post_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'slug' => '<string>',
'excerpt' => '<string>',
'content' => '<string>',
'tags' => [
'<string>'
],
'featured_image' => '<string>',
'author' => '<string>',
'category' => '<string>',
'date' => '<string>',
'publish_to_website' => true,
'publish_to_portal' => true,
'scheduled_at' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://api.example.com/v1/blog-posts/{post_id}"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"slug\": \"<string>\",\n \"excerpt\": \"<string>\",\n \"content\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"featured_image\": \"<string>\",\n \"author\": \"<string>\",\n \"category\": \"<string>\",\n \"date\": \"<string>\",\n \"publish_to_website\": true,\n \"publish_to_portal\": true,\n \"scheduled_at\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.patch("https://api.example.com/v1/blog-posts/{post_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"slug\": \"<string>\",\n \"excerpt\": \"<string>\",\n \"content\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"featured_image\": \"<string>\",\n \"author\": \"<string>\",\n \"category\": \"<string>\",\n \"date\": \"<string>\",\n \"publish_to_website\": true,\n \"publish_to_portal\": true,\n \"scheduled_at\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/blog-posts/{post_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"slug\": \"<string>\",\n \"excerpt\": \"<string>\",\n \"content\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"featured_image\": \"<string>\",\n \"author\": \"<string>\",\n \"category\": \"<string>\",\n \"date\": \"<string>\",\n \"publish_to_website\": true,\n \"publish_to_portal\": true,\n \"scheduled_at\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"target": "<string>",
"brand": "<string>",
"organization_id": "<string>",
"title": "<string>",
"slug": "<string>",
"status": "<string>",
"excerpt": "<string>",
"content": "<string>",
"author": "<string>",
"tags": [],
"featured_image": "<string>",
"category": "<string>",
"date": "<string>",
"publish_to_website": true,
"publish_to_portal": true,
"is_pinned": true,
"published_at": "<string>",
"scheduled_at": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}Authorizations
Org API key as Token token=ei_live_...
Headers
Path Parameters
Body
PATCH /v1/blog-posts/{id} → blog_posts. Partial update; only these fields are
writable. Flip status to 'published' to publish (idempotent — re-publishing is a
no-op). brand/target/organization_id are immutable after creation (not accepted);
updated_at is trigger-maintained.
1 - 300200^[a-z0-9]+(?:-[a-z0-9]+)*$2000200000502000200200draft, published ISO 8601 datetime. Set to schedule deferred publishing; set to null to cancel a scheduled publish.
Response
Successful Response
A blog post row returned by /v1/blog-posts. target is derived from
organization_id (NULL → 'platform', else 'org').
Was this page helpful?