Change the SEO rules
curl --request PATCH \
--url https://www.getsurfaced.ai/api/v1/settings/seo \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Workspace-Id: <x-workspace-id>' \
--data '
{
"keywordPlacements": [
"<string>"
],
"customTitleTemplate": "<string>",
"customDescriptionTemplate": "<string>",
"customExcerptTemplate": "<string>",
"targetRegions": [
"<string>"
],
"regionalAdaptations": {},
"allowedInternalLinkPatterns": [
"<string>"
]
}
'import requests
url = "https://www.getsurfaced.ai/api/v1/settings/seo"
payload = {
"keywordPlacements": ["<string>"],
"customTitleTemplate": "<string>",
"customDescriptionTemplate": "<string>",
"customExcerptTemplate": "<string>",
"targetRegions": ["<string>"],
"regionalAdaptations": {},
"allowedInternalLinkPatterns": ["<string>"]
}
headers = {
"X-Workspace-Id": "<x-workspace-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-Workspace-Id': '<x-workspace-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
keywordPlacements: ['<string>'],
customTitleTemplate: '<string>',
customDescriptionTemplate: '<string>',
customExcerptTemplate: '<string>',
targetRegions: ['<string>'],
regionalAdaptations: {},
allowedInternalLinkPatterns: ['<string>']
})
};
fetch('https://www.getsurfaced.ai/api/v1/settings/seo', 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://www.getsurfaced.ai/api/v1/settings/seo",
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([
'keywordPlacements' => [
'<string>'
],
'customTitleTemplate' => '<string>',
'customDescriptionTemplate' => '<string>',
'customExcerptTemplate' => '<string>',
'targetRegions' => [
'<string>'
],
'regionalAdaptations' => [
],
'allowedInternalLinkPatterns' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Workspace-Id: <x-workspace-id>"
],
]);
$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://www.getsurfaced.ai/api/v1/settings/seo"
payload := strings.NewReader("{\n \"keywordPlacements\": [\n \"<string>\"\n ],\n \"customTitleTemplate\": \"<string>\",\n \"customDescriptionTemplate\": \"<string>\",\n \"customExcerptTemplate\": \"<string>\",\n \"targetRegions\": [\n \"<string>\"\n ],\n \"regionalAdaptations\": {},\n \"allowedInternalLinkPatterns\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Workspace-Id", "<x-workspace-id>")
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://www.getsurfaced.ai/api/v1/settings/seo")
.header("X-Workspace-Id", "<x-workspace-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"keywordPlacements\": [\n \"<string>\"\n ],\n \"customTitleTemplate\": \"<string>\",\n \"customDescriptionTemplate\": \"<string>\",\n \"customExcerptTemplate\": \"<string>\",\n \"targetRegions\": [\n \"<string>\"\n ],\n \"regionalAdaptations\": {},\n \"allowedInternalLinkPatterns\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.getsurfaced.ai/api/v1/settings/seo")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Workspace-Id"] = '<x-workspace-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"keywordPlacements\": [\n \"<string>\"\n ],\n \"customTitleTemplate\": \"<string>\",\n \"customDescriptionTemplate\": \"<string>\",\n \"customExcerptTemplate\": \"<string>\",\n \"targetRegions\": [\n \"<string>\"\n ],\n \"regionalAdaptations\": {},\n \"allowedInternalLinkPatterns\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"keywordPlacements": [
"<string>"
],
"titlePattern": "keyword-brand",
"customTitleTemplate": "<string>",
"descriptionPattern": "benefit",
"customDescriptionTemplate": "<string>",
"excerptPattern": "summary",
"customExcerptTemplate": "<string>",
"targetRegions": [
"<string>"
],
"regionalAdaptations": {},
"allowedInternalLinkPatterns": [
"<string>"
]
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"details": {}
}
}Settings
Change the SEO rules
Partial update: send only the fields to change, at least one. A custom pattern uses the matching custom*Template; templates are limited to 150 safe characters and use single braces for placeholders, e.g. {topic} | {brand}. Custom templates need a Pro plan or higher (403 otherwise). Needs the manage_settings permission (workspace owner or manager).
PATCH
/
settings
/
seo
Change the SEO rules
curl --request PATCH \
--url https://www.getsurfaced.ai/api/v1/settings/seo \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Workspace-Id: <x-workspace-id>' \
--data '
{
"keywordPlacements": [
"<string>"
],
"customTitleTemplate": "<string>",
"customDescriptionTemplate": "<string>",
"customExcerptTemplate": "<string>",
"targetRegions": [
"<string>"
],
"regionalAdaptations": {},
"allowedInternalLinkPatterns": [
"<string>"
]
}
'import requests
url = "https://www.getsurfaced.ai/api/v1/settings/seo"
payload = {
"keywordPlacements": ["<string>"],
"customTitleTemplate": "<string>",
"customDescriptionTemplate": "<string>",
"customExcerptTemplate": "<string>",
"targetRegions": ["<string>"],
"regionalAdaptations": {},
"allowedInternalLinkPatterns": ["<string>"]
}
headers = {
"X-Workspace-Id": "<x-workspace-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-Workspace-Id': '<x-workspace-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
keywordPlacements: ['<string>'],
customTitleTemplate: '<string>',
customDescriptionTemplate: '<string>',
customExcerptTemplate: '<string>',
targetRegions: ['<string>'],
regionalAdaptations: {},
allowedInternalLinkPatterns: ['<string>']
})
};
fetch('https://www.getsurfaced.ai/api/v1/settings/seo', 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://www.getsurfaced.ai/api/v1/settings/seo",
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([
'keywordPlacements' => [
'<string>'
],
'customTitleTemplate' => '<string>',
'customDescriptionTemplate' => '<string>',
'customExcerptTemplate' => '<string>',
'targetRegions' => [
'<string>'
],
'regionalAdaptations' => [
],
'allowedInternalLinkPatterns' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Workspace-Id: <x-workspace-id>"
],
]);
$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://www.getsurfaced.ai/api/v1/settings/seo"
payload := strings.NewReader("{\n \"keywordPlacements\": [\n \"<string>\"\n ],\n \"customTitleTemplate\": \"<string>\",\n \"customDescriptionTemplate\": \"<string>\",\n \"customExcerptTemplate\": \"<string>\",\n \"targetRegions\": [\n \"<string>\"\n ],\n \"regionalAdaptations\": {},\n \"allowedInternalLinkPatterns\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Workspace-Id", "<x-workspace-id>")
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://www.getsurfaced.ai/api/v1/settings/seo")
.header("X-Workspace-Id", "<x-workspace-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"keywordPlacements\": [\n \"<string>\"\n ],\n \"customTitleTemplate\": \"<string>\",\n \"customDescriptionTemplate\": \"<string>\",\n \"customExcerptTemplate\": \"<string>\",\n \"targetRegions\": [\n \"<string>\"\n ],\n \"regionalAdaptations\": {},\n \"allowedInternalLinkPatterns\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.getsurfaced.ai/api/v1/settings/seo")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Workspace-Id"] = '<x-workspace-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"keywordPlacements\": [\n \"<string>\"\n ],\n \"customTitleTemplate\": \"<string>\",\n \"customDescriptionTemplate\": \"<string>\",\n \"customExcerptTemplate\": \"<string>\",\n \"targetRegions\": [\n \"<string>\"\n ],\n \"regionalAdaptations\": {},\n \"allowedInternalLinkPatterns\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"keywordPlacements": [
"<string>"
],
"titlePattern": "keyword-brand",
"customTitleTemplate": "<string>",
"descriptionPattern": "benefit",
"customDescriptionTemplate": "<string>",
"excerptPattern": "summary",
"customExcerptTemplate": "<string>",
"targetRegions": [
"<string>"
],
"regionalAdaptations": {},
"allowedInternalLinkPatterns": [
"<string>"
]
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"details": {}
}
}Authorizations
API key (sk_live_...) created at https://www.getsurfaced.ai/app/settings/account/api-keys
Headers
Body
application/json