Polyblog API 1.0.0
Public REST API for Polyblog. Authenticate with an API key (HTTP Basic, the key as the username) or an operator access token. Each key carries a set of scopes that gate which resources it may read or write.
https://www.polyblog.io
apiKey— API key as HTTP Basic credentials: Authorization: Basic base64(apiKey)accessToken— Operator access token: Authorization: Token <token>
Articles
GET/api/articles
List articles
Lists the articles of a blog. Requires the articles:read scope. Anonymous (unauthenticated) callers only ever see published articles; drafts are visible only to an API key or operator token of the owning organization.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
blogId required |
query | string | |
locale |
query | string | |
published |
query | boolean | |
slug |
query | string | |
limit |
query | integer default 0 | |
skip |
query | integer default 0 |
Responses
| Status | Meaning |
|---|---|
200 | A list of articles |
401 | Missing or invalid credentials |
403 | API key is missing the articles:read scope |
429 | API key rate limit exceeded |
POST/api/articles
Create or update an article
Creates an article (or updates one when the body carries an existing _id). Requires the articles:write scope. Fires the article.created webhook.
Request body application/json
| Field | Type | Description |
|---|---|---|
blogId |
string | |
title |
string | |
content |
string | |
slug |
string | |
locale |
string | |
published |
boolean |
Responses
| Status | Meaning |
|---|---|
200 | The created or updated article |
401 | Missing or invalid credentials |
403 | API key is missing the articles:write scope |
429 | API key rate limit exceeded |
GET/api/articles/{idOrSlug}
Get an article
Returns a single article by id or slug. Requires the articles:read scope. An article belonging to another organization responds 404 so ids cannot be probed. Anonymous callers can only read a published article; a draft responds 404 unless the caller is an API key or operator token of the owning organization.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idOrSlug required |
path | string |
Responses
| Status | Meaning |
|---|---|
200 | The article |
404 | Not found (or owned by another organization / unpublished) |
POST/api/articles/generate
Generate an article with AI
Generates (and by default publishes) an SEO article for a blog. Requires the articles:write scope. Fires the article.created webhook when the generated article is persisted.
Responses
| Status | Meaning |
|---|---|
200 | The generated article and metadata |
403 | API key is missing the articles:write scope |
DELETE/api/articles/{articleId}
Delete an article
Deletes an article. Requires the articles:write scope. An article owned by another organization responds 404. Fires the article.deleted webhook.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
articleId required |
path | string |
Responses
| Status | Meaning |
|---|---|
200 | The deleted article id |
404 | Not found (or owned by another organization) |
Blogs
GET/api/blogs
List blogs
Lists the blogs of your organization. Requires the blogs:read scope.
Responses
| Status | Meaning |
|---|---|
200 | A list of blogs |
403 | API key is missing the blogs:read scope |
POST/api/blogs
Create a blog
Creates a blog for your organization. Requires the blogs:write scope. Fires the blog.created webhook.
Responses
| Status | Meaning |
|---|---|
200 | The created blog |
403 | API key is missing the blogs:write scope |
PUT/api/blogs/{blogId}
Update a blog
Updates a blog owned by your organization. Requires the blogs:write scope.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
blogId required |
path | string |
Responses
| Status | Meaning |
|---|---|
200 | The updated blog |
403 | Not your organization's blog, or missing the blogs:write scope |
Other
GET/blogs
get blog details
returns a blog details
Parameters
| Name | In | Type | Description |
|---|---|---|---|
blogId required |
path | string |
Responses
| Status | Meaning |
|---|---|
200 | blog details |
Topics
GET/api/topics
List topic ideas
Lists the topic ideas of a blog you own. Requires the topics:read scope.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
blogId required |
query | string |
Responses
| Status | Meaning |
|---|---|
200 | The topic ideas |
403 | API key is missing the topics:read scope |
Webhook subscriptions
GET/api/webhooksubscriptions
List webhook subscriptions
Webhook subscriptions deliver article.created, article.updated, article.deleted, blog.created and contact.created events to your server as signed POST requests (X-Polyblog-Signature: t=<timestamp>,v1=<hex HMAC-SHA256 of "timestamp.body">). An endpoint failing 20 times in a row is disabled automatically. Subscriptions are managed with an operator access token; the secret is only returned once, on create.
Responses
| Status | Meaning |
|---|---|
200 | Array of webhook subscriptions (without secrets) |
POST/api/webhooksubscriptions
Create a webhook subscription
Pass a blogId to receive only that blog's events, or omit it for an organization-wide subscription. The response includes the signing secret exactly once — store it; it cannot be retrieved again.
Request body application/json
| Field | Type | Description |
|---|---|---|
blogId |
string | |
url required |
string | |
events |
array | Empty array subscribes to all events |
Responses
| Status | Meaning |
|---|---|
200 | The created subscription, including its secret |
PUT/api/webhooksubscriptions/{webhookSubscriptionId}
Update a webhook subscription
url, events and active are editable; the secret, organization and blog are immutable. Re-enabling an auto-disabled endpoint is done by setting active back to true.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
webhookSubscriptionId required |
path | string |
Responses
| Status | Meaning |
|---|---|
200 | The updated subscription (without secret) |
DELETE/api/webhooksubscriptions/{webhookSubscriptionId}
Delete a webhook subscription
Parameters
| Name | In | Type | Description |
|---|---|---|---|
webhookSubscriptionId required |
path | string |
Responses
| Status | Meaning |
|---|---|
200 | Deleted |