Submit edited AI Article outline
curl --request POST \
--url https://app.surferseo.com/api/v2/workspaces/{workspace_id}/content_editors/{content_editor_id}/ai_articles/outline \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: text/html' \
--data '<h1>Title</h1><h2>Intro</h2>'import requests
url = "https://app.surferseo.com/api/v2/workspaces/{workspace_id}/content_editors/{content_editor_id}/ai_articles/outline"
payload = "<h1>Title</h1><h2>Intro</h2>"
headers = {
"API-KEY": "<api-key>",
"Content-Type": "text/html"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'API-KEY': '<api-key>', 'Content-Type': 'text/html'},
body: '<h1>Title</h1><h2>Intro</h2>'
};
fetch('https://app.surferseo.com/api/v2/workspaces/{workspace_id}/content_editors/{content_editor_id}/ai_articles/outline', 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.surferseo.com/api/v2/workspaces/{workspace_id}/content_editors/{content_editor_id}/ai_articles/outline",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "<h1>Title</h1><h2>Intro</h2>",
CURLOPT_HTTPHEADER => [
"API-KEY: <api-key>",
"Content-Type: text/html"
],
]);
$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.surferseo.com/api/v2/workspaces/{workspace_id}/content_editors/{content_editor_id}/ai_articles/outline"
payload := strings.NewReader("<h1>Title</h1><h2>Intro</h2>")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-KEY", "<api-key>")
req.Header.Add("Content-Type", "text/html")
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.surferseo.com/api/v2/workspaces/{workspace_id}/content_editors/{content_editor_id}/ai_articles/outline")
.header("API-KEY", "<api-key>")
.header("Content-Type", "text/html")
.body("<h1>Title</h1><h2>Intro</h2>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.surferseo.com/api/v2/workspaces/{workspace_id}/content_editors/{content_editor_id}/ai_articles/outline")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["API-KEY"] = '<api-key>'
request["Content-Type"] = 'text/html'
request.body = "<h1>Title</h1><h2>Intro</h2>"
response = http.request(request)
puts response.read_body{
"inserted_at": "2024-04-12T15:23:45Z",
"id": 123,
"manual_outline": true,
"state": "waiting_for_user_input",
"updated_at": "2024-06-01T09:17:33Z"
}{
"error": {
"details": [
{
"field": "keywords",
"reason": "required"
}
],
"reason": "validation_error"
}
}{
"error": {
"details": [],
"reason": "unauthorized"
}
}{
"error": {
"details": [],
"reason": "permission_denied"
}
}{
"error": {
"details": [],
"reason": "not_found"
}
}{
"error": {
"details": [
{
"allowed": [
"application/json"
],
"field": "accept",
"reason": "unsupported"
}
],
"message": "Accept must be one of: application/json",
"reason": "not_acceptable"
}
}{
"error": {
"details": [],
"message": "The request conflicts with the current resource state.",
"reason": "conflict"
}
}{
"error": {
"details": [],
"message": "Set Content-Type: application/json.",
"reason": "unsupported_media_type"
}
}{
"error": {
"details": [
{
"retry_after": 30
}
],
"reason": "rate_limit_exceeded"
}
}AI Articles
Submit edited AI Article outline
Submits a modified outline for the active AI article of the given Content Editor and resumes
article generation. Only available when the article is in waiting_for_user_input state.
Request body format negotiated via the Content-Type header:
| Content-Type Header | Body Format |
|---|---|
text/html (default) | HTML |
text/markdown | Markdown |
The request body is always treated as UTF-8, regardless of any charset parameter in the Content-Type header.
Rate limit: 10 requests/sec
POST
/
api
/
v2
/
workspaces
/
{workspace_id}
/
content_editors
/
{content_editor_id}
/
ai_articles
/
outline
Submit edited AI Article outline
curl --request POST \
--url https://app.surferseo.com/api/v2/workspaces/{workspace_id}/content_editors/{content_editor_id}/ai_articles/outline \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: text/html' \
--data '<h1>Title</h1><h2>Intro</h2>'import requests
url = "https://app.surferseo.com/api/v2/workspaces/{workspace_id}/content_editors/{content_editor_id}/ai_articles/outline"
payload = "<h1>Title</h1><h2>Intro</h2>"
headers = {
"API-KEY": "<api-key>",
"Content-Type": "text/html"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'API-KEY': '<api-key>', 'Content-Type': 'text/html'},
body: '<h1>Title</h1><h2>Intro</h2>'
};
fetch('https://app.surferseo.com/api/v2/workspaces/{workspace_id}/content_editors/{content_editor_id}/ai_articles/outline', 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.surferseo.com/api/v2/workspaces/{workspace_id}/content_editors/{content_editor_id}/ai_articles/outline",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "<h1>Title</h1><h2>Intro</h2>",
CURLOPT_HTTPHEADER => [
"API-KEY: <api-key>",
"Content-Type: text/html"
],
]);
$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.surferseo.com/api/v2/workspaces/{workspace_id}/content_editors/{content_editor_id}/ai_articles/outline"
payload := strings.NewReader("<h1>Title</h1><h2>Intro</h2>")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-KEY", "<api-key>")
req.Header.Add("Content-Type", "text/html")
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.surferseo.com/api/v2/workspaces/{workspace_id}/content_editors/{content_editor_id}/ai_articles/outline")
.header("API-KEY", "<api-key>")
.header("Content-Type", "text/html")
.body("<h1>Title</h1><h2>Intro</h2>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.surferseo.com/api/v2/workspaces/{workspace_id}/content_editors/{content_editor_id}/ai_articles/outline")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["API-KEY"] = '<api-key>'
request["Content-Type"] = 'text/html'
request.body = "<h1>Title</h1><h2>Intro</h2>"
response = http.request(request)
puts response.read_body{
"inserted_at": "2024-04-12T15:23:45Z",
"id": 123,
"manual_outline": true,
"state": "waiting_for_user_input",
"updated_at": "2024-06-01T09:17:33Z"
}{
"error": {
"details": [
{
"field": "keywords",
"reason": "required"
}
],
"reason": "validation_error"
}
}{
"error": {
"details": [],
"reason": "unauthorized"
}
}{
"error": {
"details": [],
"reason": "permission_denied"
}
}{
"error": {
"details": [],
"reason": "not_found"
}
}{
"error": {
"details": [
{
"allowed": [
"application/json"
],
"field": "accept",
"reason": "unsupported"
}
],
"message": "Accept must be one of: application/json",
"reason": "not_acceptable"
}
}{
"error": {
"details": [],
"message": "The request conflicts with the current resource state.",
"reason": "conflict"
}
}{
"error": {
"details": [],
"message": "Set Content-Type: application/json.",
"reason": "unsupported_media_type"
}
}{
"error": {
"details": [
{
"retry_after": 30
}
],
"reason": "rate_limit_exceeded"
}
}Authorizations
Path Parameters
Required range:
x >= 1Example:
123
Required range:
x >= 1Example:
123
Body
text/htmltext/markdown
Outline contents
Outline content. Representation depends on the Accept / Content-Type header.
Example:
"<h1>Title</h1><h2>Intro</h2>"
Response
Updated AI article
Example:
"2024-04-12T15:23:45Z"
Required range:
x >= 1Example:
123
Example:
true
Available options:
new, generating_outline, waiting_for_user_input, writing, completed, failed Example:
"waiting_for_user_input"
Example:
"2024-06-01T09:17:33Z"
Was this page helpful?