---
title: "Publishing API"
description: "Manage outgoing posts and connected publishing accounts"
canonical_url: https://reelmirror.com/docs/api/publishing
markdown_url: https://reelmirror.com/docs/api/publishing.md
last_updated: 2026-11-09
---
# ReelMirror API reference: Publishing

> Manage outgoing posts and connected publishing accounts

The ReelMirror API is in beta. Base URL: `https://reelmirror.com/api` (every path starts with `/v1`). Authenticate every request with `Authorization: Bearer rm_...`. Machine-readable contract: https://reelmirror.com/docs/openapi.json.

## Endpoints

- [List publishing targets](https://reelmirror.com/docs/api/publishing#list-publishing-targets): `GET /v1/personas/{persona_id}/publishing-targets`
- [Add publishing target](https://reelmirror.com/docs/api/publishing#add-publishing-target): `POST /v1/personas/{persona_id}/publishing-targets`
- [Remove publishing target](https://reelmirror.com/docs/api/publishing#remove-publishing-target): `DELETE /v1/personas/{persona_id}/publishing-targets/{target_id}`
- [Get OAuth connect URL](https://reelmirror.com/docs/api/publishing#get-publishing-connect-url): `GET /v1/publishing/accounts/connect`
- [Get account slots](https://reelmirror.com/docs/api/publishing#get-publishing-slots): `GET /v1/publishing/accounts/slots`
- [Purchase account slots](https://reelmirror.com/docs/api/publishing#purchase-publishing-slots): `POST /v1/publishing/accounts/slots`
- [List connected accounts](https://reelmirror.com/docs/api/publishing#list-publishing-accounts): `GET /v1/publishing/accounts`
- [Get account health](https://reelmirror.com/docs/api/publishing#get-publishing-account-health): `GET /v1/publishing/accounts/{id}`
- [Disconnect account](https://reelmirror.com/docs/api/publishing#disconnect-publishing-account): `DELETE /v1/publishing/accounts/{id}`
- [List outgoing posts](https://reelmirror.com/docs/api/publishing#list-outgoing-posts): `GET /v1/publishing/posts`
- [Create outgoing post](https://reelmirror.com/docs/api/publishing#create-outgoing-post): `POST /v1/publishing/posts`
- [Get outgoing post](https://reelmirror.com/docs/api/publishing#get-outgoing-post): `GET /v1/publishing/posts/{id}`
- [Update outgoing post](https://reelmirror.com/docs/api/publishing#update-outgoing-post): `PATCH /v1/publishing/posts/{id}`
- [Delete outgoing post](https://reelmirror.com/docs/api/publishing#delete-outgoing-post): `DELETE /v1/publishing/posts/{id}`
- [Publish now](https://reelmirror.com/docs/api/publishing#publish-outgoing-post): `POST /v1/publishing/posts/{id}/publish`
- [Schedule post](https://reelmirror.com/docs/api/publishing#schedule-outgoing-post): `POST /v1/publishing/posts/{id}/schedule`
- [Retry publish](https://reelmirror.com/docs/api/publishing#retry-outgoing-post): `POST /v1/publishing/posts/{id}/retry`
- [Cancel scheduled post](https://reelmirror.com/docs/api/publishing#cancel-outgoing-post): `POST /v1/publishing/posts/{id}/cancel`
- [Generate caption](https://reelmirror.com/docs/api/publishing#generate-caption): `POST /v1/publishing/caption`

### List publishing targets

`GET /v1/personas/{persona_id}/publishing-targets`

Scope: `publishing:read` · Operation ID: `listPublishingTargets`

List connected publishing accounts linked to a persona. These determine where auto-published content is delivered. Requires `publishing:read` scope.

#### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `persona_id` | string | Yes |  |

#### Response 200

List of publishing targets

Fields inside `data`:

- `id` (string, uuid; optional)
- `connected_account_id` (string, uuid; optional)
- `platform` (string, one of `instagram`, `tiktok`; optional)
- `username` (string; optional)
- `status` (string, one of `active`, `expired`, `error`; optional)
- `created_at` (string, date-time; optional)

#### Example request

```bash
curl "https://reelmirror.com/api/v1/personas/$PERSONA_ID/publishing-targets" \
  -H "Authorization: Bearer $REELMIRROR_API_KEY"
```

### Add publishing target

`POST /v1/personas/{persona_id}/publishing-targets`

Scope: `publishing:write` · Operation ID: `addPublishingTarget`

Link a connected publishing account to a persona. The account must already be connected via OAuth (dashboard). Requires `publishing:write` scope.

#### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `persona_id` | string | Yes |  |

#### Request body (application/json, required)

- `connected_account_id` (string, uuid; required): ID of a connected publishing account from `GET /v1/publishing/accounts`

#### Response 201

Publishing target linked

Fields inside `data`:

- `id` (string, uuid; optional)
- `connected_account_id` (string, uuid; optional)
- `platform` (string, one of `instagram`, `tiktok`; optional)
- `username` (string; optional)
- `status` (string, one of `active`, `expired`, `error`; optional)
- `created_at` (string, date-time; optional)

Errors: `409` return the standard error envelope.

#### Example request

```bash
curl -X POST "https://reelmirror.com/api/v1/personas/$PERSONA_ID/publishing-targets" \
  -H "Authorization: Bearer $REELMIRROR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "connected_account_id": "8f14e45f-ceea-4e7a-9c2d-3b1a5f2e7c10"
}'
```

### Remove publishing target

`DELETE /v1/personas/{persona_id}/publishing-targets/{target_id}`

Scope: `publishing:write` · Operation ID: `removePublishingTarget`

Unlink a publishing account from a persona. Requires `publishing:write` scope.

#### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `persona_id` | string | Yes |  |
| `target_id` | string | Yes |  |

#### Response 200

Publishing target removed

Fields inside `data`:

- `id` (string; optional)
- `deleted` (boolean, one of `true`; optional)

#### Example request

```bash
curl -X DELETE "https://reelmirror.com/api/v1/personas/$PERSONA_ID/publishing-targets/$TARGET_ID" \
  -H "Authorization: Bearer $REELMIRROR_API_KEY"
```

### Get OAuth connect URL

`GET /v1/publishing/accounts/connect`

Scope: `publishing:write` · Operation ID: `getPublishingConnectUrl`

Generate an OAuth URL to connect a new (or reconnect an existing) social account. Requires `publishing:write` scope.

The OAuth provider will redirect the user's browser to `/api/internal/publishing/accounts/callback` after authorization — this is not a JSON callback.

#### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `platform` | string, one of `instagram`, `tiktok` | Yes | Social platform to connect. Note: TikTok support is in alpha. |
| `accountId` | string, uuid | No | ID of an existing connected account to reconnect. Omit for a new connection. |

#### Response 200

OAuth authorization URL

Fields inside `data`:

- `auth_url` (string; required): Redirect the user to this URL to authorize the connection

Errors: `400`, `402` return the standard error envelope.

#### Example request

```bash
curl "https://reelmirror.com/api/v1/publishing/accounts/connect?platform=value" \
  -H "Authorization: Bearer $REELMIRROR_API_KEY"
```

### Get account slots

`GET /v1/publishing/accounts/slots`

Scope: `publishing:read` · Operation ID: `getPublishingSlots`

Return the number of purchased, used, and available account slots. Requires `publishing:read` scope.

#### Response 200

Slot allocation

Fields inside `data`:

- `purchased` (integer; required)
- `used` (integer; required)
- `available` (integer; required)
- `subscriptionId` (string | null; required)

#### Example request

```bash
curl "https://reelmirror.com/api/v1/publishing/accounts/slots" \
  -H "Authorization: Bearer $REELMIRROR_API_KEY"
```

### Purchase account slots

`POST /v1/publishing/accounts/slots`

Scope: `publishing:write` · Operation ID: `purchasePublishingSlots`

Set the total number of purchased account slots. Creates, updates, or cancels the Stripe subscription accordingly. Returns a `checkoutUrl` when no payment method is on file. Requires `publishing:write` scope.

#### Request body (application/json, required)

- `slots` (integer, ≥ 0; required): Total number of paid slots to set
- `returnUrl` (string; optional): Path to redirect to after Stripe Checkout (used when no card is on file)

#### Response 200

Updated slot allocation, or a Stripe Checkout URL when no payment method is on file

Fields inside `data`:

- `purchased` (integer; required)
- `subscriptionId` (string | null; required)
- `checkoutUrl` (string | null; optional): Stripe Checkout URL when payment collection is needed

Errors: `400` return the standard error envelope.

#### Example request

```bash
curl -X POST "https://reelmirror.com/api/v1/publishing/accounts/slots" \
  -H "Authorization: Bearer $REELMIRROR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "slots": 1
}'
```

### List connected accounts

`GET /v1/publishing/accounts`

Authentication: bearer token · Operation ID: `listPublishingAccounts`

List all publishing accounts (Instagram, TikTok (alpha)) connected to your profile.

#### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | integer, ≤ 100, default 20 | No |  |
| `offset` | integer, default 0 | No |  |

#### Response 200

Connected publishing accounts

- `data` (array of object; optional)
  - `id` (string, uuid; optional)
  - `platform` (string, one of `instagram`, `tiktok`; optional)
  - `username` (string; optional)
  - `status` (string, one of `active`, `expired`, `error`; optional): `active` = token valid; `expired` = token expired, reconnect needed; `error` = connection error
  - `created_at` (string, date-time; optional)
- `count` (integer; optional): Total number of connected accounts

#### Example request

```bash
curl "https://reelmirror.com/api/v1/publishing/accounts" \
  -H "Authorization: Bearer $REELMIRROR_API_KEY"
```

### Get account health

`GET /v1/publishing/accounts/{id}`

Authentication: bearer token · Operation ID: `getPublishingAccountHealth`

Check the health/status of a connected publishing account.

#### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes |  |

#### Response 200

Account health

Fields inside `data`:

- object: Account health information

#### Example request

```bash
curl "https://reelmirror.com/api/v1/publishing/accounts/$ID" \
  -H "Authorization: Bearer $REELMIRROR_API_KEY"
```

### Disconnect account

`DELETE /v1/publishing/accounts/{id}`

Authentication: bearer token · Operation ID: `disconnectPublishingAccount`

Disconnect a publishing account from your profile.

#### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes |  |

#### Response 200

Account disconnected

Fields inside `data`:

- `id` (string; optional)
- `deleted` (boolean, one of `true`; optional)

#### Example request

```bash
curl -X DELETE "https://reelmirror.com/api/v1/publishing/accounts/$ID" \
  -H "Authorization: Bearer $REELMIRROR_API_KEY"
```

### List outgoing posts

`GET /v1/publishing/posts`

Authentication: bearer token · Operation ID: `listOutgoingPosts`

List all outgoing posts for your account, including media items and delivery statuses.

#### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | integer, ≤ 100, default 20 | No |  |
| `offset` | integer, default 0 | No |  |

#### Response 200

List of outgoing posts

- `data` (array of object; optional)
  - `id` (string, uuid; optional)
  - `persona_id` (string | null, uuid; optional)
  - `caption` (string | null; optional)
  - `status` (string, one of `draft`, `scheduled`, `publishing`, `published`, `failed`, `cancelled`; optional)
  - `scheduled_for` (string | null, date-time; optional)
  - `platform_settings` (object | null; optional)
  - `items` (array of object; optional)
    - `id` (string, uuid; optional)
    - `generated_media_item_id` (string, uuid; optional)
    - `position` (integer; optional)
    - `use_voice_converted` (boolean; optional)
  - `deliveries` (array of object; optional): One delivery per target publishing account. Check all deliveries to determine overall publish outcome.
    - `id` (string, uuid; optional)
    - `connected_account_id` (string, uuid; optional)
    - `platform` (string, one of `instagram`, `tiktok`; optional)
    - `username` (string; optional)
    - `status` (string, one of `pending`, `publishing`, `published`, `failed`; optional): Terminal states: `published` (success) and `failed` (permanent error). Poll until terminal.
    - `platform_post_id` (string | null; optional): Platform-assigned post ID after successful publish
    - `error_message` (string | null; optional): Error detail when status is `failed`
    - `published_at` (string | null, date-time; optional)
  - `created_at` (string, date-time; optional)
  - `updated_at` (string, date-time; optional)
- `count` (integer; optional): Total number of outgoing posts

#### Example request

```bash
curl "https://reelmirror.com/api/v1/publishing/posts" \
  -H "Authorization: Bearer $REELMIRROR_API_KEY"
```

### Create outgoing post

`POST /v1/publishing/posts`

Authentication: bearer token · Operation ID: `createOutgoingPost`

Create a draft outgoing post with media items and target publishing accounts.

#### Request body (application/json, required)

- `persona_id` (string, uuid; optional)
- `caption` (string; optional)
- `items` (array of object; required): Media items to include in the post
  - `generated_media_item_id` (string, uuid; required)
  - `position` (integer; required)
  - `use_voice_converted` (boolean; optional)
- `target_account_ids` (array of string; optional)
- `platform_settings` (object; optional)

#### Response 201

Outgoing post created

Fields inside `data`:

- `id` (string, uuid; optional)
- `persona_id` (string | null, uuid; optional)
- `caption` (string | null; optional)
- `status` (string, one of `draft`, `scheduled`, `publishing`, `published`, `failed`, `cancelled`; optional)
- `scheduled_for` (string | null, date-time; optional)
- `platform_settings` (object | null; optional)
- `items` (array of object; optional)
  - `id` (string, uuid; optional)
  - `generated_media_item_id` (string, uuid; optional)
  - `position` (integer; optional)
  - `use_voice_converted` (boolean; optional)
- `deliveries` (array of object; optional): One delivery per target publishing account. Check all deliveries to determine overall publish outcome.
  - `id` (string, uuid; optional)
  - `connected_account_id` (string, uuid; optional)
  - `platform` (string, one of `instagram`, `tiktok`; optional)
  - `username` (string; optional)
  - `status` (string, one of `pending`, `publishing`, `published`, `failed`; optional): Terminal states: `published` (success) and `failed` (permanent error). Poll until terminal.
  - `platform_post_id` (string | null; optional): Platform-assigned post ID after successful publish
  - `error_message` (string | null; optional): Error detail when status is `failed`
  - `published_at` (string | null, date-time; optional)
- `created_at` (string, date-time; optional)
- `updated_at` (string, date-time; optional)

#### Example request

```bash
curl -X POST "https://reelmirror.com/api/v1/publishing/posts" \
  -H "Authorization: Bearer $REELMIRROR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "items": [
    {
      "generated_media_item_id": "8f14e45f-ceea-4e7a-9c2d-3b1a5f2e7c10",
      "position": 1
    }
  ]
}'
```

### Get outgoing post

`GET /v1/publishing/posts/{id}`

Authentication: bearer token · Operation ID: `getOutgoingPost`

#### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes |  |

#### Response 200

Outgoing post with items and deliveries

Fields inside `data`:

- `id` (string, uuid; optional)
- `persona_id` (string | null, uuid; optional)
- `caption` (string | null; optional)
- `status` (string, one of `draft`, `scheduled`, `publishing`, `published`, `failed`, `cancelled`; optional)
- `scheduled_for` (string | null, date-time; optional)
- `platform_settings` (object | null; optional)
- `items` (array of object; optional)
  - `id` (string, uuid; optional)
  - `generated_media_item_id` (string, uuid; optional)
  - `position` (integer; optional)
  - `use_voice_converted` (boolean; optional)
- `deliveries` (array of object; optional): One delivery per target publishing account. Check all deliveries to determine overall publish outcome.
  - `id` (string, uuid; optional)
  - `connected_account_id` (string, uuid; optional)
  - `platform` (string, one of `instagram`, `tiktok`; optional)
  - `username` (string; optional)
  - `status` (string, one of `pending`, `publishing`, `published`, `failed`; optional): Terminal states: `published` (success) and `failed` (permanent error). Poll until terminal.
  - `platform_post_id` (string | null; optional): Platform-assigned post ID after successful publish
  - `error_message` (string | null; optional): Error detail when status is `failed`
  - `published_at` (string | null, date-time; optional)
- `created_at` (string, date-time; optional)
- `updated_at` (string, date-time; optional)

#### Example request

```bash
curl "https://reelmirror.com/api/v1/publishing/posts/$ID" \
  -H "Authorization: Bearer $REELMIRROR_API_KEY"
```

### Update outgoing post

`PATCH /v1/publishing/posts/{id}`

Authentication: bearer token · Operation ID: `updateOutgoingPost`

Update caption, platform settings, or other mutable fields on a draft post.

#### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes |  |

#### Request body (application/json)

- `caption` (string; optional)
- `platform_settings` (object; optional)

#### Response 200

Post updated

Fields inside `data`:

- `id` (string, uuid; optional)
- `persona_id` (string | null, uuid; optional)
- `caption` (string | null; optional)
- `status` (string, one of `draft`, `scheduled`, `publishing`, `published`, `failed`, `cancelled`; optional)
- `scheduled_for` (string | null, date-time; optional)
- `platform_settings` (object | null; optional)
- `items` (array of object; optional)
  - `id` (string, uuid; optional)
  - `generated_media_item_id` (string, uuid; optional)
  - `position` (integer; optional)
  - `use_voice_converted` (boolean; optional)
- `deliveries` (array of object; optional): One delivery per target publishing account. Check all deliveries to determine overall publish outcome.
  - `id` (string, uuid; optional)
  - `connected_account_id` (string, uuid; optional)
  - `platform` (string, one of `instagram`, `tiktok`; optional)
  - `username` (string; optional)
  - `status` (string, one of `pending`, `publishing`, `published`, `failed`; optional): Terminal states: `published` (success) and `failed` (permanent error). Poll until terminal.
  - `platform_post_id` (string | null; optional): Platform-assigned post ID after successful publish
  - `error_message` (string | null; optional): Error detail when status is `failed`
  - `published_at` (string | null, date-time; optional)
- `created_at` (string, date-time; optional)
- `updated_at` (string, date-time; optional)

#### Example request

```bash
curl -X PATCH "https://reelmirror.com/api/v1/publishing/posts/$ID" \
  -H "Authorization: Bearer $REELMIRROR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Delete outgoing post

`DELETE /v1/publishing/posts/{id}`

Authentication: bearer token · Operation ID: `deleteOutgoingPost`

#### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes |  |

#### Response 200

Post deleted

Fields inside `data`:

- `id` (string; optional)
- `deleted` (boolean, one of `true`; optional)

#### Example request

```bash
curl -X DELETE "https://reelmirror.com/api/v1/publishing/posts/$ID" \
  -H "Authorization: Bearer $REELMIRROR_API_KEY"
```

### Publish now

`POST /v1/publishing/posts/{id}/publish`

Authentication: bearer token · Operation ID: `publishOutgoingPost`

Immediately publish an outgoing post to all configured accounts.

#### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes |  |

#### Response 200

Publishing started

Fields inside `data`:

- `status` (string; optional)

#### Example request

```bash
curl -X POST "https://reelmirror.com/api/v1/publishing/posts/$ID/publish" \
  -H "Authorization: Bearer $REELMIRROR_API_KEY"
```

### Schedule post

`POST /v1/publishing/posts/{id}/schedule`

Authentication: bearer token · Operation ID: `scheduleOutgoingPost`

Schedule an outgoing post for a future time.

#### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes |  |

#### Request body (application/json, required)

- `scheduled_for` (string, date-time; required): ISO 8601 datetime to publish at
- `timezone` (string, default "UTC"; optional): IANA timezone name (e.g. America/New_York)

#### Response 200

Post scheduled

Fields inside `data`:

- `status` (string; optional)

#### Example request

```bash
curl -X POST "https://reelmirror.com/api/v1/publishing/posts/$ID/schedule" \
  -H "Authorization: Bearer $REELMIRROR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "scheduled_for": "2026-09-30T17:00:00.000Z"
}'
```

### Retry publish

`POST /v1/publishing/posts/{id}/retry`

Authentication: bearer token · Operation ID: `retryOutgoingPost`

Retry publishing a post that previously failed.

#### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes |  |

#### Response 200

Retry started

Fields inside `data`:

- `status` (string; optional)

#### Example request

```bash
curl -X POST "https://reelmirror.com/api/v1/publishing/posts/$ID/retry" \
  -H "Authorization: Bearer $REELMIRROR_API_KEY"
```

### Cancel scheduled post

`POST /v1/publishing/posts/{id}/cancel`

Authentication: bearer token · Operation ID: `cancelOutgoingPost`

Cancel a scheduled outgoing post before it is published.

#### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes |  |

#### Response 200

Post cancelled

Fields inside `data`:

- `status` (string; optional)

#### Example request

```bash
curl -X POST "https://reelmirror.com/api/v1/publishing/posts/$ID/cancel" \
  -H "Authorization: Bearer $REELMIRROR_API_KEY"
```

### Generate caption

`POST /v1/publishing/caption`

Authentication: bearer token · Operation ID: `generateCaption`

AI-generate a publishing caption from one or more generated media items, matching the persona's writing style.

#### Request body (application/json, required)

- `generated_media_item_ids` (array of string; required)
- `persona_id` (string, uuid; optional)

#### Response 200

Generated caption

Fields inside `data`:

- `caption` (string; optional)

#### Example request

```bash
curl -X POST "https://reelmirror.com/api/v1/publishing/caption" \
  -H "Authorization: Bearer $REELMIRROR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "generated_media_item_ids": [
    "8f14e45f-ceea-4e7a-9c2d-3b1a5f2e7c10"
  ]
}'
```

