Auto-Optimize Content Editor query
curl --request POST \
--url https://app.surferseo.com/api/v1/content_editors/{id}/auto_optimize \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"generate_new_sections": false
}
'import requests
url = "https://app.surferseo.com/api/v1/content_editors/{id}/auto_optimize"
payload = { "generate_new_sections": False }
headers = {
"API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({generate_new_sections: false})
};
fetch('https://app.surferseo.com/api/v1/content_editors/{id}/auto_optimize', 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/v1/content_editors/{id}/auto_optimize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'generate_new_sections' => false
]),
CURLOPT_HTTPHEADER => [
"API-KEY: <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://app.surferseo.com/api/v1/content_editors/{id}/auto_optimize"
payload := strings.NewReader("{\n \"generate_new_sections\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-KEY", "<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.post("https://app.surferseo.com/api/v1/content_editors/{id}/auto_optimize")
.header("API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"generate_new_sections\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.surferseo.com/api/v1/content_editors/{id}/auto_optimize")
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"] = 'application/json'
request.body = "{\n \"generate_new_sections\": false\n}"
response = http.request(request)
puts response.read_body{
"job_id": 123
}Content Editors
Auto-Optimize Content Editor query
deprecated
Deprecated. Use POST /api/v2/workspaces//content_editors//auto_optimize instead.
Runs Auto-Optimize on the Content Editor query. All changes will be written directly to the Content Editor.
To check for Auto-Optimize run status changes, use webhooks. Refer to the Webhooks section for details on how to set it up.
You’ll receive the following payload in the webhook request body:
-
id- notification id (integer) -
type- one of:"content_editor.auto_optimize.completed""content_editor.auto_optimize.failed""content_editor.auto_optimize.cancelled"
-
payload:job_id- reference number of the Auto-Optimize run (integer)draft_id- unique identifier of the Content Editor (integer)result(only when type is"content_editor.auto_optimize.completed") -"optimized"if article has been optimized,"nothing_to_optimize"otherwise
-
timestamp- ISO8601 extended UTC timestamp (string)
Rate limit: 10 requests/sec
POST
/
api
/
v1
/
content_editors
/
{id}
/
auto_optimize
Auto-Optimize Content Editor query
curl --request POST \
--url https://app.surferseo.com/api/v1/content_editors/{id}/auto_optimize \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"generate_new_sections": false
}
'import requests
url = "https://app.surferseo.com/api/v1/content_editors/{id}/auto_optimize"
payload = { "generate_new_sections": False }
headers = {
"API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({generate_new_sections: false})
};
fetch('https://app.surferseo.com/api/v1/content_editors/{id}/auto_optimize', 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/v1/content_editors/{id}/auto_optimize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'generate_new_sections' => false
]),
CURLOPT_HTTPHEADER => [
"API-KEY: <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://app.surferseo.com/api/v1/content_editors/{id}/auto_optimize"
payload := strings.NewReader("{\n \"generate_new_sections\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-KEY", "<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.post("https://app.surferseo.com/api/v1/content_editors/{id}/auto_optimize")
.header("API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"generate_new_sections\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.surferseo.com/api/v1/content_editors/{id}/auto_optimize")
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"] = 'application/json'
request.body = "{\n \"generate_new_sections\": false\n}"
response = http.request(request)
puts response.read_body{
"job_id": 123
}Authorizations
Path Parameters
The unique identifier of the entity
Required range:
x >= 1Example:
1
Body
application/json
When enabled, Auto-Optimize will be able to generate new sections based on SERP topical gap analysis, if applicable.
Response
OK
Reference number of the Auto-Optimize run
Was this page helpful?