PATCH
/api/public/v1/blog-posts/{postId}

Update a blog post

Publishing stamps `publishedAt` the first time and leaves it alone afterwards, so editing a live post does not rewrite when it went out. Unpublishing clears it — the post is a draft again and has no publish date. Changing the slug changes the public URL, and the old one stops resolving.

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

Path Parameters

NameTypeRequiredDescription
postIdstringRequiredPost ID.

Request Body

PropertyTypeDescription
titlestring
slugstringChanges the public URL.
contentstring
excerptstring
authorstring
isPublishedboolean
PATCHExample request
curl
curl -X PATCH "https://www.pxb.app/api/public/v1/blog-posts/{postId}" \
  -H "Authorization: Bearer your_access_token" \
  -H "Content-Type: application/json" \
  -d '{
    "isPublished": true
  }'
200Example response
json
{
  "message": "Blog post updated 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"
    }
  }
}

In the console

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

Website → Blog
/website/blog