# M7 Blog Service API

The M7 Blog Service manages publications, editorial content, taxonomy, media,
domains, redirects, revisions, and public read models. Use the protected
endpoints to operate a publication; use the public read endpoints to render
published content in a website or application.

Manage publications and editorial content in the
[M7 Blog Service control panel](https://blog.service.m7.org/).

## Base URL

```text
https://api.blog.service.m7.org/v1
```

## Authentication and publication access

Protected endpoints require an authenticated bearer token:

```http
Authorization: Bearer ACCESS_TOKEN
Content-Type: application/json
```

Publication workspace operations require the effective principal's actual
publication membership. Current role defaults or selected member capabilities,
role limits, and lifecycle rules bound the actions of Owners, Admins, and Members.
For an org workspace, Blog also resolves verified Management tag names through
its current capability catalogue and intersects those grants with the org's publication access.
See [organization tag profiles](https://m7.org/docs/api/api.blog.service.m7.org/authorization.md#organization-management-tag-profiles)
for empty versus unknown selections, name/slug separation, and independent
ownership protections. Creating a publication requires `publication.create`
and the identity and organization gates. See [workspaces](https://m7.org/docs/api/api.blog.service.m7.org/workspaces.md)
for Personal and organization selection.

Most protected routes need a publication selector. Supply exactly one when the
resource ID does not already determine the publication:

```json
{ "publication_id": "PUBLICATION_UUID" }
```

```json
{ "publication_slug": "engineering-notes" }
```

Public read routes do not require a token, but only expose active, unarchived
publications and their eligible content.

## Response envelope

JSON endpoints return an application envelope. HTTP status indicates request
transport and authorization status; inspect `status` before using `data`.

```json
{
  "status": 1,
  "comment": "post loaded",
  "data": {}
}
```

On an application error, `status` is `0`; `comment` is safe to show to a user;
and `data.code` is the HTTP status. Expect `400` for invalid input, `401` for a
missing token on a protected route, `403` for insufficient publication access,
`404` for an unavailable resource, `409` for a conflicting lifecycle or
uniqueness state, and `503` when required receiver authorization or a capability
catalogue is unavailable.

`/read/feed` and `/read/sitemap` are the exceptions: they stream XML instead
of this JSON envelope.

## Pagination

List endpoints accept these optional fields:

| Field | Type | Behavior |
| --- | --- | --- |
| `limit` | Integer | Defaults to `50`; values above `200` are capped. |
| `cursor` | String | Opaque cursor from a prior `next_cursor`; takes precedence over the other position fields. |
| `offset` | Integer | Zero-based offset; used when `cursor` is absent. |
| `page_number` | Integer | One-based page number; used when `cursor` and `offset` are absent. |

A paginated result includes `items`, `limit`, `total_count`, `next_offset`,
`page_number`, `page_total`, and `next_cursor`. Some routes also include a
named compatibility array such as `posts`; use `items` in new integrations.

## Guides

- [Authorization](https://m7.org/docs/api/api.blog.service.m7.org/authorization.md)
- [Publication management](https://m7.org/docs/api/api.blog.service.m7.org/publication-route-family.md)
- [Publication context](https://m7.org/docs/api/api.blog.service.m7.org/context-route.md)
- [Identity and organization workspaces](https://m7.org/docs/api/api.blog.service.m7.org/workspaces.md)
- [Publication membership and capabilities](https://m7.org/docs/api/api.blog.service.m7.org/members.md)
- [Publication member detail](https://m7.org/docs/api/api.blog.service.m7.org/member-get-route.md)
- [Posts and editorial workflow](https://m7.org/docs/api/api.blog.service.m7.org/post-route-family.md)
- [Pages](https://m7.org/docs/api/api.blog.service.m7.org/page-route-family.md)
- [Authors](https://m7.org/docs/api/api.blog.service.m7.org/author-route-family.md)
- [Categories](https://m7.org/docs/api/api.blog.service.m7.org/category-route-family.md)
- [Tags](https://m7.org/docs/api/api.blog.service.m7.org/tag-route-family.md)
- [Post author and tag assignments](https://m7.org/docs/api/api.blog.service.m7.org/post-author-tag-integration.md)
- [Post category assignment](https://m7.org/docs/api/api.blog.service.m7.org/post-category-integration.md)
- [Media](https://m7.org/docs/api/api.blog.service.m7.org/media-route-family.md)
- [Domains](https://m7.org/docs/api/api.blog.service.m7.org/domain-route-family.md)
- [Redirects](https://m7.org/docs/api/api.blog.service.m7.org/redirect-route-family.md)
- [Revisions](https://m7.org/docs/api/api.blog.service.m7.org/revision-route-family.md)
- [Imports](https://m7.org/docs/api/api.blog.service.m7.org/import-route-family.md)
- [Production synchronization](https://m7.org/docs/api/api.blog.service.m7.org/production-sync.md)
- [Exports](https://m7.org/docs/api/api.blog.service.m7.org/export-route-family.md)
- [Public read API](https://m7.org/docs/api/api.blog.service.m7.org/public-read-route-family.md)

- [Publication invitations, applications and notifications](https://m7.org/docs/api/api.blog.service.m7.org/relationship-access.md)
