curl --request PATCH \
--url https://api.usenotra.com/v1/posts/{postId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Ship notes for week 11",
"slug": "ship-notes-week-11",
"markdown": "# Ship notes\n\nWe shipped a faster editor.",
"status": "published"
}
'import requests
url = "https://api.usenotra.com/v1/posts/{postId}"
payload = {
"title": "Ship notes for week 11",
"slug": "ship-notes-week-11",
"markdown": "# Ship notes
We shipped a faster editor.",
"status": "published"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Ship notes for week 11',
slug: 'ship-notes-week-11',
markdown: '# Ship notes\n\nWe shipped a faster editor.',
status: 'published'
})
};
fetch('https://api.usenotra.com/v1/posts/{postId}', 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.usenotra.com/v1/posts/{postId}",
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' => 'Ship notes for week 11',
'slug' => 'ship-notes-week-11',
'markdown' => '# Ship notes
We shipped a faster editor.',
'status' => 'published'
]),
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://api.usenotra.com/v1/posts/{postId}"
payload := strings.NewReader("{\n \"title\": \"Ship notes for week 11\",\n \"slug\": \"ship-notes-week-11\",\n \"markdown\": \"# Ship notes\\n\\nWe shipped a faster editor.\",\n \"status\": \"published\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.usenotra.com/v1/posts/{postId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Ship notes for week 11\",\n \"slug\": \"ship-notes-week-11\",\n \"markdown\": \"# Ship notes\\n\\nWe shipped a faster editor.\",\n \"status\": \"published\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usenotra.com/v1/posts/{postId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Ship notes for week 11\",\n \"slug\": \"ship-notes-week-11\",\n \"markdown\": \"# Ship notes\\n\\nWe shipped a faster editor.\",\n \"status\": \"published\"\n}"
response = http.request(request)
puts response.read_body{
"organization": {
"id": "<string>",
"slug": "<string>",
"name": "<string>",
"logo": "<string>"
},
"post": {
"id": "<string>",
"title": "<string>",
"slug": "<string>",
"content": "<string>",
"htmlUrl": "<string>",
"markdown": "<string>",
"rawHtml": "<string>",
"recommendations": "<string>",
"contentType": "changelog",
"status": "draft",
"createdAt": "<string>",
"updatedAt": "<string>",
"sourceMetadata": "<unknown>"
}
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"limit": 2,
"remaining": 1,
"reset": 123
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}Update a single post
Updates any combination of title, slug, markdown, and status. Sending markdown re-renders the stored HTML, and when title is omitted it is taken from the first heading in the markdown, keeping the existing title when the markdown has no heading. Slugs are only accepted for blog posts and changelogs. Title, slug, or markdown updates also sync an existing linked GitHub pull request; no new pull request is created. GitHub sync errors occur after saving the post: 429 includes Retry-After, 502 indicates a sync error, and 504 indicates an unknown sync outcome. Check the PR before retrying an unconfirmed sync.
curl --request PATCH \
--url https://api.usenotra.com/v1/posts/{postId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Ship notes for week 11",
"slug": "ship-notes-week-11",
"markdown": "# Ship notes\n\nWe shipped a faster editor.",
"status": "published"
}
'import requests
url = "https://api.usenotra.com/v1/posts/{postId}"
payload = {
"title": "Ship notes for week 11",
"slug": "ship-notes-week-11",
"markdown": "# Ship notes
We shipped a faster editor.",
"status": "published"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Ship notes for week 11',
slug: 'ship-notes-week-11',
markdown: '# Ship notes\n\nWe shipped a faster editor.',
status: 'published'
})
};
fetch('https://api.usenotra.com/v1/posts/{postId}', 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.usenotra.com/v1/posts/{postId}",
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' => 'Ship notes for week 11',
'slug' => 'ship-notes-week-11',
'markdown' => '# Ship notes
We shipped a faster editor.',
'status' => 'published'
]),
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://api.usenotra.com/v1/posts/{postId}"
payload := strings.NewReader("{\n \"title\": \"Ship notes for week 11\",\n \"slug\": \"ship-notes-week-11\",\n \"markdown\": \"# Ship notes\\n\\nWe shipped a faster editor.\",\n \"status\": \"published\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.usenotra.com/v1/posts/{postId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Ship notes for week 11\",\n \"slug\": \"ship-notes-week-11\",\n \"markdown\": \"# Ship notes\\n\\nWe shipped a faster editor.\",\n \"status\": \"published\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usenotra.com/v1/posts/{postId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Ship notes for week 11\",\n \"slug\": \"ship-notes-week-11\",\n \"markdown\": \"# Ship notes\\n\\nWe shipped a faster editor.\",\n \"status\": \"published\"\n}"
response = http.request(request)
puts response.read_body{
"organization": {
"id": "<string>",
"slug": "<string>",
"name": "<string>",
"logo": "<string>"
},
"post": {
"id": "<string>",
"title": "<string>",
"slug": "<string>",
"content": "<string>",
"htmlUrl": "<string>",
"markdown": "<string>",
"rawHtml": "<string>",
"recommendations": "<string>",
"contentType": "changelog",
"status": "draft",
"createdAt": "<string>",
"updatedAt": "<string>",
"sourceMetadata": "<unknown>"
}
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"limit": 2,
"remaining": 1,
"reset": 123
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}Authorizations
Send your API key in the Authorization header as Bearer API_KEY.
Path Parameters
1^[A-Za-z0-9_-]{1,100}$"post_123"
Body
1 - 120"Ship notes for week 11"
1 - 160^[a-z0-9]+(?:-[a-z0-9]+)*$"ship-notes-week-11"
1 - 100000"# Ship notes\n\nWe shipped a faster editor."
draft, published "published"
Was this page helpful?