POST
/api/public/v1/blog-posts

Create a blog post

`slug` is what the public URL uses and is unique per location, so a duplicate is a conflict rather than a second post. Creating with `isPublished: true` stamps `publishedAt` and the post is live on the location’s site immediately — leave it out to write a draft.

Required scope

The access token must carry this scope. A token missing it gets 403 Forbidden. Grant them to an API client under Settings → Company → API, and to a teammate under Employee → Permissions.

blog:write

Request Body

PropertyTypeDescription
locationIdstringWhose blog.
titlestring
slugstringLowercase, hyphen-separated. Unique per location.
contentstringThe body.
excerptstringShown in the list.
authorstringA byline, free text.
isPublishedbooleanDefaults to false — a draft.
POSTExample request
curl
curl -X POST "https://www.pxb.app/api/public/v1/blog-posts" \
  -H "Authorization: Bearer your_access_token" \
  -H "Content-Type: application/json" \
  -d '{
    "locationId": "loc_abc123",
    "title": "Why we changed our opening hours",
    "slug": "why-we-changed-our-opening-hours",
    "content": "From September we open at ten…",
    "isPublished": true
  }'
200Example response
json
{
  "message": "Blog post created successfully!",
  "content": {
    "post": {
      "id": "bpt_7001",
      "locationId": "loc_abc123",
      "title": "Why we changed our opening hours",
      "slug": "why-we-changed-our-opening-hours",
      "excerpt": "Shorter mornings, longer evenings.",
      "content": "From September we open at ten…",
      "coverImagePath": null,
      "author": "Sam Okafor",
      "isPublished": true,
      "publishedAt": "2026-08-20T09:00:00.000Z",
      "createdAt": "2026-08-19T14:00:00.000Z",
      "updatedAt": "2026-08-20T09:00:00.000Z"
    }
  }
}
409Example response
json
{
  "message": "A post with that slug already exists at this location."
}

In the console

The same thing done by hand, for anyone comparing the API against the screen they already use.

Website → Blog
/website/blog
  1. Open Blog.
  2. New post.