Is the API right for your website?
The Publishing API connects a Beulog workspace to your own website or content system. Your server retrieves approved articles, and your website gives each article its own address, design, and search metadata. Ask your developer or website provider to handle the server setup; you can prepare the workspace and review the content yourself.
- Choose the API for a custom website, a framework such as Next.js, or your own CMS.
- For WordPress, the ready-made connector handles importing for you. Follow the WordPress guide.
- An embedded blog is the simpler display option when your site only accepts an HTML block. Its Beulog iframe pages use noindex. For articles published as native, crawlable pages on your domain, use the API or WordPress connector.
Prepare your workspace and key
- Verify your account and select the right workspace. Complete email verification, then use the workspace selector in your dashboard. A publishing key belongs to the workspace where you create it; it does not read every workspace in your account.
- Set the final website information. In Workspace settings, set Website to your HTTPS site address and Article address pattern to the actual path, such as /blog/{slug}. Fill in Publisher or brand name and, when available, Publisher logo URL. Use Author name and Author profile URL for the real credited author; leaving the name blank credits the brand.
- Create a publishing key. Open Integrations → Your own website → Publishing keys → Create key. Give this website its own recognizable key name. Keep Read published articles enabled. Leave Also read drafts and Create new articles unchecked for a normal public website.
- Save the key securely on your server. Copy it when it is shown; the full key is not shown again. Store it in your hosting provider’s server environment or secret store. Use a name such as BEULOG_PUBLISHING_KEY, and save the expected workspace ID after testing the connection.
- Review and publish a test article. Check its title, description, image description, sources, author, language, and final address before changing its status to Published. A draft stays out of the default public article response.
Test the connection
All endpoints below use the HTTPS base address https://beulog.com/api/v1. Authenticate with the Authorization: Bearer header. Real publishing keys start with ab_live_. These examples contain placeholders, not working keys; run them on your server or in your own terminal after replacing the placeholders.
Open the connection parameters, response, and examples in eight languages.
Confirm both workspace.id and workspace.name before importing. Compare the ID against the workspace your website expects, and stop if it differs. api_version identifies the API response contract; article schema_version identifies the exported content format.
If analytics is enabled, analytics contains only the public site ID, consent requirement, and allowed origins. Otherwise it is null. Website-origin settings for embeds and analytics are separate from server API authentication; they do not replace a publishing key.
Endpoints and permissions
A parameter is a value you send with a request. A path parameter selects a resource, such as an article ID. Query parameters follow ? in the URL and control filters or pages. Headers carry your key and request settings. A JSON body supplies input to POST requests. The response is the JSON result returned by Beulog; nested field names below use a dot, such as workspace.id.
All requests need Authorization: Bearer followed by your workspace key. Send Accept: application/json. For POST /generate, also send Content-Type: application/json and Idempotency-Key. The base URL is https://beulog.com/api/v1. Requests run on your server; your website’s visitors receive the published page.
| Scope | What it allows |
|---|---|
articles:read | Read published articles, test the connection, and read the synchronization feed. Use this alone for a public website. |
drafts:read | Additional permission to include drafts with drafts=true. It does not replace articles:read. Keep previews private. |
articles:generate | Read generation pricing, create jobs, and check job status. This permission can spend credits; keep it in a separate server task/key. |
| Method and path | Required scope | Response and purpose |
|---|---|---|
GET /connection | articles:read | Workspace identity, scopes, api_version, and optional public analytics configuration. |
GET /articles | articles:read | A paginated data array of complete published article exports. drafts=true additionally requires drafts:read. |
GET /articles/{id} | articles:read | One article by UUID, still inside data: [article]. Draft access uses drafts=true plus drafts:read. Missing or unavailable article: 404. |
GET /sync | articles:read | A lightweight manifest of published article IDs, titles, and change tokens, with a checkpoint and settings revision. |
GET /pricing | articles:generate | Current maximum credit reservations for article, article_with_image, and research jobs. |
POST /generate | articles:generate | Queue a generation job. JSON body and Idempotency-Key are required. Returns the job ID, status, and credit accounting. |
GET /jobs/{id} | articles:generate | Job status, stage, error, article_id, cost, reserved_credits, and settled_at. |
These publishing endpoints do not provide an article update, delete, or upsert operation. Editing and publishing happen in Beulog; inserting or updating a copy in your own database is your integration’s responsibility. The API retrieves articles by UUID, not by slug. Keep a local slug-to-ID mapping for your website routes.
Download the OpenAPI specification · Download the server-side TypeScript client
Check your workspace connection
GET /api/v1/connection
Validate the key and confirm which workspace and permissions it can access.
Required permission: articles:read
This request has no body or query parameters. Run it before importing content and compare workspace.id with the workspace you intend to publish. A successful request also updates the key's last connection time.
analytics is null when visitor analytics is disabled or unconfigured. When enabled, it contains public browser configuration; it never contains the workspace API key. Request visitor consent before loading analytics.
Request parameters
| Parameter / location | Type | Required / default | Meaning and accepted values |
|---|---|---|---|
If-None-MatchHeader | string | Optional | Optional exact ETag from a previous successful request to the same URL and key. A match returns 304 with no response body. |
Request examples — choose your language
Choose your language for the same request. Store your publishing key in the server environment variable BEULOG_PUBLISHING_KEY.
Bash and cURL 7.76 or newer. No extra libraries.
Save as request.sh and run: bash request.sh
#!/usr/bin/env bash
set -euo pipefail
# Set BEULOG_PUBLISHING_KEY in your server environment before running.
: "${BEULOG_PUBLISHING_KEY:?Set your server-side publishing key}"
# cURL returns a failure for HTTP errors and keeps the response body.
if response="$(curl --fail-with-body --silent --show-error \
--connect-timeout 10 --max-time 30 \
--request GET \
--header "Authorization: Bearer $BEULOG_PUBLISHING_KEY" \
--header 'Accept: application/json' \
'https://beulog.com/api/v1/connection')"; then
printf '%s\n' "$response"
else
printf '%s\n' "$response" >&2
exit 1
fiNode.js 20.20 or newer, using its built-in fetch. No extra libraries.
Save as request.mjs and run: node request.mjs
// Run on your server. Never put this key in browser code.
const key = process.env.BEULOG_PUBLISHING_KEY;
if (!key) throw new Error("Set BEULOG_PUBLISHING_KEY on your server");
try {
const response = await fetch("https://beulog.com/api/v1/connection", {
method: "GET",
headers: {
Authorization: `Bearer ${key}`,
"Accept": "application/json",
},
signal: AbortSignal.timeout(30_000),
});
const text = await response.text();
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${text}`);
}
const payload = JSON.parse(text);
console.log(JSON.stringify(payload, null, 2));
} catch (error) {
console.error(error instanceof Error ? error.message : String(error));
process.exitCode = 1;
}Node.js 20.20 or newer. Install the TypeScript tools once with: npm install -D typescript tsx @types/node
Save as request.ts and run: npx tsx request.ts
// Run on your server. Never put this key in browser code.
const key = process.env.BEULOG_PUBLISHING_KEY;
if (!key) throw new Error("Set BEULOG_PUBLISHING_KEY on your server");
try {
const response = await fetch("https://beulog.com/api/v1/connection", {
method: "GET",
headers: {
Authorization: `Bearer ${key}`,
"Accept": "application/json",
},
signal: AbortSignal.timeout(30_000),
});
const text = await response.text();
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${text}`);
}
const payload: unknown = JSON.parse(text);
console.log(JSON.stringify(payload, null, 2));
} catch (error) {
console.error(error instanceof Error ? error.message : String(error));
process.exitCode = 1;
}
export {};Python 3.10 or newer. Uses only the standard library.
Save as request.py and run: python3 request.py
import json
import os
import sys
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
# Read the key from your server environment, never browser code.
key = os.environ.get("BEULOG_PUBLISHING_KEY")
if not key:
sys.exit("Set BEULOG_PUBLISHING_KEY on your server")
headers = {
"Authorization": f"Bearer {key}",
"Accept": "application/json",
}
request = Request(
"https://beulog.com/api/v1/connection",
headers=headers,
method="GET",
)
try:
with urlopen(request, timeout=30) as response:
payload = json.loads(response.read().decode("utf-8"))
print(json.dumps(payload, indent=2, ensure_ascii=False))
except HTTPError as error:
print(f"HTTP {error.code}: {error.read().decode('utf-8')}", file=sys.stderr)
sys.exit(1)
except (URLError, OSError, ValueError) as error:
print(f"Request failed: {error}", file=sys.stderr)
sys.exit(1)PHP 8.2 or newer with the cURL extension enabled.
Save as request.php and run: php request.php
<?php
// Run on your server; the key must never be embedded in browser code.
try {
$key = getenv('BEULOG_PUBLISHING_KEY');
if (!$key) {
throw new RuntimeException('Set BEULOG_PUBLISHING_KEY on your server');
}
$curl = curl_init('https://beulog.com/api/v1/connection');
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $key,
'Accept: application/json',
],
]);
$text = curl_exec($curl);
if ($text === false) {
throw new RuntimeException(curl_error($curl));
}
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($status < 200 || $status >= 300) {
throw new RuntimeException("HTTP $status: $text");
}
$payload = json_decode($text, true, 512, JSON_THROW_ON_ERROR);
echo json_encode($payload, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR) . PHP_EOL;
} catch (Throwable $error) {
fwrite(STDERR, $error->getMessage() . PHP_EOL);
exit(1);
}Ruby 3.1 or newer. Uses the standard net/http and json libraries.
Save as request.rb and run: ruby request.rb
require 'net/http'
require 'uri'
require 'json'
begin
# Read the key from your server environment, never browser code.
key = ENV.fetch('BEULOG_PUBLISHING_KEY')
raise 'Set BEULOG_PUBLISHING_KEY on your server' if key.empty?
uri = URI('https://beulog.com/api/v1/connection')
request = Net::HTTP::Get.new(uri)
request['Authorization'] = "Bearer #{key}"
request['Accept'] = 'application/json'
response = Net::HTTP.start(
uri.host, uri.port, use_ssl: uri.scheme == 'https',
open_timeout: 10, read_timeout: 30, write_timeout: 30
) { |http| http.request(request) }
unless response.is_a?(Net::HTTPSuccess)
raise "HTTP #{response.code}: #{response.body}"
end
puts JSON.pretty_generate(JSON.parse(response.body))
rescue StandardError => error
warn "Request failed: #{error.message}"
exit 1
endGo 1.20 or newer. Uses only the standard library.
Save as request.go and run: go run request.go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"os"
"time"
)
func run() error {
// Read the key from your server environment, never browser code.
key := os.Getenv("BEULOG_PUBLISHING_KEY")
if key == "" {
return fmt.Errorf("set BEULOG_PUBLISHING_KEY on your server")
}
request, err := http.NewRequest(
"GET", "https://beulog.com/api/v1/connection",
nil,
)
if err != nil { return err }
request.Header.Set("Authorization", "Bearer " + key)
request.Header.Set("Accept", "application/json")
client := &http.Client{Timeout: 30 * time.Second}
response, err := client.Do(request)
if err != nil { return err }
defer response.Body.Close()
text, err := io.ReadAll(response.Body)
if err != nil { return err }
if response.StatusCode < 200 || response.StatusCode >= 300 {
return fmt.Errorf("HTTP %d: %s", response.StatusCode, text)
}
var pretty bytes.Buffer
if err := json.Indent(&pretty, text, "", " "); err != nil { return err }
fmt.Println(pretty.String())
return nil
}
func main() {
if err := run(); err != nil {
fmt.Fprintln(os.Stderr, "Request failed:", err)
os.Exit(1)
}
}JDK 17 or newer. Uses the built-in HTTP client; no dependencies.
Save as RequestExample.java and run: java RequestExample.java
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
public class RequestExample {
public static void main(String[] args) {
try {
// Read the key from your server environment, never browser code.
String key = System.getenv("BEULOG_PUBLISHING_KEY");
if (key == null || key.isBlank()) {
throw new IllegalStateException("Set BEULOG_PUBLISHING_KEY on your server");
}
HttpClient client = HttpClient.newBuilder()
.connectTimeout(Duration.ofSeconds(10)).build();
HttpRequest request = HttpRequest.newBuilder(URI.create("https://beulog.com/api/v1/connection"))
.timeout(Duration.ofSeconds(30))
.header("Authorization", "Bearer " + key)
.header("Accept", "application/json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() < 200 || response.statusCode() >= 300) {
throw new IOException("HTTP " + response.statusCode() + ": " + response.body());
}
System.out.println(response.body());
} catch (Exception error) {
if (error instanceof InterruptedException) Thread.currentThread().interrupt();
System.err.println("Request failed: " + error.getMessage());
System.exit(1);
}
}
}Response fields
| Field | Type | What it means |
|---|---|---|
api_version | string: "1.2" | Current public API version. |
workspace.id | UUID | The workspace attached to this API key. |
workspace.name | string | Human-readable workspace name. |
workspace.language | "en" | "ar" | "es" | "fr" | "de" | Workspace's default content language. |
scopes | string[] | Permissions granted to this key; not all account permissions. |
analytics | object | null | Public analytics configuration, or null when disabled. |
analytics.site_id | 36-character hexadecimal string | Public site identifier for analytics, present only when enabled. |
analytics.consent_required | boolean: true | Visitor consent is required before analytics tracking. |
analytics.allowed_origins | string[] | Website origins allowed to submit analytics events. |
{
"api_version": "1.2",
"workspace": {
"id": "00000000-0000-4000-8000-000000000001",
"name": "Example publication",
"language": "en"
},
"scopes": [
"articles:read"
],
"analytics": null
}| Status | Meaning and next step |
|---|---|
200 | Connected workspace and granted permissions. |
304 | The exact If-None-Match value matches this GET response. No body; use the previously stored response. |
401 | Missing, invalid or revoked API key, or the workspace owner's account is unverified. |
403 | The key does not have the required permission. |
429 | Request limit reached. Inspect Retry-After and back off. |
500 | Unexpected server error. Save X-Request-Id for support. |
503 | A required service is temporarily unavailable. Retry later. |
List articles
GET /api/v1/articles
Read published articles with their HTML, structured content, metadata and sources.
Required permission: articles:read; drafts:read when drafts=true
Articles are ordered by creation time, newest first, with ID as a stable tie-breaker. The response includes full article bodies, so use a modest limit and follow pagination.next_cursor until it is null. An empty workspace returns data: [].
Prefer cursor pagination while new articles may be added. Keep the same drafts filter and workspace for the whole list. Do not combine a cursor with a nonzero offset; offset=0 is accepted. List cursors belong to /articles and cannot be reused for /sync.
Request parameters
| Parameter / location | Type | Required / default | Meaning and accepted values |
|---|---|---|---|
limitURL query | integer: 1–100 | Optional Default: 20 | Maximum articles in this page. Invalid numbers and values outside the range return 400. |
cursorURL query | string, up to 1,000 characters | Optional | Use the exact pagination.next_cursor from the previous page, URL encoded. It records workspace, drafts filter, creation time and ID. Invalid or mismatched cursors return 400. |
offsetURL query | integer: 0–100,000 | Optional Default: 0 | Legacy number of rows to skip. Prefer cursor for a changing collection; new articles can shift offset pages. |
draftsURL query | boolean | Optional Default: false | Only the literal query value true includes drafts. Requires drafts:read in addition to articles:read. Other values behave as false; never expose draft responses on public pages. |
If-None-MatchHeader | string | Optional | Optional exact ETag from a previous successful request to the same URL and key. A match returns 304 with no response body. |
Request examples — choose your language
Choose your language for the same request. Store your publishing key in the server environment variable BEULOG_PUBLISHING_KEY.
Bash and cURL 7.76 or newer. No extra libraries.
Save as request.sh and run: bash request.sh
#!/usr/bin/env bash
set -euo pipefail
# Set BEULOG_PUBLISHING_KEY in your server environment before running.
: "${BEULOG_PUBLISHING_KEY:?Set your server-side publishing key}"
# cURL returns a failure for HTTP errors and keeps the response body.
if response="$(curl --fail-with-body --silent --show-error \
--connect-timeout 10 --max-time 30 \
--request GET \
--header "Authorization: Bearer $BEULOG_PUBLISHING_KEY" \
--header 'Accept: application/json' \
'https://beulog.com/api/v1/articles?limit=20')"; then
printf '%s\n' "$response"
else
printf '%s\n' "$response" >&2
exit 1
fiNode.js 20.20 or newer, using its built-in fetch. No extra libraries.
Save as request.mjs and run: node request.mjs
// Run on your server. Never put this key in browser code.
const key = process.env.BEULOG_PUBLISHING_KEY;
if (!key) throw new Error("Set BEULOG_PUBLISHING_KEY on your server");
try {
const response = await fetch("https://beulog.com/api/v1/articles?limit=20", {
method: "GET",
headers: {
Authorization: `Bearer ${key}`,
"Accept": "application/json",
},
signal: AbortSignal.timeout(30_000),
});
const text = await response.text();
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${text}`);
}
const payload = JSON.parse(text);
console.log(JSON.stringify(payload, null, 2));
} catch (error) {
console.error(error instanceof Error ? error.message : String(error));
process.exitCode = 1;
}Node.js 20.20 or newer. Install the TypeScript tools once with: npm install -D typescript tsx @types/node
Save as request.ts and run: npx tsx request.ts
// Run on your server. Never put this key in browser code.
const key = process.env.BEULOG_PUBLISHING_KEY;
if (!key) throw new Error("Set BEULOG_PUBLISHING_KEY on your server");
try {
const response = await fetch("https://beulog.com/api/v1/articles?limit=20", {
method: "GET",
headers: {
Authorization: `Bearer ${key}`,
"Accept": "application/json",
},
signal: AbortSignal.timeout(30_000),
});
const text = await response.text();
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${text}`);
}
const payload: unknown = JSON.parse(text);
console.log(JSON.stringify(payload, null, 2));
} catch (error) {
console.error(error instanceof Error ? error.message : String(error));
process.exitCode = 1;
}
export {};Python 3.10 or newer. Uses only the standard library.
Save as request.py and run: python3 request.py
import json
import os
import sys
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
# Read the key from your server environment, never browser code.
key = os.environ.get("BEULOG_PUBLISHING_KEY")
if not key:
sys.exit("Set BEULOG_PUBLISHING_KEY on your server")
headers = {
"Authorization": f"Bearer {key}",
"Accept": "application/json",
}
request = Request(
"https://beulog.com/api/v1/articles?limit=20",
headers=headers,
method="GET",
)
try:
with urlopen(request, timeout=30) as response:
payload = json.loads(response.read().decode("utf-8"))
print(json.dumps(payload, indent=2, ensure_ascii=False))
except HTTPError as error:
print(f"HTTP {error.code}: {error.read().decode('utf-8')}", file=sys.stderr)
sys.exit(1)
except (URLError, OSError, ValueError) as error:
print(f"Request failed: {error}", file=sys.stderr)
sys.exit(1)PHP 8.2 or newer with the cURL extension enabled.
Save as request.php and run: php request.php
<?php
// Run on your server; the key must never be embedded in browser code.
try {
$key = getenv('BEULOG_PUBLISHING_KEY');
if (!$key) {
throw new RuntimeException('Set BEULOG_PUBLISHING_KEY on your server');
}
$curl = curl_init('https://beulog.com/api/v1/articles?limit=20');
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $key,
'Accept: application/json',
],
]);
$text = curl_exec($curl);
if ($text === false) {
throw new RuntimeException(curl_error($curl));
}
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($status < 200 || $status >= 300) {
throw new RuntimeException("HTTP $status: $text");
}
$payload = json_decode($text, true, 512, JSON_THROW_ON_ERROR);
echo json_encode($payload, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR) . PHP_EOL;
} catch (Throwable $error) {
fwrite(STDERR, $error->getMessage() . PHP_EOL);
exit(1);
}Ruby 3.1 or newer. Uses the standard net/http and json libraries.
Save as request.rb and run: ruby request.rb
require 'net/http'
require 'uri'
require 'json'
begin
# Read the key from your server environment, never browser code.
key = ENV.fetch('BEULOG_PUBLISHING_KEY')
raise 'Set BEULOG_PUBLISHING_KEY on your server' if key.empty?
uri = URI('https://beulog.com/api/v1/articles?limit=20')
request = Net::HTTP::Get.new(uri)
request['Authorization'] = "Bearer #{key}"
request['Accept'] = 'application/json'
response = Net::HTTP.start(
uri.host, uri.port, use_ssl: uri.scheme == 'https',
open_timeout: 10, read_timeout: 30, write_timeout: 30
) { |http| http.request(request) }
unless response.is_a?(Net::HTTPSuccess)
raise "HTTP #{response.code}: #{response.body}"
end
puts JSON.pretty_generate(JSON.parse(response.body))
rescue StandardError => error
warn "Request failed: #{error.message}"
exit 1
endGo 1.20 or newer. Uses only the standard library.
Save as request.go and run: go run request.go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"os"
"time"
)
func run() error {
// Read the key from your server environment, never browser code.
key := os.Getenv("BEULOG_PUBLISHING_KEY")
if key == "" {
return fmt.Errorf("set BEULOG_PUBLISHING_KEY on your server")
}
request, err := http.NewRequest(
"GET", "https://beulog.com/api/v1/articles?limit=20",
nil,
)
if err != nil { return err }
request.Header.Set("Authorization", "Bearer " + key)
request.Header.Set("Accept", "application/json")
client := &http.Client{Timeout: 30 * time.Second}
response, err := client.Do(request)
if err != nil { return err }
defer response.Body.Close()
text, err := io.ReadAll(response.Body)
if err != nil { return err }
if response.StatusCode < 200 || response.StatusCode >= 300 {
return fmt.Errorf("HTTP %d: %s", response.StatusCode, text)
}
var pretty bytes.Buffer
if err := json.Indent(&pretty, text, "", " "); err != nil { return err }
fmt.Println(pretty.String())
return nil
}
func main() {
if err := run(); err != nil {
fmt.Fprintln(os.Stderr, "Request failed:", err)
os.Exit(1)
}
}JDK 17 or newer. Uses the built-in HTTP client; no dependencies.
Save as RequestExample.java and run: java RequestExample.java
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
public class RequestExample {
public static void main(String[] args) {
try {
// Read the key from your server environment, never browser code.
String key = System.getenv("BEULOG_PUBLISHING_KEY");
if (key == null || key.isBlank()) {
throw new IllegalStateException("Set BEULOG_PUBLISHING_KEY on your server");
}
HttpClient client = HttpClient.newBuilder()
.connectTimeout(Duration.ofSeconds(10)).build();
HttpRequest request = HttpRequest.newBuilder(URI.create("https://beulog.com/api/v1/articles?limit=20"))
.timeout(Duration.ofSeconds(30))
.header("Authorization", "Bearer " + key)
.header("Accept", "application/json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() < 200 || response.statusCode() >= 300) {
throw new IOException("HTTP " + response.statusCode() + ": " + response.body());
}
System.out.println(response.body());
} catch (Exception error) {
if (error instanceof InterruptedException) Thread.currentThread().interrupt();
System.err.println("Request failed: " + error.getMessage());
System.exit(1);
}
}
}Response fields
| Field | Type | What it means |
|---|---|---|
data | Article[] | An array of complete article exports. The single-article endpoint also uses this array envelope. |
pagination.limit | integer | Page size; 1 for a single-article request. |
pagination.offset | integer | null | Current legacy offset, or null when cursor pagination is used. |
pagination.has_more | boolean | True when another page exists. Always false for a single-article response. |
pagination.next_cursor | string | null | Exact opaque token for the next page. null means the list is complete. Keep the same workspace and drafts filter. |
pagination.next_offset | integer | null | Legacy next offset; null at the end or after switching to cursor pagination. |
See every field inside each article, including content and SEO metadata.
{
"data": [
{
"id": "00000000-0000-4000-8000-000000000002",
"workspace_id": "00000000-0000-4000-8000-000000000001",
"version": 1,
"status": "published",
"title": "How to plan an editorial calendar",
"slug": "plan-an-editorial-calendar",
"language": "en",
"translation_group_id": null,
"created_at": "2026-10-01T09:00:00.000Z",
"updated_at": "2026-10-01T09:00:00.000Z",
"published_at": "2026-10-01T09:00:00.000Z",
"canonical_url": null,
"image_url": null,
"image_width": null,
"image_height": null,
"quality": [],
"generation_warnings": null,
"content": {
"title": "How to plan an editorial calendar",
"slug": "plan-an-editorial-calendar",
"excerpt": "Create a practical publishing plan for your team.",
"metaTitle": "How to plan an editorial calendar",
"metaDescription": "Plan useful topics, clear deadlines and a review process for your publication.",
"category": "Publishing",
"keywords": [
"editorial calendar"
],
"takeaways": [
"Choose useful topics",
"Assign a review date",
"Review before publishing"
],
"sections": [
{
"heading": "Start with your readers",
"summary": "Plan around questions your readers ask.",
"paragraphs": [
"Choose one question and prepare an article that answers it clearly."
],
"bullets": [
"Keep the calendar manageable."
],
"sourceIds": [],
"subsections": [],
"steps": [
"Choose your next topic."
],
"table": null,
"callout": null
}
],
"faqs": [
{
"question": "How often should we publish?",
"answer": "Choose a schedule your team can maintain."
}
],
"imagePrompt": "",
"imageAlt": "",
"imageCaption": "",
"searchIntent": "Build an editorial calendar",
"reviewNotes": [],
"recommendedPublish": true
},
"references": [],
"references_json": [],
"schema_version": "1.1",
"html": "<article class=\"aiblogs-article\" lang=\"en\" dir=\"ltr\"><header><p class=\"aiblogs-category\">Publishing</p><h1>How to plan an editorial calendar</h1><p class=\"aiblogs-lead\">Create a practical publishing plan for your team.</p><p class=\"aiblogs-byline\">Example publication · Updated <time datetime=\"2026-10-01T09:00:00.000Z\">October 1, 2026</time> · 1 min read</p></header>\n <aside class=\"aiblogs-takeaways\"><h2>Key takeaways</h2><ul><li>Choose useful topics</li><li>Assign a review date</li><li>Review before publishing</li></ul></aside>\n <nav class=\"aiblogs-toc\" aria-label=\"In this article\"><h2>In this article</h2><ol><li><a href=\"#article-00000000-0000-4000-8000-000000000002-1\">Start with your readers</a></li><li><a href=\"#article-00000000-0000-4000-8000-000000000002-faq\">Frequently asked questions</a></li></ol></nav>\n <section id=\"article-00000000-0000-4000-8000-000000000002-1\"><h2>Start with your readers</h2><p class=\"aiblogs-section-summary\">Plan around questions your readers ask.</p><p>Choose one question and prepare an article that answers it clearly.</p><ul><li>Keep the calendar manageable.</li></ul><ol class=\"aiblogs-steps\"><li>Choose your next topic.</li></ol></section>\n <section id=\"article-00000000-0000-4000-8000-000000000002-faq\" class=\"aiblogs-faq\"><h2>Frequently asked questions</h2><details open><summary>How often should we publish?</summary><p>Choose a schedule your team can maintain.</p></details></section>\n <section class=\"aiblogs-references\"><h2>Sources & references</h2><ol></ol></section></article>",
"head_html": "<title>How to plan an editorial calendar</title><meta name=\"description\" content=\"Plan useful topics, clear deadlines and a review process for your publication.\" /><meta name=\"robots\" content=\"index, follow, max-image-preview:large\" /><link rel=\"canonical\" href=\"https://example.com/blog/plan-an-editorial-calendar\" /><meta property=\"og:type\" content=\"article\" /><meta property=\"og:title\" content=\"How to plan an editorial calendar\" /><meta property=\"og:description\" content=\"Plan useful topics, clear deadlines and a review process for your publication.\" /><meta property=\"og:url\" content=\"https://example.com/blog/plan-an-editorial-calendar\" /><meta property=\"og:site_name\" content=\"Example publication\" /><meta property=\"og:locale\" content=\"en_US\" /><meta property=\"article:published_time\" content=\"2026-10-01T09:00:00.000Z\" /><meta property=\"article:modified_time\" content=\"2026-10-01T09:00:00.000Z\" /><meta name=\"twitter:card\" content=\"summary\" /><meta name=\"twitter:title\" content=\"How to plan an editorial calendar\" /><meta name=\"twitter:description\" content=\"Plan useful topics, clear deadlines and a review process for your publication.\" /><script type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https://example.com/blog/plan-an-editorial-calendar#article\",\"url\":\"https://example.com/blog/plan-an-editorial-calendar\",\"mainEntityOfPage\":{\"@type\":\"WebPage\",\"@id\":\"https://example.com/blog/plan-an-editorial-calendar\"},\"headline\":\"How to plan an editorial calendar\",\"description\":\"Plan useful topics, clear deadlines and a review process for your publication.\",\"inLanguage\":\"en\",\"articleSection\":\"Publishing\",\"keywords\":\"editorial calendar\",\"datePublished\":\"2026-10-01T09:00:00.000Z\",\"dateModified\":\"2026-10-01T09:00:00.000Z\",\"author\":{\"@type\":\"Organization\",\"name\":\"Example publication\"},\"publisher\":{\"@type\":\"Organization\",\"name\":\"Example publication\",\"url\":\"https://example.com/\"},\"citation\":[],\"wordCount\":29,\"isAccessibleForFree\":true},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://example.com/blog/plan-an-editorial-calendar#breadcrumbs\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https://example.com/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to plan an editorial calendar\",\"item\":\"https://example.com/blog/plan-an-editorial-calendar\"}]},{\"@type\":\"FAQPage\",\"@id\":\"https://example.com/blog/plan-an-editorial-calendar#faq\",\"mainEntity\":[{\"@type\":\"Question\",\"name\":\"How often should we publish?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Choose a schedule your team can maintain.\"}}]}]}</script>",
"seo": {
"title": "How to plan an editorial calendar",
"description": "Plan useful topics, clear deadlines and a review process for your publication.",
"canonical": "https://example.com/blog/plan-an-editorial-calendar",
"robots": "index, follow, max-image-preview:large",
"language": "en",
"openGraph": {
"type": "article",
"title": "How to plan an editorial calendar",
"description": "Plan useful topics, clear deadlines and a review process for your publication.",
"url": "https://example.com/blog/plan-an-editorial-calendar",
"siteName": "Example publication",
"locale": "en_US",
"images": [],
"publishedTime": "2026-10-01T09:00:00.000Z",
"modifiedTime": "2026-10-01T09:00:00.000Z"
},
"twitter": {
"card": "summary",
"title": "How to plan an editorial calendar",
"description": "Plan useful topics, clear deadlines and a review process for your publication.",
"image": null,
"imageAlt": ""
}
},
"publishing_checks": [
{
"label": "Title and search description",
"passed": true
},
{
"label": "Cover image and descriptive alt text",
"passed": false
},
{
"label": "Canonical article address",
"passed": true
},
{
"label": "Named publisher",
"passed": true
},
{
"label": "Sections, takeaways and FAQs",
"passed": false
},
{
"label": "Sources cited throughout the article",
"passed": false
},
{
"label": "Configured internal links",
"passed": true
}
],
"reading_minutes": 1,
"json_ld": {
"@context": "https://schema.org",
"@graph": [
{
"@type": "BlogPosting",
"@id": "https://example.com/blog/plan-an-editorial-calendar#article",
"url": "https://example.com/blog/plan-an-editorial-calendar",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://example.com/blog/plan-an-editorial-calendar"
},
"headline": "How to plan an editorial calendar",
"description": "Plan useful topics, clear deadlines and a review process for your publication.",
"inLanguage": "en",
"articleSection": "Publishing",
"keywords": "editorial calendar",
"datePublished": "2026-10-01T09:00:00.000Z",
"dateModified": "2026-10-01T09:00:00.000Z",
"author": {
"@type": "Organization",
"name": "Example publication"
},
"publisher": {
"@type": "Organization",
"name": "Example publication",
"url": "https://example.com/"
},
"citation": [],
"wordCount": 29,
"isAccessibleForFree": true
},
{
"@type": "BreadcrumbList",
"@id": "https://example.com/blog/plan-an-editorial-calendar#breadcrumbs",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://example.com/"
},
{
"@type": "ListItem",
"position": 2,
"name": "How to plan an editorial calendar",
"item": "https://example.com/blog/plan-an-editorial-calendar"
}
]
},
{
"@type": "FAQPage",
"@id": "https://example.com/blog/plan-an-editorial-calendar#faq",
"mainEntity": [
{
"@type": "Question",
"name": "How often should we publish?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Choose a schedule your team can maintain."
}
}
]
}
]
},
"revision": "772066718e41650d049603388c9a374c62817f529ed062f281a5e695c161ef70"
}
],
"pagination": {
"limit": 20,
"offset": 0,
"has_more": false,
"next_offset": null,
"next_cursor": null
}
}| Status | Meaning and next step |
|---|---|
200 | A page of article exports, including an empty data array when there are no matching articles. |
304 | The exact If-None-Match value matches this GET response. No body; use the previously stored response. |
400 | Invalid pagination numbers, cursor, or a cursor combined with a nonzero offset. |
401 | Missing, invalid or revoked API key, or the workspace owner's account is unverified. |
403 | The key does not have the required permission. |
429 | Request limit reached. Inspect Retry-After and back off. |
500 | Unexpected server error. Save X-Request-Id for support. |
503 | A required service is temporarily unavailable. Retry later. |
Get one article
GET /api/v1/articles/{id}
Download a complete article by its UUID in this key's workspace.
Required permission: articles:read; drafts:read when drafts=true
The result uses the same data array as the article list, with exactly one element at data[0] and pagination.limit: 1. A missing article, an article in another workspace, or a draft hidden by the published-only filter returns 404.
Use this endpoint after finding a changed ID through /sync. Read data[0].seo and data[0].json_ld for page metadata, or render data[0].head_html once. There is no standalone article object outside the data array.
Request parameters
| Parameter / location | Type | Required / default | Meaning and accepted values |
|---|---|---|---|
idURL path | UUID | Required | Article UUID from /articles, /sync or a completed article job. Slugs are not accepted. |
draftsURL query | boolean | Optional Default: false | Only the literal query value true includes drafts. Requires drafts:read in addition to articles:read. Other values behave as false; never expose draft responses on public pages. |
If-None-MatchHeader | string | Optional | Optional exact ETag from a previous successful request to the same URL and key. A match returns 304 with no response body. |
Request examples — choose your language
Choose your language for the same request. Store your publishing key in the server environment variable BEULOG_PUBLISHING_KEY.
Bash and cURL 7.76 or newer. No extra libraries.
Save as request.sh and run: bash request.sh
#!/usr/bin/env bash
set -euo pipefail
# Set BEULOG_PUBLISHING_KEY in your server environment before running.
: "${BEULOG_PUBLISHING_KEY:?Set your server-side publishing key}"
# cURL returns a failure for HTTP errors and keeps the response body.
if response="$(curl --fail-with-body --silent --show-error \
--connect-timeout 10 --max-time 30 \
--request GET \
--header "Authorization: Bearer $BEULOG_PUBLISHING_KEY" \
--header 'Accept: application/json' \
'https://beulog.com/api/v1/articles/00000000-0000-4000-8000-000000000002')"; then
printf '%s\n' "$response"
else
printf '%s\n' "$response" >&2
exit 1
fiNode.js 20.20 or newer, using its built-in fetch. No extra libraries.
Save as request.mjs and run: node request.mjs
// Run on your server. Never put this key in browser code.
const key = process.env.BEULOG_PUBLISHING_KEY;
if (!key) throw new Error("Set BEULOG_PUBLISHING_KEY on your server");
try {
const response = await fetch("https://beulog.com/api/v1/articles/00000000-0000-4000-8000-000000000002", {
method: "GET",
headers: {
Authorization: `Bearer ${key}`,
"Accept": "application/json",
},
signal: AbortSignal.timeout(30_000),
});
const text = await response.text();
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${text}`);
}
const payload = JSON.parse(text);
console.log(JSON.stringify(payload, null, 2));
} catch (error) {
console.error(error instanceof Error ? error.message : String(error));
process.exitCode = 1;
}Node.js 20.20 or newer. Install the TypeScript tools once with: npm install -D typescript tsx @types/node
Save as request.ts and run: npx tsx request.ts
// Run on your server. Never put this key in browser code.
const key = process.env.BEULOG_PUBLISHING_KEY;
if (!key) throw new Error("Set BEULOG_PUBLISHING_KEY on your server");
try {
const response = await fetch("https://beulog.com/api/v1/articles/00000000-0000-4000-8000-000000000002", {
method: "GET",
headers: {
Authorization: `Bearer ${key}`,
"Accept": "application/json",
},
signal: AbortSignal.timeout(30_000),
});
const text = await response.text();
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${text}`);
}
const payload: unknown = JSON.parse(text);
console.log(JSON.stringify(payload, null, 2));
} catch (error) {
console.error(error instanceof Error ? error.message : String(error));
process.exitCode = 1;
}
export {};Python 3.10 or newer. Uses only the standard library.
Save as request.py and run: python3 request.py
import json
import os
import sys
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
# Read the key from your server environment, never browser code.
key = os.environ.get("BEULOG_PUBLISHING_KEY")
if not key:
sys.exit("Set BEULOG_PUBLISHING_KEY on your server")
headers = {
"Authorization": f"Bearer {key}",
"Accept": "application/json",
}
request = Request(
"https://beulog.com/api/v1/articles/00000000-0000-4000-8000-000000000002",
headers=headers,
method="GET",
)
try:
with urlopen(request, timeout=30) as response:
payload = json.loads(response.read().decode("utf-8"))
print(json.dumps(payload, indent=2, ensure_ascii=False))
except HTTPError as error:
print(f"HTTP {error.code}: {error.read().decode('utf-8')}", file=sys.stderr)
sys.exit(1)
except (URLError, OSError, ValueError) as error:
print(f"Request failed: {error}", file=sys.stderr)
sys.exit(1)PHP 8.2 or newer with the cURL extension enabled.
Save as request.php and run: php request.php
<?php
// Run on your server; the key must never be embedded in browser code.
try {
$key = getenv('BEULOG_PUBLISHING_KEY');
if (!$key) {
throw new RuntimeException('Set BEULOG_PUBLISHING_KEY on your server');
}
$curl = curl_init('https://beulog.com/api/v1/articles/00000000-0000-4000-8000-000000000002');
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $key,
'Accept: application/json',
],
]);
$text = curl_exec($curl);
if ($text === false) {
throw new RuntimeException(curl_error($curl));
}
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($status < 200 || $status >= 300) {
throw new RuntimeException("HTTP $status: $text");
}
$payload = json_decode($text, true, 512, JSON_THROW_ON_ERROR);
echo json_encode($payload, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR) . PHP_EOL;
} catch (Throwable $error) {
fwrite(STDERR, $error->getMessage() . PHP_EOL);
exit(1);
}Ruby 3.1 or newer. Uses the standard net/http and json libraries.
Save as request.rb and run: ruby request.rb
require 'net/http'
require 'uri'
require 'json'
begin
# Read the key from your server environment, never browser code.
key = ENV.fetch('BEULOG_PUBLISHING_KEY')
raise 'Set BEULOG_PUBLISHING_KEY on your server' if key.empty?
uri = URI('https://beulog.com/api/v1/articles/00000000-0000-4000-8000-000000000002')
request = Net::HTTP::Get.new(uri)
request['Authorization'] = "Bearer #{key}"
request['Accept'] = 'application/json'
response = Net::HTTP.start(
uri.host, uri.port, use_ssl: uri.scheme == 'https',
open_timeout: 10, read_timeout: 30, write_timeout: 30
) { |http| http.request(request) }
unless response.is_a?(Net::HTTPSuccess)
raise "HTTP #{response.code}: #{response.body}"
end
puts JSON.pretty_generate(JSON.parse(response.body))
rescue StandardError => error
warn "Request failed: #{error.message}"
exit 1
endGo 1.20 or newer. Uses only the standard library.
Save as request.go and run: go run request.go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"os"
"time"
)
func run() error {
// Read the key from your server environment, never browser code.
key := os.Getenv("BEULOG_PUBLISHING_KEY")
if key == "" {
return fmt.Errorf("set BEULOG_PUBLISHING_KEY on your server")
}
request, err := http.NewRequest(
"GET", "https://beulog.com/api/v1/articles/00000000-0000-4000-8000-000000000002",
nil,
)
if err != nil { return err }
request.Header.Set("Authorization", "Bearer " + key)
request.Header.Set("Accept", "application/json")
client := &http.Client{Timeout: 30 * time.Second}
response, err := client.Do(request)
if err != nil { return err }
defer response.Body.Close()
text, err := io.ReadAll(response.Body)
if err != nil { return err }
if response.StatusCode < 200 || response.StatusCode >= 300 {
return fmt.Errorf("HTTP %d: %s", response.StatusCode, text)
}
var pretty bytes.Buffer
if err := json.Indent(&pretty, text, "", " "); err != nil { return err }
fmt.Println(pretty.String())
return nil
}
func main() {
if err := run(); err != nil {
fmt.Fprintln(os.Stderr, "Request failed:", err)
os.Exit(1)
}
}JDK 17 or newer. Uses the built-in HTTP client; no dependencies.
Save as RequestExample.java and run: java RequestExample.java
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
public class RequestExample {
public static void main(String[] args) {
try {
// Read the key from your server environment, never browser code.
String key = System.getenv("BEULOG_PUBLISHING_KEY");
if (key == null || key.isBlank()) {
throw new IllegalStateException("Set BEULOG_PUBLISHING_KEY on your server");
}
HttpClient client = HttpClient.newBuilder()
.connectTimeout(Duration.ofSeconds(10)).build();
HttpRequest request = HttpRequest.newBuilder(URI.create("https://beulog.com/api/v1/articles/00000000-0000-4000-8000-000000000002"))
.timeout(Duration.ofSeconds(30))
.header("Authorization", "Bearer " + key)
.header("Accept", "application/json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() < 200 || response.statusCode() >= 300) {
throw new IOException("HTTP " + response.statusCode() + ": " + response.body());
}
System.out.println(response.body());
} catch (Exception error) {
if (error instanceof InterruptedException) Thread.currentThread().interrupt();
System.err.println("Request failed: " + error.getMessage());
System.exit(1);
}
}
}Response fields
| Field | Type | What it means |
|---|---|---|
data | Article[] | An array of complete article exports. The single-article endpoint also uses this array envelope. |
pagination.limit | integer | Page size; 1 for a single-article request. |
pagination.offset | integer | null | Current legacy offset, or null when cursor pagination is used. |
pagination.has_more | boolean | True when another page exists. Always false for a single-article response. |
pagination.next_cursor | string | null | Exact opaque token for the next page. null means the list is complete. Keep the same workspace and drafts filter. |
pagination.next_offset | integer | null | Legacy next offset; null at the end or after switching to cursor pagination. |
See every field inside each article, including content and SEO metadata.
{
"data": [
{
"id": "00000000-0000-4000-8000-000000000002",
"workspace_id": "00000000-0000-4000-8000-000000000001",
"version": 1,
"status": "published",
"title": "How to plan an editorial calendar",
"slug": "plan-an-editorial-calendar",
"language": "en",
"translation_group_id": null,
"created_at": "2026-10-01T09:00:00.000Z",
"updated_at": "2026-10-01T09:00:00.000Z",
"published_at": "2026-10-01T09:00:00.000Z",
"canonical_url": null,
"image_url": null,
"image_width": null,
"image_height": null,
"quality": [],
"generation_warnings": null,
"content": {
"title": "How to plan an editorial calendar",
"slug": "plan-an-editorial-calendar",
"excerpt": "Create a practical publishing plan for your team.",
"metaTitle": "How to plan an editorial calendar",
"metaDescription": "Plan useful topics, clear deadlines and a review process for your publication.",
"category": "Publishing",
"keywords": [
"editorial calendar"
],
"takeaways": [
"Choose useful topics",
"Assign a review date",
"Review before publishing"
],
"sections": [
{
"heading": "Start with your readers",
"summary": "Plan around questions your readers ask.",
"paragraphs": [
"Choose one question and prepare an article that answers it clearly."
],
"bullets": [
"Keep the calendar manageable."
],
"sourceIds": [],
"subsections": [],
"steps": [
"Choose your next topic."
],
"table": null,
"callout": null
}
],
"faqs": [
{
"question": "How often should we publish?",
"answer": "Choose a schedule your team can maintain."
}
],
"imagePrompt": "",
"imageAlt": "",
"imageCaption": "",
"searchIntent": "Build an editorial calendar",
"reviewNotes": [],
"recommendedPublish": true
},
"references": [],
"references_json": [],
"schema_version": "1.1",
"html": "<article class=\"aiblogs-article\" lang=\"en\" dir=\"ltr\"><header><p class=\"aiblogs-category\">Publishing</p><h1>How to plan an editorial calendar</h1><p class=\"aiblogs-lead\">Create a practical publishing plan for your team.</p><p class=\"aiblogs-byline\">Example publication · Updated <time datetime=\"2026-10-01T09:00:00.000Z\">October 1, 2026</time> · 1 min read</p></header>\n <aside class=\"aiblogs-takeaways\"><h2>Key takeaways</h2><ul><li>Choose useful topics</li><li>Assign a review date</li><li>Review before publishing</li></ul></aside>\n <nav class=\"aiblogs-toc\" aria-label=\"In this article\"><h2>In this article</h2><ol><li><a href=\"#article-00000000-0000-4000-8000-000000000002-1\">Start with your readers</a></li><li><a href=\"#article-00000000-0000-4000-8000-000000000002-faq\">Frequently asked questions</a></li></ol></nav>\n <section id=\"article-00000000-0000-4000-8000-000000000002-1\"><h2>Start with your readers</h2><p class=\"aiblogs-section-summary\">Plan around questions your readers ask.</p><p>Choose one question and prepare an article that answers it clearly.</p><ul><li>Keep the calendar manageable.</li></ul><ol class=\"aiblogs-steps\"><li>Choose your next topic.</li></ol></section>\n <section id=\"article-00000000-0000-4000-8000-000000000002-faq\" class=\"aiblogs-faq\"><h2>Frequently asked questions</h2><details open><summary>How often should we publish?</summary><p>Choose a schedule your team can maintain.</p></details></section>\n <section class=\"aiblogs-references\"><h2>Sources & references</h2><ol></ol></section></article>",
"head_html": "<title>How to plan an editorial calendar</title><meta name=\"description\" content=\"Plan useful topics, clear deadlines and a review process for your publication.\" /><meta name=\"robots\" content=\"index, follow, max-image-preview:large\" /><link rel=\"canonical\" href=\"https://example.com/blog/plan-an-editorial-calendar\" /><meta property=\"og:type\" content=\"article\" /><meta property=\"og:title\" content=\"How to plan an editorial calendar\" /><meta property=\"og:description\" content=\"Plan useful topics, clear deadlines and a review process for your publication.\" /><meta property=\"og:url\" content=\"https://example.com/blog/plan-an-editorial-calendar\" /><meta property=\"og:site_name\" content=\"Example publication\" /><meta property=\"og:locale\" content=\"en_US\" /><meta property=\"article:published_time\" content=\"2026-10-01T09:00:00.000Z\" /><meta property=\"article:modified_time\" content=\"2026-10-01T09:00:00.000Z\" /><meta name=\"twitter:card\" content=\"summary\" /><meta name=\"twitter:title\" content=\"How to plan an editorial calendar\" /><meta name=\"twitter:description\" content=\"Plan useful topics, clear deadlines and a review process for your publication.\" /><script type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https://example.com/blog/plan-an-editorial-calendar#article\",\"url\":\"https://example.com/blog/plan-an-editorial-calendar\",\"mainEntityOfPage\":{\"@type\":\"WebPage\",\"@id\":\"https://example.com/blog/plan-an-editorial-calendar\"},\"headline\":\"How to plan an editorial calendar\",\"description\":\"Plan useful topics, clear deadlines and a review process for your publication.\",\"inLanguage\":\"en\",\"articleSection\":\"Publishing\",\"keywords\":\"editorial calendar\",\"datePublished\":\"2026-10-01T09:00:00.000Z\",\"dateModified\":\"2026-10-01T09:00:00.000Z\",\"author\":{\"@type\":\"Organization\",\"name\":\"Example publication\"},\"publisher\":{\"@type\":\"Organization\",\"name\":\"Example publication\",\"url\":\"https://example.com/\"},\"citation\":[],\"wordCount\":29,\"isAccessibleForFree\":true},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://example.com/blog/plan-an-editorial-calendar#breadcrumbs\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https://example.com/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to plan an editorial calendar\",\"item\":\"https://example.com/blog/plan-an-editorial-calendar\"}]},{\"@type\":\"FAQPage\",\"@id\":\"https://example.com/blog/plan-an-editorial-calendar#faq\",\"mainEntity\":[{\"@type\":\"Question\",\"name\":\"How often should we publish?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Choose a schedule your team can maintain.\"}}]}]}</script>",
"seo": {
"title": "How to plan an editorial calendar",
"description": "Plan useful topics, clear deadlines and a review process for your publication.",
"canonical": "https://example.com/blog/plan-an-editorial-calendar",
"robots": "index, follow, max-image-preview:large",
"language": "en",
"openGraph": {
"type": "article",
"title": "How to plan an editorial calendar",
"description": "Plan useful topics, clear deadlines and a review process for your publication.",
"url": "https://example.com/blog/plan-an-editorial-calendar",
"siteName": "Example publication",
"locale": "en_US",
"images": [],
"publishedTime": "2026-10-01T09:00:00.000Z",
"modifiedTime": "2026-10-01T09:00:00.000Z"
},
"twitter": {
"card": "summary",
"title": "How to plan an editorial calendar",
"description": "Plan useful topics, clear deadlines and a review process for your publication.",
"image": null,
"imageAlt": ""
}
},
"publishing_checks": [
{
"label": "Title and search description",
"passed": true
},
{
"label": "Cover image and descriptive alt text",
"passed": false
},
{
"label": "Canonical article address",
"passed": true
},
{
"label": "Named publisher",
"passed": true
},
{
"label": "Sections, takeaways and FAQs",
"passed": false
},
{
"label": "Sources cited throughout the article",
"passed": false
},
{
"label": "Configured internal links",
"passed": true
}
],
"reading_minutes": 1,
"json_ld": {
"@context": "https://schema.org",
"@graph": [
{
"@type": "BlogPosting",
"@id": "https://example.com/blog/plan-an-editorial-calendar#article",
"url": "https://example.com/blog/plan-an-editorial-calendar",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://example.com/blog/plan-an-editorial-calendar"
},
"headline": "How to plan an editorial calendar",
"description": "Plan useful topics, clear deadlines and a review process for your publication.",
"inLanguage": "en",
"articleSection": "Publishing",
"keywords": "editorial calendar",
"datePublished": "2026-10-01T09:00:00.000Z",
"dateModified": "2026-10-01T09:00:00.000Z",
"author": {
"@type": "Organization",
"name": "Example publication"
},
"publisher": {
"@type": "Organization",
"name": "Example publication",
"url": "https://example.com/"
},
"citation": [],
"wordCount": 29,
"isAccessibleForFree": true
},
{
"@type": "BreadcrumbList",
"@id": "https://example.com/blog/plan-an-editorial-calendar#breadcrumbs",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://example.com/"
},
{
"@type": "ListItem",
"position": 2,
"name": "How to plan an editorial calendar",
"item": "https://example.com/blog/plan-an-editorial-calendar"
}
]
},
{
"@type": "FAQPage",
"@id": "https://example.com/blog/plan-an-editorial-calendar#faq",
"mainEntity": [
{
"@type": "Question",
"name": "How often should we publish?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Choose a schedule your team can maintain."
}
}
]
}
]
},
"revision": "772066718e41650d049603388c9a374c62817f529ed062f281a5e695c161ef70"
}
],
"pagination": {
"limit": 1,
"offset": 0,
"has_more": false,
"next_offset": null,
"next_cursor": null
}
}| Status | Meaning and next step |
|---|---|
200 | One complete article in data[0]. |
304 | The exact If-None-Match value matches this GET response. No body; use the previously stored response. |
400 | The article ID is not a valid UUID. |
404 | Article not found in this workspace or not visible under the selected drafts filter. |
401 | Missing, invalid or revoked API key, or the workspace owner's account is unverified. |
403 | The key does not have the required permission. |
429 | Request limit reached. Inspect Retry-After and back off. |
500 | Unexpected server error. Save X-Request-Id for support. |
503 | A required service is temporarily unavailable. Retry later. |
Discover changed articles
GET /api/v1/sync
Get a lightweight manifest of published article IDs and change tokens.
Required permission: articles:read
For the first scan omit since and settings_revision. For subsequent scans send both the saved checkpoint as since and the saved settings_revision. A missing or changed settings revision triggers a full published-article scan because workspace settings affect rendered metadata.
Follow pagination.next_cursor through every page. It preserves the scan's time boundary and filters. Only save checkpoint and settings_revision after every page is processed or durably queued. The next scan includes a five-minute overlap before since, so deduplicate by article ID and manifest revision.
Sync revision is distinct from the full article export revision. Fetch /articles/{id} for changed entries. This feed contains published articles only; it does not contain deletion or unpublishing records. Periodically reconcile the complete published list with your imports. Restart a scan after an invalid/outdated cursor response.
Request parameters
| Parameter / location | Type | Required / default | Meaning and accepted values |
|---|---|---|---|
limitURL query | integer: 1–100 | Optional Default: 50 | Maximum manifest entries per page. Does not download article bodies. |
sinceURL query | UTC ISO 8601 date-time | Optional | Saved checkpoint from the last completed scan, such as 2026-10-01T09:00:00.000Z. Use UTC with a Z suffix. The server includes a five-minute overlap. Omit for the first scan. |
settings_revisionURL query | string | Optional | Exact settings token saved with that checkpoint. Missing or different values reset since and run a full scan. |
cursorURL query | string, up to 2,000 characters | Optional | Exact pagination.next_cursor for the current scan. Overrides its saved since and time boundary; must belong to this workspace and current settings revision. Omit to start a new scan. |
If-None-MatchHeader | string | Optional | Optional exact ETag from a previous successful request to the same URL and key. A match returns 304 with no response body. |
Request examples — choose your language
Choose your language for the same request. Store your publishing key in the server environment variable BEULOG_PUBLISHING_KEY.
Bash and cURL 7.76 or newer. No extra libraries.
Save as request.sh and run: bash request.sh
#!/usr/bin/env bash
set -euo pipefail
# Set BEULOG_PUBLISHING_KEY in your server environment before running.
: "${BEULOG_PUBLISHING_KEY:?Set your server-side publishing key}"
# cURL returns a failure for HTTP errors and keeps the response body.
if response="$(curl --fail-with-body --silent --show-error \
--connect-timeout 10 --max-time 30 \
--request GET \
--header "Authorization: Bearer $BEULOG_PUBLISHING_KEY" \
--header 'Accept: application/json' \
'https://beulog.com/api/v1/sync?limit=50')"; then
printf '%s\n' "$response"
else
printf '%s\n' "$response" >&2
exit 1
fiNode.js 20.20 or newer, using its built-in fetch. No extra libraries.
Save as request.mjs and run: node request.mjs
// Run on your server. Never put this key in browser code.
const key = process.env.BEULOG_PUBLISHING_KEY;
if (!key) throw new Error("Set BEULOG_PUBLISHING_KEY on your server");
try {
const response = await fetch("https://beulog.com/api/v1/sync?limit=50", {
method: "GET",
headers: {
Authorization: `Bearer ${key}`,
"Accept": "application/json",
},
signal: AbortSignal.timeout(30_000),
});
const text = await response.text();
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${text}`);
}
const payload = JSON.parse(text);
console.log(JSON.stringify(payload, null, 2));
} catch (error) {
console.error(error instanceof Error ? error.message : String(error));
process.exitCode = 1;
}Node.js 20.20 or newer. Install the TypeScript tools once with: npm install -D typescript tsx @types/node
Save as request.ts and run: npx tsx request.ts
// Run on your server. Never put this key in browser code.
const key = process.env.BEULOG_PUBLISHING_KEY;
if (!key) throw new Error("Set BEULOG_PUBLISHING_KEY on your server");
try {
const response = await fetch("https://beulog.com/api/v1/sync?limit=50", {
method: "GET",
headers: {
Authorization: `Bearer ${key}`,
"Accept": "application/json",
},
signal: AbortSignal.timeout(30_000),
});
const text = await response.text();
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${text}`);
}
const payload: unknown = JSON.parse(text);
console.log(JSON.stringify(payload, null, 2));
} catch (error) {
console.error(error instanceof Error ? error.message : String(error));
process.exitCode = 1;
}
export {};Python 3.10 or newer. Uses only the standard library.
Save as request.py and run: python3 request.py
import json
import os
import sys
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
# Read the key from your server environment, never browser code.
key = os.environ.get("BEULOG_PUBLISHING_KEY")
if not key:
sys.exit("Set BEULOG_PUBLISHING_KEY on your server")
headers = {
"Authorization": f"Bearer {key}",
"Accept": "application/json",
}
request = Request(
"https://beulog.com/api/v1/sync?limit=50",
headers=headers,
method="GET",
)
try:
with urlopen(request, timeout=30) as response:
payload = json.loads(response.read().decode("utf-8"))
print(json.dumps(payload, indent=2, ensure_ascii=False))
except HTTPError as error:
print(f"HTTP {error.code}: {error.read().decode('utf-8')}", file=sys.stderr)
sys.exit(1)
except (URLError, OSError, ValueError) as error:
print(f"Request failed: {error}", file=sys.stderr)
sys.exit(1)PHP 8.2 or newer with the cURL extension enabled.
Save as request.php and run: php request.php
<?php
// Run on your server; the key must never be embedded in browser code.
try {
$key = getenv('BEULOG_PUBLISHING_KEY');
if (!$key) {
throw new RuntimeException('Set BEULOG_PUBLISHING_KEY on your server');
}
$curl = curl_init('https://beulog.com/api/v1/sync?limit=50');
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $key,
'Accept: application/json',
],
]);
$text = curl_exec($curl);
if ($text === false) {
throw new RuntimeException(curl_error($curl));
}
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($status < 200 || $status >= 300) {
throw new RuntimeException("HTTP $status: $text");
}
$payload = json_decode($text, true, 512, JSON_THROW_ON_ERROR);
echo json_encode($payload, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR) . PHP_EOL;
} catch (Throwable $error) {
fwrite(STDERR, $error->getMessage() . PHP_EOL);
exit(1);
}Ruby 3.1 or newer. Uses the standard net/http and json libraries.
Save as request.rb and run: ruby request.rb
require 'net/http'
require 'uri'
require 'json'
begin
# Read the key from your server environment, never browser code.
key = ENV.fetch('BEULOG_PUBLISHING_KEY')
raise 'Set BEULOG_PUBLISHING_KEY on your server' if key.empty?
uri = URI('https://beulog.com/api/v1/sync?limit=50')
request = Net::HTTP::Get.new(uri)
request['Authorization'] = "Bearer #{key}"
request['Accept'] = 'application/json'
response = Net::HTTP.start(
uri.host, uri.port, use_ssl: uri.scheme == 'https',
open_timeout: 10, read_timeout: 30, write_timeout: 30
) { |http| http.request(request) }
unless response.is_a?(Net::HTTPSuccess)
raise "HTTP #{response.code}: #{response.body}"
end
puts JSON.pretty_generate(JSON.parse(response.body))
rescue StandardError => error
warn "Request failed: #{error.message}"
exit 1
endGo 1.20 or newer. Uses only the standard library.
Save as request.go and run: go run request.go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"os"
"time"
)
func run() error {
// Read the key from your server environment, never browser code.
key := os.Getenv("BEULOG_PUBLISHING_KEY")
if key == "" {
return fmt.Errorf("set BEULOG_PUBLISHING_KEY on your server")
}
request, err := http.NewRequest(
"GET", "https://beulog.com/api/v1/sync?limit=50",
nil,
)
if err != nil { return err }
request.Header.Set("Authorization", "Bearer " + key)
request.Header.Set("Accept", "application/json")
client := &http.Client{Timeout: 30 * time.Second}
response, err := client.Do(request)
if err != nil { return err }
defer response.Body.Close()
text, err := io.ReadAll(response.Body)
if err != nil { return err }
if response.StatusCode < 200 || response.StatusCode >= 300 {
return fmt.Errorf("HTTP %d: %s", response.StatusCode, text)
}
var pretty bytes.Buffer
if err := json.Indent(&pretty, text, "", " "); err != nil { return err }
fmt.Println(pretty.String())
return nil
}
func main() {
if err := run(); err != nil {
fmt.Fprintln(os.Stderr, "Request failed:", err)
os.Exit(1)
}
}JDK 17 or newer. Uses the built-in HTTP client; no dependencies.
Save as RequestExample.java and run: java RequestExample.java
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
public class RequestExample {
public static void main(String[] args) {
try {
// Read the key from your server environment, never browser code.
String key = System.getenv("BEULOG_PUBLISHING_KEY");
if (key == null || key.isBlank()) {
throw new IllegalStateException("Set BEULOG_PUBLISHING_KEY on your server");
}
HttpClient client = HttpClient.newBuilder()
.connectTimeout(Duration.ofSeconds(10)).build();
HttpRequest request = HttpRequest.newBuilder(URI.create("https://beulog.com/api/v1/sync?limit=50"))
.timeout(Duration.ofSeconds(30))
.header("Authorization", "Bearer " + key)
.header("Accept", "application/json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() < 200 || response.statusCode() >= 300) {
throw new IOException("HTTP " + response.statusCode() + ": " + response.body());
}
System.out.println(response.body());
} catch (Exception error) {
if (error instanceof InterruptedException) Thread.currentThread().interrupt();
System.err.println("Request failed: " + error.getMessage());
System.exit(1);
}
}
}Response fields
| Field | Type | What it means |
|---|---|---|
api_version | string: "1.2" | Public API contract version. |
workspace_id | UUID | Workspace scanned; compare with your expected workspace. |
settings_revision | string | Current opaque digest of workspace settings; save with checkpoint after the complete scan. |
checkpoint | UTC ISO 8601 date-time | Scan upper boundary. It remains the same across cursor pages. It is not the time of the last returned article. |
data[] | { id: UUID, title: string, revision: string }[] | Published-article manifest entries ordered by update time then ID. data can be empty. revision tracks ID, edit version, update timestamp and workspace settings. |
data[].id | UUID | Published article identifier. Fetch /articles/{id} for the complete export. |
data[].title | string | Saved article title; included for identification without downloading the body. |
data[].revision | string | Opaque manifest change token based on ID, edit version, update time and workspace settings. Distinct from data[0].revision in a complete article export. |
pagination.next_cursor | string | null | Token for the next page of this scan; null marks completion. Do not advance your stored checkpoint before this point. |
{
"api_version": "1.2",
"workspace_id": "00000000-0000-4000-8000-000000000001",
"settings_revision": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"checkpoint": "2026-10-01T09:05:00.000000Z",
"data": [
{
"id": "00000000-0000-4000-8000-000000000002",
"title": "How to plan an editorial calendar",
"revision": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
}
],
"pagination": {
"next_cursor": null
}
}| Status | Meaning and next step |
|---|---|
200 | A lightweight manifest page; empty data is valid. |
304 | The exact If-None-Match value matches this GET response. No body; use the previously stored response. |
400 | Invalid limit or UTC date-time, or an invalid/outdated cursor. Restart the current scan for cursor errors. |
401 | Missing, invalid or revoked API key, or the workspace owner's account is unverified. |
403 | The key does not have the required permission. |
429 | Request limit reached. Inspect Retry-After and back off. |
500 | Unexpected server error. Save X-Request-Id for support. |
503 | A required service is temporarily unavailable. Retry later. |
Check credit reservations
GET /api/v1/pricing
Read current maximum credit reservations before requesting generation.
Required permission: articles:generate
These amounts are spending ceilings reserved when a job is queued, not fixed final charges. Successful generation settles against actual usage and returns unused credits; failed jobs refund the reservation. Retrieve the current values and set maxCredits on /generate to enforce your own ceiling.
The sample values are illustrative of the current contract, and may change. Treat the live /pricing response as the source for reservation limits.
Request parameters
| Parameter / location | Type | Required / default | Meaning and accepted values |
|---|---|---|---|
If-None-MatchHeader | string | Optional | Optional exact ETag from a previous successful request to the same URL and key. A match returns 304 with no response body. |
Request examples — choose your language
Choose your language for the same request. Store your publishing key in the server environment variable BEULOG_PUBLISHING_KEY.
Bash and cURL 7.76 or newer. No extra libraries.
Save as request.sh and run: bash request.sh
#!/usr/bin/env bash
set -euo pipefail
# Set BEULOG_PUBLISHING_KEY in your server environment before running.
: "${BEULOG_PUBLISHING_KEY:?Set your server-side publishing key}"
# cURL returns a failure for HTTP errors and keeps the response body.
if response="$(curl --fail-with-body --silent --show-error \
--connect-timeout 10 --max-time 30 \
--request GET \
--header "Authorization: Bearer $BEULOG_PUBLISHING_KEY" \
--header 'Accept: application/json' \
'https://beulog.com/api/v1/pricing')"; then
printf '%s\n' "$response"
else
printf '%s\n' "$response" >&2
exit 1
fiNode.js 20.20 or newer, using its built-in fetch. No extra libraries.
Save as request.mjs and run: node request.mjs
// Run on your server. Never put this key in browser code.
const key = process.env.BEULOG_PUBLISHING_KEY;
if (!key) throw new Error("Set BEULOG_PUBLISHING_KEY on your server");
try {
const response = await fetch("https://beulog.com/api/v1/pricing", {
method: "GET",
headers: {
Authorization: `Bearer ${key}`,
"Accept": "application/json",
},
signal: AbortSignal.timeout(30_000),
});
const text = await response.text();
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${text}`);
}
const payload = JSON.parse(text);
console.log(JSON.stringify(payload, null, 2));
} catch (error) {
console.error(error instanceof Error ? error.message : String(error));
process.exitCode = 1;
}Node.js 20.20 or newer. Install the TypeScript tools once with: npm install -D typescript tsx @types/node
Save as request.ts and run: npx tsx request.ts
// Run on your server. Never put this key in browser code.
const key = process.env.BEULOG_PUBLISHING_KEY;
if (!key) throw new Error("Set BEULOG_PUBLISHING_KEY on your server");
try {
const response = await fetch("https://beulog.com/api/v1/pricing", {
method: "GET",
headers: {
Authorization: `Bearer ${key}`,
"Accept": "application/json",
},
signal: AbortSignal.timeout(30_000),
});
const text = await response.text();
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${text}`);
}
const payload: unknown = JSON.parse(text);
console.log(JSON.stringify(payload, null, 2));
} catch (error) {
console.error(error instanceof Error ? error.message : String(error));
process.exitCode = 1;
}
export {};Python 3.10 or newer. Uses only the standard library.
Save as request.py and run: python3 request.py
import json
import os
import sys
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
# Read the key from your server environment, never browser code.
key = os.environ.get("BEULOG_PUBLISHING_KEY")
if not key:
sys.exit("Set BEULOG_PUBLISHING_KEY on your server")
headers = {
"Authorization": f"Bearer {key}",
"Accept": "application/json",
}
request = Request(
"https://beulog.com/api/v1/pricing",
headers=headers,
method="GET",
)
try:
with urlopen(request, timeout=30) as response:
payload = json.loads(response.read().decode("utf-8"))
print(json.dumps(payload, indent=2, ensure_ascii=False))
except HTTPError as error:
print(f"HTTP {error.code}: {error.read().decode('utf-8')}", file=sys.stderr)
sys.exit(1)
except (URLError, OSError, ValueError) as error:
print(f"Request failed: {error}", file=sys.stderr)
sys.exit(1)PHP 8.2 or newer with the cURL extension enabled.
Save as request.php and run: php request.php
<?php
// Run on your server; the key must never be embedded in browser code.
try {
$key = getenv('BEULOG_PUBLISHING_KEY');
if (!$key) {
throw new RuntimeException('Set BEULOG_PUBLISHING_KEY on your server');
}
$curl = curl_init('https://beulog.com/api/v1/pricing');
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $key,
'Accept: application/json',
],
]);
$text = curl_exec($curl);
if ($text === false) {
throw new RuntimeException(curl_error($curl));
}
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($status < 200 || $status >= 300) {
throw new RuntimeException("HTTP $status: $text");
}
$payload = json_decode($text, true, 512, JSON_THROW_ON_ERROR);
echo json_encode($payload, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR) . PHP_EOL;
} catch (Throwable $error) {
fwrite(STDERR, $error->getMessage() . PHP_EOL);
exit(1);
}Ruby 3.1 or newer. Uses the standard net/http and json libraries.
Save as request.rb and run: ruby request.rb
require 'net/http'
require 'uri'
require 'json'
begin
# Read the key from your server environment, never browser code.
key = ENV.fetch('BEULOG_PUBLISHING_KEY')
raise 'Set BEULOG_PUBLISHING_KEY on your server' if key.empty?
uri = URI('https://beulog.com/api/v1/pricing')
request = Net::HTTP::Get.new(uri)
request['Authorization'] = "Bearer #{key}"
request['Accept'] = 'application/json'
response = Net::HTTP.start(
uri.host, uri.port, use_ssl: uri.scheme == 'https',
open_timeout: 10, read_timeout: 30, write_timeout: 30
) { |http| http.request(request) }
unless response.is_a?(Net::HTTPSuccess)
raise "HTTP #{response.code}: #{response.body}"
end
puts JSON.pretty_generate(JSON.parse(response.body))
rescue StandardError => error
warn "Request failed: #{error.message}"
exit 1
endGo 1.20 or newer. Uses only the standard library.
Save as request.go and run: go run request.go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"os"
"time"
)
func run() error {
// Read the key from your server environment, never browser code.
key := os.Getenv("BEULOG_PUBLISHING_KEY")
if key == "" {
return fmt.Errorf("set BEULOG_PUBLISHING_KEY on your server")
}
request, err := http.NewRequest(
"GET", "https://beulog.com/api/v1/pricing",
nil,
)
if err != nil { return err }
request.Header.Set("Authorization", "Bearer " + key)
request.Header.Set("Accept", "application/json")
client := &http.Client{Timeout: 30 * time.Second}
response, err := client.Do(request)
if err != nil { return err }
defer response.Body.Close()
text, err := io.ReadAll(response.Body)
if err != nil { return err }
if response.StatusCode < 200 || response.StatusCode >= 300 {
return fmt.Errorf("HTTP %d: %s", response.StatusCode, text)
}
var pretty bytes.Buffer
if err := json.Indent(&pretty, text, "", " "); err != nil { return err }
fmt.Println(pretty.String())
return nil
}
func main() {
if err := run(); err != nil {
fmt.Fprintln(os.Stderr, "Request failed:", err)
os.Exit(1)
}
}JDK 17 or newer. Uses the built-in HTTP client; no dependencies.
Save as RequestExample.java and run: java RequestExample.java
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
public class RequestExample {
public static void main(String[] args) {
try {
// Read the key from your server environment, never browser code.
String key = System.getenv("BEULOG_PUBLISHING_KEY");
if (key == null || key.isBlank()) {
throw new IllegalStateException("Set BEULOG_PUBLISHING_KEY on your server");
}
HttpClient client = HttpClient.newBuilder()
.connectTimeout(Duration.ofSeconds(10)).build();
HttpRequest request = HttpRequest.newBuilder(URI.create("https://beulog.com/api/v1/pricing"))
.timeout(Duration.ofSeconds(30))
.header("Authorization", "Bearer " + key)
.header("Accept", "application/json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() < 200 || response.statusCode() >= 300) {
throw new IOException("HTTP " + response.statusCode() + ": " + response.body());
}
System.out.println(response.body());
} catch (Exception error) {
if (error instanceof InterruptedException) Thread.currentThread().interrupt();
System.err.println("Request failed: " + error.getMessage());
System.exit(1);
}
}
}Response fields
| Field | Type | What it means |
|---|---|---|
billing | string: "usage_based" | Generation is charged by usage, with a maximum reservation. |
article | integer (credits) | Maximum reservation for an article with image=false. |
article_with_image | integer (credits) | Maximum reservation for an article with image=true. |
research | integer (credits) | Maximum reservation for a research job. |
description | string | Human-readable explanation of reservations and refunds. |
{
"billing": "usage_based",
"article": 40,
"article_with_image": 45,
"research": 10,
"description": "Maximum credits reserved per job. Unused credits are returned on completion. Failed jobs are fully refunded."
}| Status | Meaning and next step |
|---|---|
200 | Current credit reservation ceilings. |
304 | The exact If-None-Match value matches this GET response. No body; use the previously stored response. |
401 | Missing, invalid or revoked API key, or the workspace owner's account is unverified. |
403 | The key does not have the required permission. |
429 | Request limit reached. Inspect Retry-After and back off. |
500 | Unexpected server error. Save X-Request-Id for support. |
503 | A required service is temporarily unavailable. Retry later. |
Queue article or research generation
POST /api/v1/generate
Reserve credits and queue an asynchronous generation job.
Required permission: articles:generate
Send a JSON object, even when using every default ({} is valid). The body limit is 300,000 bytes. A successful response is HTTP 200 with a job identifier, not the generated article. Poll GET /jobs/{id} with a delay; fetch GET /articles/{article_id} after an article job completes. New content defaults to draft; reading it before publication also needs drafts:read and drafts=true.
Use a new Idempotency-Key for each intended job. Reuse the same key with the same workspace API key when retrying that job; the existing job is returned without another credit reservation. Changing the body does not change an existing job with the same key. Idempotency is scoped to the API key; another key can create a separate job. There is no documented expiry window.
Workspace settings supply the audience, language, tone and other generation choices. An archived workspace cannot generate content. Billing holds, insufficient credits, unavailable generation services or a reservation above maxCredits are rejected before a new job is queued. autoPublish requests publishing, but quality checks can still keep the result as a draft; inspect the resulting article's status.
Request parameters
| Parameter / location | Type | Required / default | Meaning and accepted values |
|---|---|---|---|
Idempotency-KeyHeader | string: 1–128 characters | Required | Your unique retry identifier for this intended job. Reuse for retries; use a new value for a new job. |
Content-TypeHeader | application/json | Optional | Recommended header for JSON encoded as UTF-8. The handler parses JSON regardless of this header; malformed JSON or a body that is not an object returns 400. |
topicJSON body | string: up to 1,500 characters | Optional Default: "" | Topic or editorial instructions. Leading/trailing whitespace is trimmed. Empty string lets generation use the workspace's configured topics. |
imageJSON body | boolean | Optional Default: true | Request a cover image for article generation. Set false for text-only articles and research. This flag is checked for image service availability even when kind=research. |
autoPublishJSON body | boolean | Optional Default: false | Request publication after generation; quality review can leave the article as a draft. Does not publish a research brief. |
kindJSON body | "article" | "research" | Optional Default: "article" | article produces an article. research produces a research brief visible in the workspace; its completed job can have article_id=null, and this public API has no research retrieval endpoint. |
researchIdJSON body | UUID | Optional | Optional existing research brief in this workspace to seed generation. A missing or other-workspace brief returns 404. |
maxCreditsJSON body | integer: 1–1,000,000 | Optional | Optional maximum acceptable reservation. If the current reservation exceeds it, return 409 without reserving credits. Omission accepts the current reservation; check /pricing first. |
Request examples — choose your language
Before running this example, use a key with articles:generate, replace the example Idempotency-Key with your stored job identifier, and check GET /pricing. The example maxCredits of 40 is an illustrative spending ceiling; a higher current reservation returns 409. Choose your approved ceiling before submitting.
Choose your language for the same request. Store your publishing key in the server environment variable BEULOG_PUBLISHING_KEY.
Replace the sample Idempotency-Key with a unique value you store for each new intended job. Reuse that value when retrying the same job.
Bash and cURL 7.76 or newer. No extra libraries.
Save as request.sh and run: bash request.sh
#!/usr/bin/env bash
set -euo pipefail
# Set BEULOG_PUBLISHING_KEY in your server environment before running.
: "${BEULOG_PUBLISHING_KEY:?Set your server-side publishing key}"
# cURL returns a failure for HTTP errors and keeps the response body.
if response="$(curl --fail-with-body --silent --show-error \
--connect-timeout 10 --max-time 30 \
--request POST \
--header "Authorization: Bearer $BEULOG_PUBLISHING_KEY" \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: editorial-calendar-001' \
--data-raw '{"topic":"How to plan an editorial calendar","image":false,"autoPublish":false,"kind":"article","maxCredits":40}' \
'https://beulog.com/api/v1/generate')"; then
printf '%s\n' "$response"
else
printf '%s\n' "$response" >&2
exit 1
fiNode.js 20.20 or newer, using its built-in fetch. No extra libraries.
Save as request.mjs and run: node request.mjs
// Run on your server. Never put this key in browser code.
const key = process.env.BEULOG_PUBLISHING_KEY;
if (!key) throw new Error("Set BEULOG_PUBLISHING_KEY on your server");
try {
const response = await fetch("https://beulog.com/api/v1/generate", {
method: "POST",
headers: {
Authorization: `Bearer ${key}`,
"Accept": "application/json",
"Content-Type": "application/json",
"Idempotency-Key": "editorial-calendar-001",
},
body: JSON.stringify({
"topic": "How to plan an editorial calendar",
"image": false,
"autoPublish": false,
"kind": "article",
"maxCredits": 40
}),
signal: AbortSignal.timeout(30_000),
});
const text = await response.text();
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${text}`);
}
const payload = JSON.parse(text);
console.log(JSON.stringify(payload, null, 2));
} catch (error) {
console.error(error instanceof Error ? error.message : String(error));
process.exitCode = 1;
}Node.js 20.20 or newer. Install the TypeScript tools once with: npm install -D typescript tsx @types/node
Save as request.ts and run: npx tsx request.ts
// Run on your server. Never put this key in browser code.
const key = process.env.BEULOG_PUBLISHING_KEY;
if (!key) throw new Error("Set BEULOG_PUBLISHING_KEY on your server");
try {
const response = await fetch("https://beulog.com/api/v1/generate", {
method: "POST",
headers: {
Authorization: `Bearer ${key}`,
"Accept": "application/json",
"Content-Type": "application/json",
"Idempotency-Key": "editorial-calendar-001",
},
body: JSON.stringify({
"topic": "How to plan an editorial calendar",
"image": false,
"autoPublish": false,
"kind": "article",
"maxCredits": 40
}),
signal: AbortSignal.timeout(30_000),
});
const text = await response.text();
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${text}`);
}
const payload: unknown = JSON.parse(text);
console.log(JSON.stringify(payload, null, 2));
} catch (error) {
console.error(error instanceof Error ? error.message : String(error));
process.exitCode = 1;
}
export {};Python 3.10 or newer. Uses only the standard library.
Save as request.py and run: python3 request.py
import json
import os
import sys
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
# Read the key from your server environment, never browser code.
key = os.environ.get("BEULOG_PUBLISHING_KEY")
if not key:
sys.exit("Set BEULOG_PUBLISHING_KEY on your server")
headers = {
"Authorization": f"Bearer {key}",
"Accept": "application/json",
"Content-Type": "application/json",
"Idempotency-Key": "editorial-calendar-001",
}
request = Request(
"https://beulog.com/api/v1/generate",
headers=headers,
method="POST",
data="{\"topic\":\"How to plan an editorial calendar\",\"image\":false,\"autoPublish\":false,\"kind\":\"article\",\"maxCredits\":40}".encode("utf-8"),
)
try:
with urlopen(request, timeout=30) as response:
payload = json.loads(response.read().decode("utf-8"))
print(json.dumps(payload, indent=2, ensure_ascii=False))
except HTTPError as error:
print(f"HTTP {error.code}: {error.read().decode('utf-8')}", file=sys.stderr)
sys.exit(1)
except (URLError, OSError, ValueError) as error:
print(f"Request failed: {error}", file=sys.stderr)
sys.exit(1)PHP 8.2 or newer with the cURL extension enabled.
Save as request.php and run: php request.php
<?php
// Run on your server; the key must never be embedded in browser code.
try {
$key = getenv('BEULOG_PUBLISHING_KEY');
if (!$key) {
throw new RuntimeException('Set BEULOG_PUBLISHING_KEY on your server');
}
$curl = curl_init('https://beulog.com/api/v1/generate');
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $key,
'Accept: application/json',
'Content-Type: application/json',
'Idempotency-Key: editorial-calendar-001',
],
CURLOPT_POSTFIELDS => '{"topic":"How to plan an editorial calendar","image":false,"autoPublish":false,"kind":"article","maxCredits":40}',
]);
$text = curl_exec($curl);
if ($text === false) {
throw new RuntimeException(curl_error($curl));
}
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($status < 200 || $status >= 300) {
throw new RuntimeException("HTTP $status: $text");
}
$payload = json_decode($text, true, 512, JSON_THROW_ON_ERROR);
echo json_encode($payload, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR) . PHP_EOL;
} catch (Throwable $error) {
fwrite(STDERR, $error->getMessage() . PHP_EOL);
exit(1);
}Ruby 3.1 or newer. Uses the standard net/http and json libraries.
Save as request.rb and run: ruby request.rb
require 'net/http'
require 'uri'
require 'json'
begin
# Read the key from your server environment, never browser code.
key = ENV.fetch('BEULOG_PUBLISHING_KEY')
raise 'Set BEULOG_PUBLISHING_KEY on your server' if key.empty?
uri = URI('https://beulog.com/api/v1/generate')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = "Bearer #{key}"
request['Accept'] = 'application/json'
request['Content-Type'] = 'application/json'
request['Idempotency-Key'] = 'editorial-calendar-001'
request.body = '{"topic":"How to plan an editorial calendar","image":false,"autoPublish":false,"kind":"article","maxCredits":40}'
response = Net::HTTP.start(
uri.host, uri.port, use_ssl: uri.scheme == 'https',
open_timeout: 10, read_timeout: 30, write_timeout: 30
) { |http| http.request(request) }
unless response.is_a?(Net::HTTPSuccess)
raise "HTTP #{response.code}: #{response.body}"
end
puts JSON.pretty_generate(JSON.parse(response.body))
rescue StandardError => error
warn "Request failed: #{error.message}"
exit 1
endGo 1.20 or newer. Uses only the standard library.
Save as request.go and run: go run request.go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"os"
"strings"
"time"
)
func run() error {
// Read the key from your server environment, never browser code.
key := os.Getenv("BEULOG_PUBLISHING_KEY")
if key == "" {
return fmt.Errorf("set BEULOG_PUBLISHING_KEY on your server")
}
request, err := http.NewRequest(
"POST", "https://beulog.com/api/v1/generate",
strings.NewReader("{\"topic\":\"How to plan an editorial calendar\",\"image\":false,\"autoPublish\":false,\"kind\":\"article\",\"maxCredits\":40}"),
)
if err != nil { return err }
request.Header.Set("Authorization", "Bearer " + key)
request.Header.Set("Accept", "application/json")
request.Header.Set("Content-Type", "application/json")
request.Header.Set("Idempotency-Key", "editorial-calendar-001")
client := &http.Client{Timeout: 30 * time.Second}
response, err := client.Do(request)
if err != nil { return err }
defer response.Body.Close()
text, err := io.ReadAll(response.Body)
if err != nil { return err }
if response.StatusCode < 200 || response.StatusCode >= 300 {
return fmt.Errorf("HTTP %d: %s", response.StatusCode, text)
}
var pretty bytes.Buffer
if err := json.Indent(&pretty, text, "", " "); err != nil { return err }
fmt.Println(pretty.String())
return nil
}
func main() {
if err := run(); err != nil {
fmt.Fprintln(os.Stderr, "Request failed:", err)
os.Exit(1)
}
}JDK 17 or newer. Uses the built-in HTTP client; no dependencies.
Save as RequestExample.java and run: java RequestExample.java
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
public class RequestExample {
public static void main(String[] args) {
try {
// Read the key from your server environment, never browser code.
String key = System.getenv("BEULOG_PUBLISHING_KEY");
if (key == null || key.isBlank()) {
throw new IllegalStateException("Set BEULOG_PUBLISHING_KEY on your server");
}
HttpClient client = HttpClient.newBuilder()
.connectTimeout(Duration.ofSeconds(10)).build();
HttpRequest request = HttpRequest.newBuilder(URI.create("https://beulog.com/api/v1/generate"))
.timeout(Duration.ofSeconds(30))
.header("Authorization", "Bearer " + key)
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.header("Idempotency-Key", "editorial-calendar-001")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"topic\":\"How to plan an editorial calendar\",\"image\":false,\"autoPublish\":false,\"kind\":\"article\",\"maxCredits\":40}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() < 200 || response.statusCode() >= 300) {
throw new IOException("HTTP " + response.statusCode() + ": " + response.body());
}
System.out.println(response.body());
} catch (Exception error) {
if (error instanceof InterruptedException) Thread.currentThread().interrupt();
System.err.println("Request failed: " + error.getMessage());
System.exit(1);
}
}
}Response fields
| Field | Type | What it means |
|---|---|---|
id | UUID | Generation job identifier. Use it with GET /jobs/{id}. |
status | "queued" | "running" | "completed" | "failed" | queued/running are pending; completed/failed are terminal. A research job may complete without an article_id. |
cost | integer (credits) | Reserved amount while pending; final charged amount after successful settlement. On failed jobs this stored value can remain the former reservation even though credits were refunded. |
reserved_credits | integer | null | Original credit reservation. Generation response falls back to cost for older jobs; job polling may return null for legacy jobs. |
settled_at | ISO 8601 date-time | null | Successful usage settlement timestamp; null before settlement and potentially on legacy or failed jobs. It is not a job completion timestamp. |
{
"id": "00000000-0000-4000-8000-000000000003",
"status": "queued",
"cost": 40,
"reserved_credits": 40,
"settled_at": null
}| Status | Meaning and next step |
|---|---|
200 | New queued job or existing idempotent job; the returned status may already be running/completed/failed on retry. |
400 | Invalid JSON/body fields or missing/overlong Idempotency-Key. |
402 | Insufficient credits for the current reservation. |
404 | Workspace or research brief not found. |
409 | Reservation exceeds maxCredits, or the workspace is archived. |
413 | Request body exceeds 300,000 bytes. |
401 | Missing, invalid or revoked API key, or the workspace owner's account is unverified. |
403 | Missing articles:generate permission, or the account requires billing review. |
429 | Request limit reached. Inspect Retry-After and back off. |
500 | Unexpected server error. Save X-Request-Id for support. |
503 | A required service is temporarily unavailable. Retry later. |
Check a generation job
GET /api/v1/jobs/{id}
Read generation progress, the result article ID and credit settlement fields.
Required permission: articles:generate
Poll with a delay while status is queued or running, and stop on completed or failed. Stage describes current work and is an informational string that may expand; do not assume a fixed progress percentage. A completed research job can have article_id=null; its brief is available in the workspace rather than this public endpoint.
When completed with article_id, fetch /articles/{article_id}. A draft result requires drafts=true and drafts:read. Failed generation returns a safe explanation in error and refunds the reservation. cost and reserved_credits can retain the former reservation on failed jobs; do not infer a charge solely from those fields.
Request parameters
| Parameter / location | Type | Required / default | Meaning and accepted values |
|---|---|---|---|
idURL path | UUID | Required | The job UUID returned by POST /generate. The job must belong to this key's workspace. |
If-None-MatchHeader | string | Optional | Optional exact ETag from a previous successful request to the same URL and key. A match returns 304 with no response body. |
Request examples — choose your language
Choose your language for the same request. Store your publishing key in the server environment variable BEULOG_PUBLISHING_KEY.
Bash and cURL 7.76 or newer. No extra libraries.
Save as request.sh and run: bash request.sh
#!/usr/bin/env bash
set -euo pipefail
# Set BEULOG_PUBLISHING_KEY in your server environment before running.
: "${BEULOG_PUBLISHING_KEY:?Set your server-side publishing key}"
# cURL returns a failure for HTTP errors and keeps the response body.
if response="$(curl --fail-with-body --silent --show-error \
--connect-timeout 10 --max-time 30 \
--request GET \
--header "Authorization: Bearer $BEULOG_PUBLISHING_KEY" \
--header 'Accept: application/json' \
'https://beulog.com/api/v1/jobs/00000000-0000-4000-8000-000000000003')"; then
printf '%s\n' "$response"
else
printf '%s\n' "$response" >&2
exit 1
fiNode.js 20.20 or newer, using its built-in fetch. No extra libraries.
Save as request.mjs and run: node request.mjs
// Run on your server. Never put this key in browser code.
const key = process.env.BEULOG_PUBLISHING_KEY;
if (!key) throw new Error("Set BEULOG_PUBLISHING_KEY on your server");
try {
const response = await fetch("https://beulog.com/api/v1/jobs/00000000-0000-4000-8000-000000000003", {
method: "GET",
headers: {
Authorization: `Bearer ${key}`,
"Accept": "application/json",
},
signal: AbortSignal.timeout(30_000),
});
const text = await response.text();
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${text}`);
}
const payload = JSON.parse(text);
console.log(JSON.stringify(payload, null, 2));
} catch (error) {
console.error(error instanceof Error ? error.message : String(error));
process.exitCode = 1;
}Node.js 20.20 or newer. Install the TypeScript tools once with: npm install -D typescript tsx @types/node
Save as request.ts and run: npx tsx request.ts
// Run on your server. Never put this key in browser code.
const key = process.env.BEULOG_PUBLISHING_KEY;
if (!key) throw new Error("Set BEULOG_PUBLISHING_KEY on your server");
try {
const response = await fetch("https://beulog.com/api/v1/jobs/00000000-0000-4000-8000-000000000003", {
method: "GET",
headers: {
Authorization: `Bearer ${key}`,
"Accept": "application/json",
},
signal: AbortSignal.timeout(30_000),
});
const text = await response.text();
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${text}`);
}
const payload: unknown = JSON.parse(text);
console.log(JSON.stringify(payload, null, 2));
} catch (error) {
console.error(error instanceof Error ? error.message : String(error));
process.exitCode = 1;
}
export {};Python 3.10 or newer. Uses only the standard library.
Save as request.py and run: python3 request.py
import json
import os
import sys
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
# Read the key from your server environment, never browser code.
key = os.environ.get("BEULOG_PUBLISHING_KEY")
if not key:
sys.exit("Set BEULOG_PUBLISHING_KEY on your server")
headers = {
"Authorization": f"Bearer {key}",
"Accept": "application/json",
}
request = Request(
"https://beulog.com/api/v1/jobs/00000000-0000-4000-8000-000000000003",
headers=headers,
method="GET",
)
try:
with urlopen(request, timeout=30) as response:
payload = json.loads(response.read().decode("utf-8"))
print(json.dumps(payload, indent=2, ensure_ascii=False))
except HTTPError as error:
print(f"HTTP {error.code}: {error.read().decode('utf-8')}", file=sys.stderr)
sys.exit(1)
except (URLError, OSError, ValueError) as error:
print(f"Request failed: {error}", file=sys.stderr)
sys.exit(1)PHP 8.2 or newer with the cURL extension enabled.
Save as request.php and run: php request.php
<?php
// Run on your server; the key must never be embedded in browser code.
try {
$key = getenv('BEULOG_PUBLISHING_KEY');
if (!$key) {
throw new RuntimeException('Set BEULOG_PUBLISHING_KEY on your server');
}
$curl = curl_init('https://beulog.com/api/v1/jobs/00000000-0000-4000-8000-000000000003');
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $key,
'Accept: application/json',
],
]);
$text = curl_exec($curl);
if ($text === false) {
throw new RuntimeException(curl_error($curl));
}
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($status < 200 || $status >= 300) {
throw new RuntimeException("HTTP $status: $text");
}
$payload = json_decode($text, true, 512, JSON_THROW_ON_ERROR);
echo json_encode($payload, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR) . PHP_EOL;
} catch (Throwable $error) {
fwrite(STDERR, $error->getMessage() . PHP_EOL);
exit(1);
}Ruby 3.1 or newer. Uses the standard net/http and json libraries.
Save as request.rb and run: ruby request.rb
require 'net/http'
require 'uri'
require 'json'
begin
# Read the key from your server environment, never browser code.
key = ENV.fetch('BEULOG_PUBLISHING_KEY')
raise 'Set BEULOG_PUBLISHING_KEY on your server' if key.empty?
uri = URI('https://beulog.com/api/v1/jobs/00000000-0000-4000-8000-000000000003')
request = Net::HTTP::Get.new(uri)
request['Authorization'] = "Bearer #{key}"
request['Accept'] = 'application/json'
response = Net::HTTP.start(
uri.host, uri.port, use_ssl: uri.scheme == 'https',
open_timeout: 10, read_timeout: 30, write_timeout: 30
) { |http| http.request(request) }
unless response.is_a?(Net::HTTPSuccess)
raise "HTTP #{response.code}: #{response.body}"
end
puts JSON.pretty_generate(JSON.parse(response.body))
rescue StandardError => error
warn "Request failed: #{error.message}"
exit 1
endGo 1.20 or newer. Uses only the standard library.
Save as request.go and run: go run request.go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"os"
"time"
)
func run() error {
// Read the key from your server environment, never browser code.
key := os.Getenv("BEULOG_PUBLISHING_KEY")
if key == "" {
return fmt.Errorf("set BEULOG_PUBLISHING_KEY on your server")
}
request, err := http.NewRequest(
"GET", "https://beulog.com/api/v1/jobs/00000000-0000-4000-8000-000000000003",
nil,
)
if err != nil { return err }
request.Header.Set("Authorization", "Bearer " + key)
request.Header.Set("Accept", "application/json")
client := &http.Client{Timeout: 30 * time.Second}
response, err := client.Do(request)
if err != nil { return err }
defer response.Body.Close()
text, err := io.ReadAll(response.Body)
if err != nil { return err }
if response.StatusCode < 200 || response.StatusCode >= 300 {
return fmt.Errorf("HTTP %d: %s", response.StatusCode, text)
}
var pretty bytes.Buffer
if err := json.Indent(&pretty, text, "", " "); err != nil { return err }
fmt.Println(pretty.String())
return nil
}
func main() {
if err := run(); err != nil {
fmt.Fprintln(os.Stderr, "Request failed:", err)
os.Exit(1)
}
}JDK 17 or newer. Uses the built-in HTTP client; no dependencies.
Save as RequestExample.java and run: java RequestExample.java
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
public class RequestExample {
public static void main(String[] args) {
try {
// Read the key from your server environment, never browser code.
String key = System.getenv("BEULOG_PUBLISHING_KEY");
if (key == null || key.isBlank()) {
throw new IllegalStateException("Set BEULOG_PUBLISHING_KEY on your server");
}
HttpClient client = HttpClient.newBuilder()
.connectTimeout(Duration.ofSeconds(10)).build();
HttpRequest request = HttpRequest.newBuilder(URI.create("https://beulog.com/api/v1/jobs/00000000-0000-4000-8000-000000000003"))
.timeout(Duration.ofSeconds(30))
.header("Authorization", "Bearer " + key)
.header("Accept", "application/json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() < 200 || response.statusCode() >= 300) {
throw new IOException("HTTP " + response.statusCode() + ": " + response.body());
}
System.out.println(response.body());
} catch (Exception error) {
if (error instanceof InterruptedException) Thread.currentThread().interrupt();
System.err.println("Request failed: " + error.getMessage());
System.exit(1);
}
}
}Response fields
| Field | Type | What it means |
|---|---|---|
id | UUID | Generation job identifier. Use it with GET /jobs/{id}. |
status | "queued" | "running" | "completed" | "failed" | queued/running are pending; completed/failed are terminal. A research job may complete without an article_id. |
cost | integer (credits) | Reserved amount while pending; final charged amount after successful settlement. On failed jobs this stored value can remain the former reservation even though credits were refunded. |
reserved_credits | integer | null | Original credit reservation. Generation response falls back to cost for older jobs; job polling may return null for legacy jobs. |
settled_at | ISO 8601 date-time | null | Successful usage settlement timestamp; null before settlement and potentially on legacy or failed jobs. It is not a job completion timestamp. |
stage | string | Current processing stage, such as queued, researching, writing, reviewing, image, saving, completed or failed. Treat additional stages as valid. |
error | string | null | Safe failure explanation, or null when there is no recorded error. |
article_id | UUID | null | Created article identifier when available. Null while pending, for research jobs, or if the linked article was deleted. |
{
"id": "00000000-0000-4000-8000-000000000003",
"status": "completed",
"stage": "completed",
"error": null,
"article_id": "00000000-0000-4000-8000-000000000002",
"cost": 18,
"reserved_credits": 40,
"settled_at": "2026-10-01T09:03:00.000Z"
}| Status | Meaning and next step |
|---|---|
200 | Current job state and result reference; a failed generation job still returns HTTP 200 with status=failed. |
304 | The exact If-None-Match value matches this GET response. No body; use the previously stored response. |
400 | Job ID is not a valid UUID. |
404 | Job not found in this key's workspace. |
401 | Missing, invalid or revoked API key, or the workspace owner's account is unverified. |
403 | The key does not have the required permission. |
429 | Request limit reached. Inspect Retry-After and back off. |
500 | Unexpected server error. Save X-Request-Id for support. |
503 | A required service is temporarily unavailable. Retry later. |
Read articles and follow every page
The default article list contains published articles from this key’s workspace, newest first by creation time and ID. A successful empty list means no matching published articles; it does not mean the key failed. Do not silently replace an API error with an empty list.
| Parameter | Accepted value and behavior |
|---|---|
limit | Integer 1–100; default 20. |
cursor | Copy pagination.next_cursor exactly and URL-encode it. Maximum 1,000 characters. Keep the same workspace and drafts filter. Stop when next_cursor is null. |
offset | Legacy integer offset, 0–100,000; default 0. Prefer cursors. Do not combine a cursor with a nonzero offset. |
drafts=true | Includes drafts as well as published articles; requires both articles:read and drafts:read. Omitting it keeps the default published-only behavior. |
See the full article list response and examples in eight languages.
The response has data and pagination. Read each item in data, then follow pagination.next_cursor until it is null. has_more indicates whether another page exists; next_offset is only for the legacy offset flow. Do not decode, edit, or manufacture cursors. Restart a list from the first page if its cursor is rejected.
See the single article request and response reference.
Replace the ID with an article UUID from data. Read data[0] in the successful detail response; the API does not return a bare article object. A draft or an article from another workspace is unavailable to a published-only key.
What an article response contains
Complete article response field reference
Both article endpoints return this object inside the data array. [] means an array; a dot indicates a nested property. Fields marked nullable may contain null. The API can add fields, so your integration should tolerate additional properties.
| Field | Type | Meaning and use |
|---|---|---|
id | UUID | Stable article identifier. Pair it with workspace_id for imports. |
workspace_id | UUID | Workspace that owns this article. |
schema_version | string: "1.1" | Article export schema version; separate from API version 1.2. |
revision | string | Opaque digest of the full article export, including rendered data from workspace settings. Compare for changes; do not treat it as the sync manifest revision. |
version | integer | Saved article edit version. Workspace setting changes can change revision without changing this number. |
status | "published" | "draft" | Published articles are returned by default. Drafts require drafts=true and drafts:read. |
title | string | Saved article title used to identify the article in listings. |
slug | string | Saved URL slug. This is not accepted instead of a UUID in /articles/{id}. |
language | "en" | "ar" | "es" | "fr" | "de" | Language stored for the article; seo.language is the resolved export language. |
translation_group_id | UUID | null | Optional association between complete language editions; null means no translation group. |
created_at | ISO 8601 date-time | Article creation timestamp, used for article list ordering. |
updated_at | ISO 8601 date-time | Most recent saved article update timestamp, used for sync ordering. |
published_at | ISO 8601 date-time | null | Publication timestamp; may be null for drafts. |
canonical_url | string | null | Saved canonical override. seo.canonical resolves this or the workspace website and article path. |
image_url | string | null | Cover image address, or null when no image exists. |
image_width | integer | null | Stored cover width in pixels, or null if unavailable. |
image_height | integer | null | Stored cover height in pixels, or null if unavailable. |
html | string | Escaped semantic article body fragment: heading, takeaways, contents, sections, FAQs, citations and optional image. Render on the server as a native page. |
head_html | string | Ready-to-render title, meta tags, canonical and safely serialized JSON-LD. Use this or map seo/json_ld through your framework; using both duplicates metadata. |
reading_minutes | integer | Estimated reading duration, at least one minute, based on 200 words per minute. |
quality | string[] | Saved article quality issues or review notes. An empty array means no saved issues. |
generation_warnings | string[] | null | Optional warnings saved during generation. Review them before publication. |
publishing_checks[] | { label: string, passed: boolean } | Readiness checks for metadata, images, canonical, publisher, structure, citations and internal links; these are guidance, not ranking guarantees. |
references[] | object[] | Sources for this article. Each has id, title and url, and may have publisher and accessedAt. sourceIds in sections refer to these IDs. |
references_json | object[] | The stored source array is also included by the current export. Prefer references for integrations. |
content.title | string | Editable article heading; used in rendered HTML and BlogPosting.headline. |
content.slug | string | Editable slug stored inside the content. |
content.excerpt | string | Short introduction displayed below the article heading; fallback for empty metaDescription. |
content.category | string | Editorial category rendered above the heading and as articleSection in structured data. |
content.metaTitle | string | Editable search title. Empty values fall back to content.title in seo.title. |
content.metaDescription | string | Editable search description. Empty values fall back to content.excerpt in seo.description. |
content.keywords | string[] | Topic keywords; serialized as comma-separated keywords in BlogPosting. |
content.takeaways | string[] | Key reader takeaways rendered as a list near the beginning. |
content.sections[] | object[] | Ordered sections, each with heading, summary, paragraphs, bullets and sourceIds. |
content.sections[].subsections[] | object[] (optional) | Nested headings and paragraph arrays. Older articles may omit this field. |
content.sections[].steps | string[] (optional) | Ordered practical steps rendered as a numbered list. |
content.sections[].table | object | null (optional) | caption, columns (string[]) and rows (string[][]); null means no comparison table. |
content.sections[].callout | object | null (optional) | Highlighted title and text; null means no callout. |
content.faqs[] | { question: string, answer: string }[] | Reader questions and answers, also used to build FAQPage structured data. |
content.imagePrompt | string | Saved instructions used to create the cover image, if requested. |
content.imageAlt | string | Accessible cover description used for HTML alt, social image alt and structured data image caption. |
content.imageCaption | string (optional) | Visible caption below the cover image; omitted on some legacy articles. |
content.searchIntent | string (optional) | Intended reader question or search goal; editorial context rather than an HTML meta tag. |
content.reviewNotes | string[] (optional) | Editorial review observations saved with the content. |
content.recommendedPublish | boolean | Generation recommendation only; status determines whether the article is actually published. |
seo.title | string | Resolved page title from metaTitle or content.title. |
seo.description | string | Resolved search description from metaDescription or content.excerpt. |
seo.robots | string | Published pages use index, follow, max-image-preview:large; drafts use noindex, nofollow. |
seo.canonical | string | null | Resolved full canonical URL; null means no valid canonical was configured. |
seo.language | "en" | "ar" | "es" | "fr" | "de" | Resolved language for HTML and structured data. |
seo.openGraph | object | Article social metadata: type, title, description, url, siteName, locale, images, publishedTime and modifiedTime. URLs/times can be null. |
seo.openGraph.images[] | { url, alt, width, height }[] | Cover image objects; [] when no valid cover image. Width and height can be null. |
seo.twitter | object | card, title, description, image and imageAlt. card is summary_large_image with a cover, otherwise summary; image can be null. |
json_ld | object | Schema.org @context and @graph containing BlogPosting, optional BreadcrumbList and FAQPage. Render safely once, consistently with the visible article. |
publishing_checks[].label | string | Human-readable name of a readiness check. |
publishing_checks[].passed | boolean | Whether that individual readiness condition is met. |
references[].id | string | Source identifier used by section sourceIds and rendered citations. |
references[].title | string | Source page title shown in the references list. |
references[].url | string | Source URL; the renderer includes only safe HTTPS source links. |
references[].publisher | string (optional) | Source publisher's name when recorded. |
references[].accessedAt | string (optional) | Recorded source access timestamp when available. |
content.sections[].heading | string | Section heading, rendered as h2 and in the table of contents. |
content.sections[].summary | string | Optional text within the required summary field; an empty value renders no summary paragraph. |
content.sections[].paragraphs | string[] | Main paragraphs in their display order. |
content.sections[].bullets | string[] | Unordered list items; an empty array renders no bullet list. |
content.sections[].sourceIds | string[] | IDs of entries in references cited at the end of this section. |
content.sections[].subsections[].heading | string | Subsection heading rendered as h3. |
content.sections[].subsections[].paragraphs | string[] | Paragraphs displayed below the subsection heading. |
content.sections[].table.caption | string | Accessible caption for the table. |
content.sections[].table.columns | string[] | Header labels, in column order. |
content.sections[].table.rows | string[][] | Table rows; each inner array holds cell values in column order. |
content.sections[].callout.title | string | Heading of a highlighted editorial note. |
content.sections[].callout.text | string | Text of the highlighted note. |
content.faqs[].question | string | Question displayed in an expandable details summary. |
content.faqs[].answer | string | Answer shown below the question and in FAQPage structured data. |
seo.openGraph.type | string: "article" | Social object type for article sharing. |
seo.openGraph.title | string | Resolved social title, matching seo.title. |
seo.openGraph.description | string | Resolved social description, matching seo.description. |
seo.openGraph.url | string | null | Canonical social URL, matching seo.canonical. |
seo.openGraph.siteName | string | Workspace publisherName, falling back to workspace name. |
seo.openGraph.locale | "en_US" | "ar_SA" | "es_ES" | "fr_FR" | "de_DE" | Social locale derived from the resolved article language. |
seo.openGraph.images[].url | string | Safe HTTPS cover image URL. |
seo.openGraph.images[].alt | string | Cover description from content.imageAlt. |
seo.openGraph.images[].width | integer | null | Cover width in pixels when stored. |
seo.openGraph.images[].height | integer | null | Cover height in pixels when stored. |
seo.openGraph.publishedTime | ISO 8601 date-time | null | Normalized article publication timestamp. |
seo.openGraph.modifiedTime | ISO 8601 date-time | null | Normalized article update timestamp. |
seo.twitter.card | "summary" | "summary_large_image" | Uses summary_large_image when a safe cover URL exists; otherwise summary. |
seo.twitter.title | string | Resolved social card title. |
seo.twitter.description | string | Resolved social card description. |
seo.twitter.image | string | null | Safe cover image URL, or null without an image. |
seo.twitter.imageAlt | string | Cover description from content.imageAlt. |
json_ld.@context | string: "https://schema.org" | Vocabulary used by the structured data graph. |
json_ld.@graph | object[] | BlogPosting plus BreadcrumbList when canonical/site URLs exist, and FAQPage when FAQ entries exist. Optional properties depend on available article and workspace values. |
| Field | How to use it |
|---|---|
id, slug, title, status | Use id as the stable source identity, slug for your URL mapping, and status to enforce published-only public pages. Store the connected workspace ID with the article. |
revision | Opaque export change token. Compare it with the previous export revision to skip unchanged content. It includes exported content and publishing settings; an article version number alone is insufficient. |
html | Semantic article body fragment with its own article element, H1, sections, links, image alt text, references, and language/direction. It is not a complete HTML document. |
head_html | Ready-made title, description, robots, canonical when available, social metadata, and JSON-LD for a server-rendered document head. Use this OR your framework’s metadata mapping. |
seo | Structured title, description, canonical, robots, language, openGraph, and twitter fields for your framework. canonical may be null if a final address has not been configured. |
json_ld | Structured data graph generated from the article and workspace settings. Keep author, publisher, language, dates, images, citations, and URL consistent with the visible page. |
content | Editable structured content, including imageAlt and imageCaption, sections, takeaways, and FAQs. Use this when building a custom article layout instead of the supplied html. |
image_url, image_width, image_height | Cover URL and dimensions when available. Preserve accurate dimensions and alt text when replacing the image component; do not invent missing values. |
publishing_checks, reading_minutes, schema_version | Export checks, estimated reading time, and content format version. Checks help review the export; they do not certify your site or guarantee search ranking. |
Import with the TypeScript client
Download the client and keep it in a server-only module. It uses native fetch and AbortSignal.timeout; use a current server runtime with those APIs. The client rejects browser use. Pass the application origin https://beulog.com to its constructor; it adds /api/v1 itself.
- Create a BeulogClient with https://beulog.com and your server environment key. Call connection() and verify workspace.id against the workspace you expect.
- Iterate client.articles() with a for await loop; the client follows each cursor for you. Store every article by its stable ID and connected workspace ID.
- Implement an upsert in your database or CMS: update an existing source ID or insert it once. Keep that write on your server and report failures before advancing the sync checkpoint.
client.articles() follows cursor pagination and yields published articles. client.article(id) returns data[0]. The downloadable client also exposes connection(), pricing(), generate(), and job(). For drafts, the sync feed, or conditional ETag requests, use the documented HTTP endpoints directly; the client does not expose those options.
Make your local import idempotent: use a unique key such as (workspace_id, article_id), update the existing row when its export revision changes, and refresh the rendered page and sitemap after a successful update. Define how to preserve any edits made directly on your own site.
Keep your website in sync
For regular updates, /sync is a small change-discovery feed. It returns IDs, titles, and manifest revisions, not article HTML. Fetch a complete article only when its manifest revision is new or changed. Run this in a scheduled server task, not once per visitor.
| Parameter | Accepted value and behavior |
|---|---|
limit | Integer 1–100; default 50. |
since | Previously saved checkpoint, as the exact ISO date-time string returned by the API. Omit for the first full scan. |
settings_revision | Save with checkpoint and send with since. If publishing settings changed, or the value is absent/mismatched, the API starts a full scan. |
cursor | Exact pagination.next_cursor from this scan, URL-encoded; maximum 2,000 characters. It preserves this scan’s time boundary. A 400 response means restart this scan. |
- Start without since/settings_revision, or load the pair from the last fully completed scan. Confirm workspace_id matches your expected workspace.
- For each returned item, compare its manifest revision with your stored manifest revision for that article. Fetch changed items from GET /articles/{id}, then upsert the complete export in your local store.
- Save the local article and its processed manifest revision together, only after a successful import. Keep export revision and manifest revision in separate fields; they are different tokens and cannot be compared with each other.
- Continue using pagination.next_cursor until it is null. Keep the prior saved checkpoint if a page or import fails. Retrying already processed articles must be safe.
- After every page and import succeeds, save the returned checkpoint and settings_revision as one pair. For a durable queue, advance only after all pages’ work is safely queued and retryable. Do not use your own machine’s current time as the next checkpoint.
Open the complete sync parameters, JSON response, and eight language examples.
The feed deliberately overlaps the previous checkpoint by five minutes to reduce missed updates around database commits. Duplicate IDs are expected: deduplicate by source ID and manifest revision. A settings change invalidates an in-progress cursor; restart from the last saved checkpoint/settings pair, allow the resulting full scan, and upsert safely.
Render the article and metadata
Give each article a permanent, public URL on your website. Render the article in the server response or at build time so the text, links, and metadata are available without a browser making an authenticated API call. Google recommends server rendering or pre-rendering because it helps users and crawlers, and some bots do not execute JavaScript. Google’s JavaScript SEO guidance.
Choose one metadata approach
- Traditional server template: insert head_html into the document’s head and html into the body. Keep the template’s charset and viewport tags. Do not escape the supplied fragments into visible text, or put head_html inside the article body.
- Framework metadata: map seo into your framework’s metadata API and render json_ld once. Render html in the page body. Do not also insert head_html, because it already contains title, meta tags, canonical, and JSON-LD.
In Next.js, map seo.title, seo.description, seo.robots, and seo.canonical through the route’s server-side generateMetadata function. Map seo.openGraph and seo.twitter to social metadata, including image dimensions and alt text when available. Use the same article revision for the page and its metadata.
Render article.html in a server template or Server Component. Serialize article.json_ld once into a script with type application/ld+json; escape less-than characters as \u003c before inserting JSON into HTML. The supplied fragment already contains the article element and H1. Accept fragments only from your authenticated integration and apply your website’s content trust policy.
Set the document language from seo.language and use RTL for Arabic. Preserve the article’s own lang and dir attributes. If you build from content instead, recreate accessible headings, real links, descriptive image alternatives, tables, and references. Keep your site navigation and a useful next step around the article without adding a second H1 for the same article.
Make native pages ready for discovery
- Match the canonical to the real page. Website plus Article address pattern generates the default canonical; an article’s Published article URL overrides it. Confirm it is the final HTTPS article URL on your domain, not the API URL or an iframe. Fix a missing or incorrect canonical before launch. Avoid conflicting canonical tags from your template or SEO plugin.
- Use accurate page and social information. Review SEO title and SEO description in the article editor. Keep one title, a useful description, and consistent Open Graph/Twitter image information. Search engines may choose a different title or snippet; metadata is a description, not a ranking promise.
- Keep images useful and fast. Use the article’s imageAlt to describe the visible image and preserve known width/height. Provide responsive compressed images through your own image pipeline when appropriate. Load the visible article cover promptly and lazy-load images farther down the page. A custom image layout must retain the original meaning and accessible alternatives.
- Keep structured data truthful. Use the real author or credited organization and an accessible author profile when available. Configure your own publication’s brand and website as publisher; Beulog is the software provider, not automatically the publisher of your website’s articles. Keep language, article URL, dates, and images aligned with what readers see. Preserve useful source citations. Do not add invented ratings, authors, or claims, or expect markup alone to produce rich results.
- Make articles easy to discover. Link to them from a native blog index and relevant pages using normal links with clear anchor text. Include only current, canonical published URLs in your sitemap. If you publish real translations, use separate language URLs and reciprocal hreflang; do not point to a translation that does not exist.
- Keep public pages reachable. Published pages intended for search should return useful content with HTTP 200, without a login or unintended noindex. Check robots.txt and your hosting/CDN rules. Expose the article pages to crawlers, not your secret API key. Use private access controls and noindex for draft previews.
Google’s AI Overviews and AI Mode use the same SEO foundations; Google specifies no separate AI schema or special AI file requirement. An eligible page must be indexed and available for a search snippet. Useful original content and accessible native pages help discovery, but neither API use nor metadata guarantees a ranking or an AI citation. Google’s AI features guidance.
Follow the complete publishing, Google, and AI search checklist. It covers crawl permissions for search and AI providers, Search Console checks, page experience, and content review.
Handle unpublishing and missing articles
Unpublishing or deleting an article in Beulog removes it from new published-only API requests. It does not delete a copy already imported into your website. Decide how quickly your website must reflect removals, and implement that policy explicitly.
- For immediate confirmation of a known article, request GET /articles/{id} with the published-only key. A 404 means it is unavailable through that workspace/key; hide its public copy according to your policy. A 401, 403, 429, timeout, or 5xx is not proof of deletion.
- For periodic reconciliation, complete a fresh scan of all published articles and compare IDs against local imports from the same verified workspace. Only act on absence after every page succeeds. Do not mass-remove content after a partial scan or a connection error. Where removals are consequential, confirm missing IDs individually before changing their public state.
- For a genuinely missing public page, return a real 404 or 410 and remove it from your sitemap/internal links. Redirect permanently only when a relevant replacement actually exists; do not redirect every removed article to the home page.
- Purge or refresh your own page, CDN, and build caches after updates and removals. Keep a clear slug-change policy, including a permanent redirect from an old URL when the same article moves. A network failure should follow your outage policy, not look like an empty successful article.
In Next.js, use notFound() for a confirmed missing resource and verify the final HTTP status in production. Return an appropriate temporary service error for an upstream outage. Avoid sending page content before the resource check if doing so would turn a missing page into a streamed 200 response.
Errors, retries, and request IDs
| Header | Value / type | Meaning |
|---|---|---|
Content-Type | application/json | Successful 200 and error responses use JSON. A 304 response has no body. |
X-API-Version | string: "1.2" | Response contract version. The URL continues to use /api/v1. |
X-Request-Id | UUID | Unique request identifier; include it when contacting support about a failed request. |
ETag | quoted string | Returned on successful GET requests. Send the exact value in If-None-Match to receive 304 when the complete response is unchanged. |
Cache-Control | string: "no-store" | Do not rely on shared HTTP caches for workspace data. Store an authenticated copy in your own integration if needed. |
Vary | string: "Authorization" | Responses depend on the workspace API key. |
Retry-After | string: "60" (429 only) | Wait at least 60 seconds before retrying a rate-limited request. The account generation window lasts one hour and may require a longer wait. |
| Field | Type | Meaning |
|---|---|---|
error | string | Human-readable English explanation. Do not parse its wording to decide your application behavior. |
code | string | Stable category: invalid_request, unauthorized, forbidden, not_found, insufficient_credits, conflict, rate_limited, unavailable or internal_error. HTTP 413 currently uses internal_error. |
{
"error": "This key needs the articles:read permission.",
"code": "forbidden"
}API errors use a JSON body with error (the explanation) and code (the stable machine-readable category). Responses include X-Request-Id for troubleshooting; log the status, code, endpoint, and request ID on your server without logging the key. Keep that request ID when contacting support. v1 responses also identify X-API-Version.
| Status / code | What to do |
|---|---|
400 invalid_request | Check UUIDs, query limits, JSON, and Idempotency-Key. Restart a rejected cursor scan; do not repeatedly send the same invalid request. |
401 unauthorized | Check the Bearer key, selected workspace, account verification, and whether the key was revoked. Do not expose the key while debugging. |
402 insufficient_credits | Generation has insufficient credits. Review the balance before trying again; reading published articles does not create a generation job. |
403 forbidden | Check the required scope and account restrictions. Draft reading needs drafts:read in addition to articles:read; generation needs articles:generate. |
404 not_found | Check the endpoint and UUID. For an article, confirm the workspace and whether it is still published. Handle a confirmed missing article on your own site. |
409 conflict | For generation, the current reservation may exceed maxCredits. Re-read /pricing and approve a new spending limit deliberately rather than automatically raising it. |
429 rate_limited | Honor Retry-After, slow down, and use bounded retries. Limits are 120 API requests per minute per key and 20 generation requests per hour per account. |
500 / 502 / 503 / 504 | Treat service/network failures as temporary. Retry with a delay and a limit, retain a safe prior checkpoint, and alert if failures persist. Do not interpret them as unpublished content. |
The supplied client attempts up to three HTTP requests for 429, 502, 503, and 504, using a numeric Retry-After or short exponential delay capped at 60 seconds. It throws BeulogError with status, code, and requestId after an unsuccessful response. Network exceptions and timeouts need your own bounded retry handling. Retrying generation must reuse the original Idempotency-Key.
Caching and conditional requests
Authenticated API responses use Cache-Control: no-store and vary by Authorization. Keep any deliberate local content store private to the integration and namespace it by workspace. GET responses provide ETag; a direct HTTP client can send the same value in If-None-Match. On 304, reuse your stored response and do not parse a JSON body. The downloadable TypeScript client does not implement this conditional flow.
Optional: generate an article safely
Reading and displaying articles does not require generation permission. If you want a server workflow to create articles too, create a separate key with Create new articles enabled. Never give this key to visitors. It can reserve and spend your account’s credits.
| Field | Accepted value and behavior |
|---|---|
topic | String, at most 1,500 characters; defaults to an empty string. Set a clear topic for an intentional job. |
image | Boolean; default true. Set false to request an article without a generated image. |
autoPublish | Boolean; default false. Keep false for editorial review before making the article available to public integrations. |
kind | article or research; default article. The downloadable client’s generate() helper creates article jobs; use direct HTTP for research jobs. |
maxCredits | Optional integer 1–1,000,000. A reservation above this ceiling returns 409 without reserving credits. Use current /pricing and your own approved limit. |
researchId | Optional UUID of an existing research brief in the same workspace. Use direct HTTP; the downloadable client does not expose this field. |
Send an Idempotency-Key header of 1–128 characters. Persist one unique value for each intended job before submitting, and reuse it for retries with the same publishing key. The same key/value returns the existing job instead of reserving credits again; it does not apply changed input to that existing job. A new intended job needs a new value.
1. Check pricing · 2. Submit a generation job · 3. Check the job response — each request includes eight language examples and detailed response fields.
- Read /pricing before submission. The article, article_with_image, and research values are maximum reservations, not a promise of the final charge.
- Save the job ID from POST /generate. Poll GET /jobs/{id} with the generation key on a scheduled delay, such as every 10–30 seconds, with a time limit and backoff; do not poll in a tight loop.
- Continue while status is queued or running. Stop when it is completed or failed. On failure, record the error and request ID; do not automatically submit a new charged job. On completion, article_id identifies the result of an article job.
- With autoPublish:false, review the draft in Beulog and publish it when ready. The normal read-only key cannot fetch it until then. A private preview workflow needs articles:read plus drafts:read and the direct ?drafts=true endpoint.
- reserved_credits is the reservation; cost is the reservation while pending and the final charge after successful completion; settled_at records settlement. Unused reserved credits are returned after successful completion, and failed jobs are fully refunded. Failed jobs can retain their former reservation in cost and reserved_credits, so those fields alone do not prove a charge.
Check your integration before launch
- Connection returns the intended verified workspace and only the scopes you need; no publishing key appears in page source, browser requests, or public bundles.
- A test published article appears once at its final native URL. Its text, one article H1, image alternatives, references, language, and metadata are present in the server-rendered response.
- The final page has the intended canonical, no unintended noindex, no duplicate metadata/schema, and working social images. Check its structured data with Google’s Rich Results Test and inspect the live URL in Search Console.
- More than one page of articles imports correctly. Re-running an import creates no duplicates. An edit and a publishing-settings change update the local article and its metadata.
- A draft stays private. Unpublishing a test article follows your removal policy and cache refresh. A genuinely missing URL returns 404/410; an API outage does not masquerade as an empty successful page.
- Cursor restarts, rate limits, invalid/revoked keys, timeouts, and failed generation jobs are visible in server monitoring with request IDs and without secrets.
Open Rich Results Test · Open Google Search Console · Continue with the publishing SEO guide