Create a blog category
curl --request POST \
--url https://{notifuseDomain}/api/blogCategories.create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Product",
"slug": "product",
"description": "Release notes and product announcements.",
"seo": {
"meta_title": "Release notes for October",
"meta_description": "Everything that shipped this month.",
"og_title": "<string>",
"og_description": "<string>",
"og_image": "https://cdn.example.com/og/october.png",
"canonical_url": "https://blog.example.com/product/october-release",
"keywords": [
"release",
"changelog"
],
"meta_robots": "index,follow"
}
}
'import requests
url = "https://{notifuseDomain}/api/blogCategories.create"
payload = {
"name": "Product",
"slug": "product",
"description": "Release notes and product announcements.",
"seo": {
"meta_title": "Release notes for October",
"meta_description": "Everything that shipped this month.",
"og_title": "<string>",
"og_description": "<string>",
"og_image": "https://cdn.example.com/og/october.png",
"canonical_url": "https://blog.example.com/product/october-release",
"keywords": ["release", "changelog"],
"meta_robots": "index,follow"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Product',
slug: 'product',
description: 'Release notes and product announcements.',
seo: {
meta_title: 'Release notes for October',
meta_description: 'Everything that shipped this month.',
og_title: '<string>',
og_description: '<string>',
og_image: 'https://cdn.example.com/og/october.png',
canonical_url: 'https://blog.example.com/product/october-release',
keywords: ['release', 'changelog'],
meta_robots: 'index,follow'
}
})
};
fetch('https://{notifuseDomain}/api/blogCategories.create', 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://{notifuseDomain}/api/blogCategories.create",
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([
'name' => 'Product',
'slug' => 'product',
'description' => 'Release notes and product announcements.',
'seo' => [
'meta_title' => 'Release notes for October',
'meta_description' => 'Everything that shipped this month.',
'og_title' => '<string>',
'og_description' => '<string>',
'og_image' => 'https://cdn.example.com/og/october.png',
'canonical_url' => 'https://blog.example.com/product/october-release',
'keywords' => [
'release',
'changelog'
],
'meta_robots' => 'index,follow'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://{notifuseDomain}/api/blogCategories.create"
payload := strings.NewReader("{\n \"name\": \"Product\",\n \"slug\": \"product\",\n \"description\": \"Release notes and product announcements.\",\n \"seo\": {\n \"meta_title\": \"Release notes for October\",\n \"meta_description\": \"Everything that shipped this month.\",\n \"og_title\": \"<string>\",\n \"og_description\": \"<string>\",\n \"og_image\": \"https://cdn.example.com/og/october.png\",\n \"canonical_url\": \"https://blog.example.com/product/october-release\",\n \"keywords\": [\n \"release\",\n \"changelog\"\n ],\n \"meta_robots\": \"index,follow\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://{notifuseDomain}/api/blogCategories.create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Product\",\n \"slug\": \"product\",\n \"description\": \"Release notes and product announcements.\",\n \"seo\": {\n \"meta_title\": \"Release notes for October\",\n \"meta_description\": \"Everything that shipped this month.\",\n \"og_title\": \"<string>\",\n \"og_description\": \"<string>\",\n \"og_image\": \"https://cdn.example.com/og/october.png\",\n \"canonical_url\": \"https://blog.example.com/product/october-release\",\n \"keywords\": [\n \"release\",\n \"changelog\"\n ],\n \"meta_robots\": \"index,follow\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{notifuseDomain}/api/blogCategories.create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Product\",\n \"slug\": \"product\",\n \"description\": \"Release notes and product announcements.\",\n \"seo\": {\n \"meta_title\": \"Release notes for October\",\n \"meta_description\": \"Everything that shipped this month.\",\n \"og_title\": \"<string>\",\n \"og_description\": \"<string>\",\n \"og_image\": \"https://cdn.example.com/og/october.png\",\n \"canonical_url\": \"https://blog.example.com/product/october-release\",\n \"keywords\": [\n \"release\",\n \"changelog\"\n ],\n \"meta_robots\": \"index,follow\"\n }\n}"
response = http.request(request)
puts response.read_body{
"category": {
"id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"slug": "product",
"settings": {
"name": "Product",
"description": "Release notes and product announcements.",
"seo": {
"meta_title": "Release notes for October",
"meta_description": "Everything that shipped this month.",
"og_title": "<string>",
"og_description": "<string>",
"og_image": "https://cdn.example.com/og/october.png",
"canonical_url": "https://blog.example.com/product/october-release",
"keywords": [
"release",
"changelog"
],
"meta_robots": "index,follow"
}
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Blog
Create a blog category
Creates a category. Posts always belong to one, so a blog needs at least one category before its first post. Requires the blog write permission.
POST
/
api
/
blogCategories.create
Create a blog category
curl --request POST \
--url https://{notifuseDomain}/api/blogCategories.create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Product",
"slug": "product",
"description": "Release notes and product announcements.",
"seo": {
"meta_title": "Release notes for October",
"meta_description": "Everything that shipped this month.",
"og_title": "<string>",
"og_description": "<string>",
"og_image": "https://cdn.example.com/og/october.png",
"canonical_url": "https://blog.example.com/product/october-release",
"keywords": [
"release",
"changelog"
],
"meta_robots": "index,follow"
}
}
'import requests
url = "https://{notifuseDomain}/api/blogCategories.create"
payload = {
"name": "Product",
"slug": "product",
"description": "Release notes and product announcements.",
"seo": {
"meta_title": "Release notes for October",
"meta_description": "Everything that shipped this month.",
"og_title": "<string>",
"og_description": "<string>",
"og_image": "https://cdn.example.com/og/october.png",
"canonical_url": "https://blog.example.com/product/october-release",
"keywords": ["release", "changelog"],
"meta_robots": "index,follow"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Product',
slug: 'product',
description: 'Release notes and product announcements.',
seo: {
meta_title: 'Release notes for October',
meta_description: 'Everything that shipped this month.',
og_title: '<string>',
og_description: '<string>',
og_image: 'https://cdn.example.com/og/october.png',
canonical_url: 'https://blog.example.com/product/october-release',
keywords: ['release', 'changelog'],
meta_robots: 'index,follow'
}
})
};
fetch('https://{notifuseDomain}/api/blogCategories.create', 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://{notifuseDomain}/api/blogCategories.create",
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([
'name' => 'Product',
'slug' => 'product',
'description' => 'Release notes and product announcements.',
'seo' => [
'meta_title' => 'Release notes for October',
'meta_description' => 'Everything that shipped this month.',
'og_title' => '<string>',
'og_description' => '<string>',
'og_image' => 'https://cdn.example.com/og/october.png',
'canonical_url' => 'https://blog.example.com/product/october-release',
'keywords' => [
'release',
'changelog'
],
'meta_robots' => 'index,follow'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://{notifuseDomain}/api/blogCategories.create"
payload := strings.NewReader("{\n \"name\": \"Product\",\n \"slug\": \"product\",\n \"description\": \"Release notes and product announcements.\",\n \"seo\": {\n \"meta_title\": \"Release notes for October\",\n \"meta_description\": \"Everything that shipped this month.\",\n \"og_title\": \"<string>\",\n \"og_description\": \"<string>\",\n \"og_image\": \"https://cdn.example.com/og/october.png\",\n \"canonical_url\": \"https://blog.example.com/product/october-release\",\n \"keywords\": [\n \"release\",\n \"changelog\"\n ],\n \"meta_robots\": \"index,follow\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://{notifuseDomain}/api/blogCategories.create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Product\",\n \"slug\": \"product\",\n \"description\": \"Release notes and product announcements.\",\n \"seo\": {\n \"meta_title\": \"Release notes for October\",\n \"meta_description\": \"Everything that shipped this month.\",\n \"og_title\": \"<string>\",\n \"og_description\": \"<string>\",\n \"og_image\": \"https://cdn.example.com/og/october.png\",\n \"canonical_url\": \"https://blog.example.com/product/october-release\",\n \"keywords\": [\n \"release\",\n \"changelog\"\n ],\n \"meta_robots\": \"index,follow\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{notifuseDomain}/api/blogCategories.create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Product\",\n \"slug\": \"product\",\n \"description\": \"Release notes and product announcements.\",\n \"seo\": {\n \"meta_title\": \"Release notes for October\",\n \"meta_description\": \"Everything that shipped this month.\",\n \"og_title\": \"<string>\",\n \"og_description\": \"<string>\",\n \"og_image\": \"https://cdn.example.com/og/october.png\",\n \"canonical_url\": \"https://blog.example.com/product/october-release\",\n \"keywords\": [\n \"release\",\n \"changelog\"\n ],\n \"meta_robots\": \"index,follow\"\n }\n}"
response = http.request(request)
puts response.read_body{
"category": {
"id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"slug": "product",
"settings": {
"name": "Product",
"description": "Release notes and product announcements.",
"seo": {
"meta_title": "Release notes for October",
"meta_description": "Everything that shipped this month.",
"og_title": "<string>",
"og_description": "<string>",
"og_image": "https://cdn.example.com/og/october.png",
"canonical_url": "https://blog.example.com/product/october-release",
"keywords": [
"release",
"changelog"
],
"meta_robots": "index,follow"
}
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Authorizations
API token for authentication
Query Parameters
The ID of the workspace. Passed in the query string, not the body.
Body
application/json
Maximum string length:
255Example:
"Product"
Lowercase letters, digits and single hyphens. Must be unique among the workspace's categories.
Maximum string length:
100Pattern:
^[a-z0-9]+(?:-[a-z0-9]+)*$Example:
"product"
Example:
"Release notes and product announcements."
Search and social metadata for the page, exposed to the blog theme.
Show child attributes
Show child attributes
Response
Category created
Show child attributes
Show child attributes
