Update an article
curl --request PATCH \
--url https://api.rankspot.ai/v1/articles/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "How to Start a Blog in 2024",
"description": "A comprehensive guide.",
"slug": "how-to-start-a-blog-2024",
"coverImageUrl": "https://cdn.example.com/cover.jpg",
"categoryId": "clx..."
}
'import requests
url = "https://api.rankspot.ai/v1/articles/{id}"
payload = {
"title": "How to Start a Blog in 2024",
"description": "A comprehensive guide.",
"slug": "how-to-start-a-blog-2024",
"coverImageUrl": "https://cdn.example.com/cover.jpg",
"categoryId": "clx..."
}
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: 'How to Start a Blog in 2024',
description: 'A comprehensive guide.',
slug: 'how-to-start-a-blog-2024',
coverImageUrl: 'https://cdn.example.com/cover.jpg',
categoryId: 'clx...'
})
};
fetch('https://api.rankspot.ai/v1/articles/{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.rankspot.ai/v1/articles/{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' => 'How to Start a Blog in 2024',
'description' => 'A comprehensive guide.',
'slug' => 'how-to-start-a-blog-2024',
'coverImageUrl' => 'https://cdn.example.com/cover.jpg',
'categoryId' => 'clx...'
]),
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.rankspot.ai/v1/articles/{id}"
payload := strings.NewReader("{\n \"title\": \"How to Start a Blog in 2024\",\n \"description\": \"A comprehensive guide.\",\n \"slug\": \"how-to-start-a-blog-2024\",\n \"coverImageUrl\": \"https://cdn.example.com/cover.jpg\",\n \"categoryId\": \"clx...\"\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.rankspot.ai/v1/articles/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"How to Start a Blog in 2024\",\n \"description\": \"A comprehensive guide.\",\n \"slug\": \"how-to-start-a-blog-2024\",\n \"coverImageUrl\": \"https://cdn.example.com/cover.jpg\",\n \"categoryId\": \"clx...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rankspot.ai/v1/articles/{id}")
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\": \"How to Start a Blog in 2024\",\n \"description\": \"A comprehensive guide.\",\n \"slug\": \"how-to-start-a-blog-2024\",\n \"coverImageUrl\": \"https://cdn.example.com/cover.jpg\",\n \"categoryId\": \"clx...\"\n}"
response = http.request(request)
puts response.read_body{
"id": "clx...",
"title": "How to Start a Blog",
"status": "draft",
"slug": "how-to-start-a-blog",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "A comprehensive guide.",
"contentHtml": "<h1>How to Start a Blog</h1>...",
"coverImageUrl": "https://cdn.example.com/cover.jpg",
"categoryId": "clx..."
}Articles
Update an article
Update metadata such as title, description, slug, coverImageUrl, or categoryId. The slug must be unique within your workspace. Article content and status are managed by RankSpot and cannot be changed via the API.
PATCH
https://api.rankspot.ai
/
v1
/
articles
/
{id}
Update an article
curl --request PATCH \
--url https://api.rankspot.ai/v1/articles/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "How to Start a Blog in 2024",
"description": "A comprehensive guide.",
"slug": "how-to-start-a-blog-2024",
"coverImageUrl": "https://cdn.example.com/cover.jpg",
"categoryId": "clx..."
}
'import requests
url = "https://api.rankspot.ai/v1/articles/{id}"
payload = {
"title": "How to Start a Blog in 2024",
"description": "A comprehensive guide.",
"slug": "how-to-start-a-blog-2024",
"coverImageUrl": "https://cdn.example.com/cover.jpg",
"categoryId": "clx..."
}
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: 'How to Start a Blog in 2024',
description: 'A comprehensive guide.',
slug: 'how-to-start-a-blog-2024',
coverImageUrl: 'https://cdn.example.com/cover.jpg',
categoryId: 'clx...'
})
};
fetch('https://api.rankspot.ai/v1/articles/{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.rankspot.ai/v1/articles/{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' => 'How to Start a Blog in 2024',
'description' => 'A comprehensive guide.',
'slug' => 'how-to-start-a-blog-2024',
'coverImageUrl' => 'https://cdn.example.com/cover.jpg',
'categoryId' => 'clx...'
]),
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.rankspot.ai/v1/articles/{id}"
payload := strings.NewReader("{\n \"title\": \"How to Start a Blog in 2024\",\n \"description\": \"A comprehensive guide.\",\n \"slug\": \"how-to-start-a-blog-2024\",\n \"coverImageUrl\": \"https://cdn.example.com/cover.jpg\",\n \"categoryId\": \"clx...\"\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.rankspot.ai/v1/articles/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"How to Start a Blog in 2024\",\n \"description\": \"A comprehensive guide.\",\n \"slug\": \"how-to-start-a-blog-2024\",\n \"coverImageUrl\": \"https://cdn.example.com/cover.jpg\",\n \"categoryId\": \"clx...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rankspot.ai/v1/articles/{id}")
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\": \"How to Start a Blog in 2024\",\n \"description\": \"A comprehensive guide.\",\n \"slug\": \"how-to-start-a-blog-2024\",\n \"coverImageUrl\": \"https://cdn.example.com/cover.jpg\",\n \"categoryId\": \"clx...\"\n}"
response = http.request(request)
puts response.read_body{
"id": "clx...",
"title": "How to Start a Blog",
"status": "draft",
"slug": "how-to-start-a-blog",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "A comprehensive guide.",
"contentHtml": "<h1>How to Start a Blog</h1>...",
"coverImageUrl": "https://cdn.example.com/cover.jpg",
"categoryId": "clx..."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Response
Example:
"clx..."
Example:
"How to Start a Blog"
Available options:
draft, generating, generated Example:
"draft"
Example:
"how-to-start-a-blog"
Example:
"A comprehensive guide."
Only returned by GE../articles/:slug
Example:
"<h1>How to Start a Blog</h1>..."
Example:
"https://cdn.example.com/cover.jpg"
Example:
"clx..."
⌘I
