API
Bear has a small API for managing your posts, blog settings, and media. It's available on upgraded blogs.
Getting started
Head to your dashboard → Settings → API and generate a key. Each key works for one blog, and you can regenerate or revoke it there whenever you like.
Your API lives at https://bearblog.dev/YOUR-SUBDOMAIN/api/v1/ (use your Bear subdomain here, even if you have a custom domain). Send your key with every request:
Authorization: Bearer YOUR-API-KEY
Request bodies are JSON, so include Content-Type: application/json when creating or updating. File uploads are the one exception.
Keep your key private. Anyone who has it can edit your blog.
Posts
GET post/lists your posts, including drafts and pages.POST post/creates a post.GET post/UID/fetches a post.PATCH post/UID/updates a post. Only the fields you send are changed.DELETE post/UID/deletes a post for good.
A post's uid never changes, even if its slug does.
Fields
title: required when creating. Up to 200 characters.content: Markdown/HTML/LaTeX.slug: made from the title if you leave it out. Slugs get tidied up, and duplicates get a suffix, so use the one that comes back.publish:trueorfalse. Posts are drafts by default.published_date: a date with a timezone, like2026-09-11T12:00:00+02:00. A future date on a published post schedules it. Drafts without a date get one when they're published.tags: a list of strings.is_page:trueorfalse.discoverable:trueto opt the post into the discovery feed. Off by default.alias,canonical_url,meta_description,meta_image,class_name,lang: the same as the editor's header options.
Responses also include uid, url, and last_modified. Dates come back in UTC.
Drafts also include a token. Add ?token=TOKEN to the url for a preview link anyone can open.
Listing
Lists come back 20 at a time, newest first, without content (fetch a single post for that). You get posts, count, page, page_size, and next_page, which is null on the last page.
page: which page to fetch. Starts at 1.status:draft,published, orscheduled. Leave it out for everything.is_page:trueorfalse. Leave it out for both posts and pages.
Blog
GET blog/fetches your blog's settings.PATCH blog/updates them. Only the fields you send are changed.
Fields
titlecontent: your home page, in Markdown/HTML/LaTeX.faviconmeta_description,meta_imagenav: navigation links, in Markdown.custom_styles: your theme's CSS.robots_txtdate_format: for exampled M, Y.
Responses also include last_modified.
Media
GET media/lists your files.POST media/uploads a file.GET media/ID/fetches a file's details.DELETE media/ID/deletes a file for good.
Uploading
Uploads are multipart/form-data instead of JSON: one file per request, in a field called file. The supported file types and the 10 MB size limit are the same as the media page in your dashboard. An upload has to finish sending within about 20 seconds, so on a slow connection keep files smaller.
Images are shrunk to 1200px wide and converted to WebP, just like in the dashboard (GIFs and SVGs are left alone). Add a raw field set to true to keep the original size and format.
File names get tidied up, and duplicates get a suffix, so use the url that comes back.
Fields
Responses include id, url, name, type, tags, and created_at. Tags are the ones you've set in the dashboard.
Listing
Lists come back 100 at a time, newest first. You get media, count, page, page_size, and next_page, which is null on the last page.
page: which page to fetch. Starts at 1.type:image,video,audio,document, orfont. Leave it out for everything.
Examples
# List drafts
curl 'https://bearblog.dev/YOUR-SUBDOMAIN/api/v1/post/?status=draft' \
-H 'Authorization: Bearer YOUR-API-KEY'
# Create a draft
curl -X POST 'https://bearblog.dev/YOUR-SUBDOMAIN/api/v1/post/' \
-H 'Authorization: Bearer YOUR-API-KEY' \
-H 'Content-Type: application/json' \
-d '{"title":"Hello from the API","content":"A **Markdown** draft.","tags":["api"]}'
# Publish it
curl -X PATCH 'https://bearblog.dev/YOUR-SUBDOMAIN/api/v1/post/UID/' \
-H 'Authorization: Bearer YOUR-API-KEY' \
-H 'Content-Type: application/json' \
-d '{"publish":true}'
# Update the home page
curl -X PATCH 'https://bearblog.dev/YOUR-SUBDOMAIN/api/v1/blog/' \
-H 'Authorization: Bearer YOUR-API-KEY' \
-H 'Content-Type: application/json' \
-d '{"content":"Welcome to my blog."}'
# Upload an image
curl -X POST 'https://bearblog.dev/YOUR-SUBDOMAIN/api/v1/media/' \
-H 'Authorization: Bearer YOUR-API-KEY' \
-F 'file=@photo.jpg'
# Delete a post
curl -X DELETE 'https://bearblog.dev/YOUR-SUBDOMAIN/api/v1/post/UID/' \
-H 'Authorization: Bearer YOUR-API-KEY'
Errors and limits
When something goes wrong you get a message like {"error":"title is required"}, and nothing is saved.
400: something in the request isn't right. The message says what.401: the key is missing or wrong.403: the blog isn't upgraded.404: that post, file, or path doesn't exist.413: the file is too big.429: slow down a little. You get 60 requests a minute and 100 uploads a day, and theRetry-Afterheader says how many seconds to wait.502: the file couldn't be stored or deleted. Nothing changed, so try again.