Update the hosted blog settings
curl --request PATCH \
--url https://www.getsurfaced.ai/api/v1/blog \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Workspace-Id: <x-workspace-id>' \
--data '
{
"enabled": true,
"title": "<string>",
"tagline": "<string>",
"accentColor": "<string>",
"defaultLanguage": "<string>",
"poweredByEnabled": true,
"autoPublish": true,
"redirectDefaultToCustom": true,
"navLinks": [
{
"label": "<string>",
"url": "<string>"
}
],
"footerLinks": [
{
"label": "<string>",
"url": "<string>"
}
],
"socialLinks": {},
"customCss": "<string>"
}
'import requests
url = "https://www.getsurfaced.ai/api/v1/blog"
payload = {
"enabled": True,
"title": "<string>",
"tagline": "<string>",
"accentColor": "<string>",
"defaultLanguage": "<string>",
"poweredByEnabled": True,
"autoPublish": True,
"redirectDefaultToCustom": True,
"navLinks": [
{
"label": "<string>",
"url": "<string>"
}
],
"footerLinks": [
{
"label": "<string>",
"url": "<string>"
}
],
"socialLinks": {},
"customCss": "<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({
enabled: true,
title: '<string>',
tagline: '<string>',
accentColor: '<string>',
defaultLanguage: '<string>',
poweredByEnabled: true,
autoPublish: true,
redirectDefaultToCustom: true,
navLinks: [{label: '<string>', url: '<string>'}],
footerLinks: [{label: '<string>', url: '<string>'}],
socialLinks: {},
customCss: '<string>'
})
};
fetch('https://www.getsurfaced.ai/api/v1/blog', 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/blog",
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([
'enabled' => true,
'title' => '<string>',
'tagline' => '<string>',
'accentColor' => '<string>',
'defaultLanguage' => '<string>',
'poweredByEnabled' => true,
'autoPublish' => true,
'redirectDefaultToCustom' => true,
'navLinks' => [
[
'label' => '<string>',
'url' => '<string>'
]
],
'footerLinks' => [
[
'label' => '<string>',
'url' => '<string>'
]
],
'socialLinks' => [
],
'customCss' => '<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/blog"
payload := strings.NewReader("{\n \"enabled\": true,\n \"title\": \"<string>\",\n \"tagline\": \"<string>\",\n \"accentColor\": \"<string>\",\n \"defaultLanguage\": \"<string>\",\n \"poweredByEnabled\": true,\n \"autoPublish\": true,\n \"redirectDefaultToCustom\": true,\n \"navLinks\": [\n {\n \"label\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"footerLinks\": [\n {\n \"label\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"socialLinks\": {},\n \"customCss\": \"<string>\"\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/blog")
.header("X-Workspace-Id", "<x-workspace-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"title\": \"<string>\",\n \"tagline\": \"<string>\",\n \"accentColor\": \"<string>\",\n \"defaultLanguage\": \"<string>\",\n \"poweredByEnabled\": true,\n \"autoPublish\": true,\n \"redirectDefaultToCustom\": true,\n \"navLinks\": [\n {\n \"label\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"footerLinks\": [\n {\n \"label\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"socialLinks\": {},\n \"customCss\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.getsurfaced.ai/api/v1/blog")
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 \"enabled\": true,\n \"title\": \"<string>\",\n \"tagline\": \"<string>\",\n \"accentColor\": \"<string>\",\n \"defaultLanguage\": \"<string>\",\n \"poweredByEnabled\": true,\n \"autoPublish\": true,\n \"redirectDefaultToCustom\": true,\n \"navLinks\": [\n {\n \"label\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"footerLinks\": [\n {\n \"label\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"socialLinks\": {},\n \"customCss\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"site": {
"enabled": true,
"defaultLanguage": "<string>",
"title": "<string>",
"tagline": "<string>",
"logoUrl": "<string>",
"logoWideUrl": "<string>",
"logoLayout": "square",
"faviconUrl": "<string>",
"accentColor": "<string>",
"themePreset": "editorial",
"fontPreset": "sans",
"colorScheme": "auto",
"poweredByEnabled": true,
"autoPublish": true,
"redirectDefaultToCustom": true,
"navLinks": [
{
"label": "<string>",
"url": "<string>"
}
],
"footerLinks": [
{
"label": "<string>",
"url": "<string>"
}
],
"socialLinks": {},
"customCss": "<string>",
"onboardingCompletedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"customCssRejected": [
{
"rule": "<string>",
"reason": "<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": {}
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"details": {}
}
}Content
Update the hosted blog settings
Partial update: send only the fields to change. customCss is sanitised; anything dropped is listed in customCssRejected. Removing the powered-by badge or setting custom CSS needs the white-label entitlement (403 PERMISSION_DENIED otherwise). The blog must have been enabled first (404 otherwise). Requires the manage_settings permission.
PATCH
/
blog
Update the hosted blog settings
curl --request PATCH \
--url https://www.getsurfaced.ai/api/v1/blog \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Workspace-Id: <x-workspace-id>' \
--data '
{
"enabled": true,
"title": "<string>",
"tagline": "<string>",
"accentColor": "<string>",
"defaultLanguage": "<string>",
"poweredByEnabled": true,
"autoPublish": true,
"redirectDefaultToCustom": true,
"navLinks": [
{
"label": "<string>",
"url": "<string>"
}
],
"footerLinks": [
{
"label": "<string>",
"url": "<string>"
}
],
"socialLinks": {},
"customCss": "<string>"
}
'import requests
url = "https://www.getsurfaced.ai/api/v1/blog"
payload = {
"enabled": True,
"title": "<string>",
"tagline": "<string>",
"accentColor": "<string>",
"defaultLanguage": "<string>",
"poweredByEnabled": True,
"autoPublish": True,
"redirectDefaultToCustom": True,
"navLinks": [
{
"label": "<string>",
"url": "<string>"
}
],
"footerLinks": [
{
"label": "<string>",
"url": "<string>"
}
],
"socialLinks": {},
"customCss": "<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({
enabled: true,
title: '<string>',
tagline: '<string>',
accentColor: '<string>',
defaultLanguage: '<string>',
poweredByEnabled: true,
autoPublish: true,
redirectDefaultToCustom: true,
navLinks: [{label: '<string>', url: '<string>'}],
footerLinks: [{label: '<string>', url: '<string>'}],
socialLinks: {},
customCss: '<string>'
})
};
fetch('https://www.getsurfaced.ai/api/v1/blog', 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/blog",
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([
'enabled' => true,
'title' => '<string>',
'tagline' => '<string>',
'accentColor' => '<string>',
'defaultLanguage' => '<string>',
'poweredByEnabled' => true,
'autoPublish' => true,
'redirectDefaultToCustom' => true,
'navLinks' => [
[
'label' => '<string>',
'url' => '<string>'
]
],
'footerLinks' => [
[
'label' => '<string>',
'url' => '<string>'
]
],
'socialLinks' => [
],
'customCss' => '<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/blog"
payload := strings.NewReader("{\n \"enabled\": true,\n \"title\": \"<string>\",\n \"tagline\": \"<string>\",\n \"accentColor\": \"<string>\",\n \"defaultLanguage\": \"<string>\",\n \"poweredByEnabled\": true,\n \"autoPublish\": true,\n \"redirectDefaultToCustom\": true,\n \"navLinks\": [\n {\n \"label\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"footerLinks\": [\n {\n \"label\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"socialLinks\": {},\n \"customCss\": \"<string>\"\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/blog")
.header("X-Workspace-Id", "<x-workspace-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"title\": \"<string>\",\n \"tagline\": \"<string>\",\n \"accentColor\": \"<string>\",\n \"defaultLanguage\": \"<string>\",\n \"poweredByEnabled\": true,\n \"autoPublish\": true,\n \"redirectDefaultToCustom\": true,\n \"navLinks\": [\n {\n \"label\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"footerLinks\": [\n {\n \"label\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"socialLinks\": {},\n \"customCss\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.getsurfaced.ai/api/v1/blog")
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 \"enabled\": true,\n \"title\": \"<string>\",\n \"tagline\": \"<string>\",\n \"accentColor\": \"<string>\",\n \"defaultLanguage\": \"<string>\",\n \"poweredByEnabled\": true,\n \"autoPublish\": true,\n \"redirectDefaultToCustom\": true,\n \"navLinks\": [\n {\n \"label\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"footerLinks\": [\n {\n \"label\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"socialLinks\": {},\n \"customCss\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"site": {
"enabled": true,
"defaultLanguage": "<string>",
"title": "<string>",
"tagline": "<string>",
"logoUrl": "<string>",
"logoWideUrl": "<string>",
"logoLayout": "square",
"faviconUrl": "<string>",
"accentColor": "<string>",
"themePreset": "editorial",
"fontPreset": "sans",
"colorScheme": "auto",
"poweredByEnabled": true,
"autoPublish": true,
"redirectDefaultToCustom": true,
"navLinks": [
{
"label": "<string>",
"url": "<string>"
}
],
"footerLinks": [
{
"label": "<string>",
"url": "<string>"
}
],
"socialLinks": {},
"customCss": "<string>",
"onboardingCompletedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"customCssRejected": [
{
"rule": "<string>",
"reason": "<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": {}
}
}{
"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