# Concepts

## Workspace, brands and channels

A **workspace** is a customer account. It has **members** with a role: owner, editor or approver. A key or an OAuth
connection is bound to one workspace and acts as one person with their current role.

A workspace has one or more **brands** (a business or a profession's public face). A brand has **channels**: the
connected social accounts, such as a Facebook Page, an Instagram account, a YouTube channel, a TikTok account, a
LinkedIn profile or Page. A channel's `platform` is one of `facebook`, `instagram`, `threads`, `youtube`,
`linkedin_member`, `linkedin_org` and `tiktok`. A platform that is still waiting for its approval is not listed until it opens.

Every id belongs to a workspace. An id from another workspace, or one that does not exist, is the same answer: 404
`not_found`.

## Capabilities

Each channel comes with `capabilities`: the formats it takes, the media rules, the text and title limits, and the
`options` it accepts, with allowed values and which are required. They come from the same code as the Postaki composer.
The [platform pages](https://postaki.io/docs/platform-youtube/) list them. For TikTok, `GET /channels/{id}/options` also reads the
account's own settings right now (privacy levels, comments, duet, stitch, longest video), and a post is checked against
them.

## Posts and copies

A **post** is what you create: a text, optional media, a time, and a list of `channels`. For each channel it holds a
**copy** (the API calls it a variant): the version for that channel, with its own text (`text`), first comment
(`first_comment`) and `options`. A channel's own text replaces the post text for that channel.

A copy has a `status`:

| Status | Meaning |
|---|---|
| `draft` | Saved, not yet sent for approval |
| `awaiting_approval` | Waiting for a person |
| `needs_confirmation` | Waiting for a person to confirm whether it went out (the platform's answer was unclear) |
| `approved`, `scheduled` | A person approved it; it goes out at the scheduled time |
| `publishing` | Being sent now |
| `sent` | On the platform (`external_url` says where) |
| `failed`, `expired`, `needs_reconnect` | It did not go out; `last_error` says why |
| `deleted` | Taken down from the channel by a person; the content stays in Postaki |

## Approval

Nothing is published without an approval record: who approved, when, on which device, and a fingerprint of the content.
Only a person can make one, in the Postaki app, and only a person who has the right to approve.

- `POST /posts` with `"submit": true` (or `POST /posts/{id}/submit`) moves the copies to `awaiting_approval`, and the
  approvers are told in the app, by email and by push, with a link. A scheduled time in the future is needed.
- Editing a post that was already approved sends it back to `awaiting_approval`: the person approves what they see.
- The post and each copy show `approval`: `state` (`none`, `awaiting`, `approved`), when and from which source.
- Every post says how it was made: `created_via` (`web`, `api` or `mcp`) and `created_by` (for example "API key
  'Zapier'" or "OAuth: Claude"), and the approver sees it on the approval screen.

## Declared AI content

`ai_generated` is required on every post made through the API and MCP, no default. `true` sets the platforms' AI labels
(TikTok AI-generated content, YouTube altered or synthetic content, Meta and LinkedIn labels where they exist) on every
copy. Declaring AI content honestly is the customer's duty and, in the EU, a legal one (AI Act, Article 50, from
2 August 2026).

## Media

Photos and videos are uploaded first and then referenced by id in `media_ids`. See [Media](https://postaki.io/docs/media/). Every upload
needs `rights_confirmed: true`: the file is yours, or you may publish it.

## Deleting

- `DELETE /posts/{id}` deletes a post that was never approved or sent.
- `POST /posts/{id}/delete-published` takes sent copies down from their channels where the platform allows it, and
  records who did it, that it came from the API or MCP, and which key or app. It needs the approver role and an explicit
  `"confirm": true` in the body (the MCP tool takes `confirm: true`): it is public and cannot be undone, so an agent has to
  say it means it, and should do it only when the user asked.

## Times

Times are RFC 3339 with an offset. Output is in UTC with `Z`. A time without an offset is 422 `naive_datetime`.

## Pagination

Lists return `{"items": [...], "next_cursor": "..."}`. Pass `next_cursor` back as `cursor`. `limit` is up to 100 (the
MCP tools use 20 by default and 50 at most). `next_cursor` is `null` on the last page.
