curl --request PATCH \
--url https://app.surferseo.com/api/v2/workspaces/{workspace_id}/content_editors/{content_editor_id}/seo_guidelines/structure \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"guidelines": [
{
"factor": "img_count",
"value_override": 5
},
{
"factor": "character_count",
"value_override": null
}
],
"guidelines_baseline": "word_count",
"word_count": 1800
}
'import requests
url = "https://app.surferseo.com/api/v2/workspaces/{workspace_id}/content_editors/{content_editor_id}/seo_guidelines/structure"
payload = {
"guidelines": [
{
"factor": "img_count",
"value_override": 5
},
{
"factor": "character_count",
"value_override": None
}
],
"guidelines_baseline": "word_count",
"word_count": 1800
}
headers = {
"API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
guidelines: [
{factor: 'img_count', value_override: 5},
{factor: 'character_count', value_override: null}
],
guidelines_baseline: 'word_count',
word_count: 1800
})
};
fetch('https://app.surferseo.com/api/v2/workspaces/{workspace_id}/content_editors/{content_editor_id}/seo_guidelines/structure', 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}/seo_guidelines/structure",
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([
'guidelines' => [
[
'factor' => 'img_count',
'value_override' => 5
],
[
'factor' => 'character_count',
'value_override' => null
]
],
'guidelines_baseline' => 'word_count',
'word_count' => 1800
]),
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/v2/workspaces/{workspace_id}/content_editors/{content_editor_id}/seo_guidelines/structure"
payload := strings.NewReader("{\n \"guidelines\": [\n {\n \"factor\": \"img_count\",\n \"value_override\": 5\n },\n {\n \"factor\": \"character_count\",\n \"value_override\": null\n }\n ],\n \"guidelines_baseline\": \"word_count\",\n \"word_count\": 1800\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://app.surferseo.com/api/v2/workspaces/{workspace_id}/content_editors/{content_editor_id}/seo_guidelines/structure")
.header("API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"guidelines\": [\n {\n \"factor\": \"img_count\",\n \"value_override\": 5\n },\n {\n \"factor\": \"character_count\",\n \"value_override\": null\n }\n ],\n \"guidelines_baseline\": \"word_count\",\n \"word_count\": 1800\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.surferseo.com/api/v2/workspaces/{workspace_id}/content_editors/{content_editor_id}/seo_guidelines/structure")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"guidelines\": [\n {\n \"factor\": \"img_count\",\n \"value_override\": 5\n },\n {\n \"factor\": \"character_count\",\n \"value_override\": null\n }\n ],\n \"guidelines_baseline\": \"word_count\",\n \"word_count\": 1800\n}"
response = http.request(request)
puts response.read_body{
"guidelines_baseline": "word_count",
"structural_guidelines": [
{
"factor": "character_count",
"target": {
"avg": 6.28,
"max": 11.21,
"min": 1.35,
"value_override": null
}
},
{
"factor": "headings_count",
"target": {
"avg": 0.007,
"max": 0.014,
"min": 0.005,
"value_override": null
}
},
{
"factor": "paragraph_count",
"target": {
"avg": 0.02,
"max": 0.035,
"min": 0,
"value_override": null
}
},
{
"factor": "img_count",
"target": {
"avg": 0.003,
"max": 0.01,
"min": 0,
"value_override": null
}
}
],
"word_count": 1800
}{
"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": [],
"message": "The request was understood but could not be processed.",
"reason": "unprocessable_entity"
}
}{
"error": {
"details": [
{
"retry_after": 30
}
],
"reason": "rate_limit_exceeded"
}
}Update SEO Guidelines structure
Partially updates the user-controllable parts of the structural guidelines. Competitor-derived
avg, max, and min are never writable — only value_override and guidelines_baseline
are.
Top-level word_count sets (or, with null, clears) the user override on the resolved word
count. guidelines_baseline selects which of word_count or character_count is the scoring
anchor.
Each entry under guidelines sets (or, with null, clears) the value_override on a per-factor
target: character_count, headings_count, paragraph_count, or img_count. Factors omitted
from the list are left untouched.
At least one of guidelines_baseline, word_count, or guidelines must be present, otherwise
returns 422 empty_update. Requires the editor to be in completed state.
Rate limit: 10 requests/sec
curl --request PATCH \
--url https://app.surferseo.com/api/v2/workspaces/{workspace_id}/content_editors/{content_editor_id}/seo_guidelines/structure \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"guidelines": [
{
"factor": "img_count",
"value_override": 5
},
{
"factor": "character_count",
"value_override": null
}
],
"guidelines_baseline": "word_count",
"word_count": 1800
}
'import requests
url = "https://app.surferseo.com/api/v2/workspaces/{workspace_id}/content_editors/{content_editor_id}/seo_guidelines/structure"
payload = {
"guidelines": [
{
"factor": "img_count",
"value_override": 5
},
{
"factor": "character_count",
"value_override": None
}
],
"guidelines_baseline": "word_count",
"word_count": 1800
}
headers = {
"API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
guidelines: [
{factor: 'img_count', value_override: 5},
{factor: 'character_count', value_override: null}
],
guidelines_baseline: 'word_count',
word_count: 1800
})
};
fetch('https://app.surferseo.com/api/v2/workspaces/{workspace_id}/content_editors/{content_editor_id}/seo_guidelines/structure', 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}/seo_guidelines/structure",
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([
'guidelines' => [
[
'factor' => 'img_count',
'value_override' => 5
],
[
'factor' => 'character_count',
'value_override' => null
]
],
'guidelines_baseline' => 'word_count',
'word_count' => 1800
]),
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/v2/workspaces/{workspace_id}/content_editors/{content_editor_id}/seo_guidelines/structure"
payload := strings.NewReader("{\n \"guidelines\": [\n {\n \"factor\": \"img_count\",\n \"value_override\": 5\n },\n {\n \"factor\": \"character_count\",\n \"value_override\": null\n }\n ],\n \"guidelines_baseline\": \"word_count\",\n \"word_count\": 1800\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://app.surferseo.com/api/v2/workspaces/{workspace_id}/content_editors/{content_editor_id}/seo_guidelines/structure")
.header("API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"guidelines\": [\n {\n \"factor\": \"img_count\",\n \"value_override\": 5\n },\n {\n \"factor\": \"character_count\",\n \"value_override\": null\n }\n ],\n \"guidelines_baseline\": \"word_count\",\n \"word_count\": 1800\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.surferseo.com/api/v2/workspaces/{workspace_id}/content_editors/{content_editor_id}/seo_guidelines/structure")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"guidelines\": [\n {\n \"factor\": \"img_count\",\n \"value_override\": 5\n },\n {\n \"factor\": \"character_count\",\n \"value_override\": null\n }\n ],\n \"guidelines_baseline\": \"word_count\",\n \"word_count\": 1800\n}"
response = http.request(request)
puts response.read_body{
"guidelines_baseline": "word_count",
"structural_guidelines": [
{
"factor": "character_count",
"target": {
"avg": 6.28,
"max": 11.21,
"min": 1.35,
"value_override": null
}
},
{
"factor": "headings_count",
"target": {
"avg": 0.007,
"max": 0.014,
"min": 0.005,
"value_override": null
}
},
{
"factor": "paragraph_count",
"target": {
"avg": 0.02,
"max": 0.035,
"min": 0,
"value_override": null
}
},
{
"factor": "img_count",
"target": {
"avg": 0.003,
"max": 0.01,
"min": 0,
"value_override": null
}
}
],
"word_count": 1800
}{
"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": [],
"message": "The request was understood but could not be processed.",
"reason": "unprocessable_entity"
}
}{
"error": {
"details": [
{
"retry_after": 30
}
],
"reason": "rate_limit_exceeded"
}
}Authorizations
Path Parameters
x >= 1123
x >= 1123
Body
Structure updates
Was this page helpful?