# Platform sets and queues (MCP)

Source: https://ampost.io/docs/mcp/platform-sets · Full reference: https://ampost.io/llms-full.txt

Each MCP tool is the REST operation of the same name: the same arguments (path parameters and body fields in one object), the same result as `structuredContent`, the same error codes and rate limits. `tools/list` shows only the tools the key's or app's scopes allow; another answers `INSUFFICIENT_SCOPE`. A failed call returns `isError: true` with the REST error body as text.

## Platform Sets

A platform set groups connected accounts, at most one per platform. You can have up to 20 sets. Deleting a set revokes its accounts and keeps its disconnected accounts and posts without a set; a reconnect puts an account in the set you connect it to. Your last set cannot be deleted.

### List platform sets

`GET /api/platform-sets` · MCP tool `platform_sets_list` · scope `accounts:read` · rate limit `apiRead` · success `200`

List your platform sets, default set first: each with its `id`, `name`, `isDefault` and `accountCount`. A platform set groups at most one account per platform (for example one brand's Instagram, LinkedIn and X); posts, queues and connections target a set by `id`. Use this to find a set's id or to pick a set with the user; use platform_sets_get to re-read one set whose id you have, and accounts_list with `platformSetId` for the accounts in a set. `accountCount` counts only active accounts, the same ones accounts_list returns by default; revoked accounts are not counted. Paginated with `limit` and `offset`. A key restricted to some sets sees only those.

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `limit` | query | integer | no | Page size, 1-100. Default 20. |
| `offset` | query | integer | no | Number of items to skip. Default 0. |

Example response:

```json
{
  "data": [
    {
      "id": "9a2c4e6b-1d3f-4a5c-8e7b-2f4d6a8c0e10",
      "name": "default",
      "isDefault": true,
      "accountCount": 3,
      "createdAt": "2026-10-01T08:00:00.000Z",
      "updatedAt": "2026-10-01T08:00:00.000Z"
    },
    {
      "id": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "name": "Client A",
      "isDefault": false,
      "accountCount": 2,
      "createdAt": "2026-10-06T09:00:00.000Z",
      "updatedAt": "2026-10-06T09:00:00.000Z"
    }
  ],
  "pagination": {
    "limit": 20,
    "offset": 0,
    "total": 2,
    "hasMore": false
  }
}
```

### Create a platform set

`POST /api/platform-sets` · MCP tool `platform_sets_create` · scope `accounts:write` · rate limit `createPost` · success `201`

Create an empty platform set with this name and return it. Add accounts to it with accounts_connect and its `platformSetId`; to rename a set, use platform_sets_update. You can have at most 20 sets (409 PLATFORM_SET_LIMIT_REACHED). A key restricted to some sets cannot create one (403 PLATFORM_SET_NOT_ALLOWED).

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `name` | body | string | yes | Set name, 1-50 characters |
| `Idempotency-Key` (MCP `idempotencyKey`) | header | string | no | Idempotency key (1-255 visible ASCII characters, for example a UUID). A retry with the same key and arguments within 24 hours returns the first result instead of running again. Send a new key for each new action. See Idempotency. |

Example request:

```json
{
  "name": "Client A"
}
```

Example response:

```json
{
  "id": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
  "name": "Client A",
  "isDefault": false,
  "accountCount": 2,
  "createdAt": "2026-10-06T09:00:00.000Z",
  "updatedAt": "2026-10-06T09:00:00.000Z"
}
```

### Get a platform set

`GET /api/platform-sets/{platformSetId}` · MCP tool `platform_sets_get` · scope `accounts:read` · rate limit `apiRead` · success `200`

Get one platform set by id: `name`, `isDefault`, `accountCount` (active accounts only; revoked ones are not counted) and its timestamps. Use it when you have the id, for example to check a set still exists or its account count before posting to it; use platform_sets_list to find a set or see all of them, and accounts_list with `platformSetId` for the accounts themselves. 404 PLATFORM_SET_NOT_FOUND when no set with this id is yours or the key is restricted to other sets.

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `platformSetId` | path | string | yes | Platform set id (UUID): `id` from platform_sets_list |

Example response:

```json
{
  "id": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
  "name": "Client A",
  "isDefault": false,
  "accountCount": 2,
  "createdAt": "2026-10-06T09:00:00.000Z",
  "updatedAt": "2026-10-06T09:00:00.000Z"
}
```

### Rename a platform set

`PATCH /api/platform-sets/{platformSetId}` · MCP tool `platform_sets_update` · scope `accounts:write` · rate limit `createPost` · success `200`

Rename a platform set, including the default set, and return it. Only the name changes: accounts, posts and the queue stay. 404 PLATFORM_SET_NOT_FOUND for an unknown id; 403 PLATFORM_SET_NOT_ALLOWED for a set the key is restricted from.

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `platformSetId` | path | string | yes | Platform set id (UUID): `id` from platform_sets_list |
| `name` | body | string | yes | Set name, 1-50 characters |

Example request:

```json
{
  "name": "Client A"
}
```

Example response:

```json
{
  "id": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
  "name": "Client A",
  "isDefault": false,
  "accountCount": 2,
  "createdAt": "2026-10-06T09:00:00.000Z",
  "updatedAt": "2026-10-06T09:00:00.000Z"
}
```

### Delete a platform set

`DELETE /api/platform-sets/{platformSetId}` · MCP tool `platform_sets_delete` · scope `accounts:write` · rate limit `createPost` · success `200`

Delete a platform set and revoke its active accounts. Its disconnected accounts and its posts are kept without a set; reconnect an account with accounts_connect and its accountId to put it in another set. Your last remaining set cannot be deleted (409 LAST_PLATFORM_SET). 409 PLATFORM_SET_IN_USE means an account was connected to the set during the delete: retry.

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `platformSetId` | path | string | yes | Platform set id (UUID): `id` from platform_sets_list |

Example response:

```json
{
  "id": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
  "deleted": true
}
```

## Posting Queues

Each platform set has one queue: weekly slots (`{ "day": "monday", "time": "09:00" }`) in an IANA time zone (default `UTC`). Slot times follow the zone's daylight saving changes: a time that happens twice when clocks go back is the first one, and a time that does not exist when clocks go forward moves forward by the gap (02:30 becomes 03:30). Send `useQueue: true` instead of `scheduledFor` to `posts_create` with exactly one target, and the post is scheduled in that set's next free slot at least a minute away. A slot is taken while a queued post (`queuePlatformSetId` on the Post) is scheduled at its time; rescheduling, moving to another set, publishing or deleting the post frees it. Changing the slots does not move posts already in the queue. Queues are scheduling, so they need the Pro plan or above; reading one works on every plan. `queue_slots` with `filter: free` shows where the next queued posts go.

### Get a posting queue

`GET /api/platform-sets/{platformSetId}/queue` · MCP tool `queue_get` · scope `posts:read` · rate limit `apiRead` · success `200`

Get a platform set's queue settings: its `timezone` and weekly `slots` (weekday and HH:MM), sorted by weekday and time. A set without a saved queue answers with no slots in UTC (`updatedAt` null). Use it to read or show the weekly pattern before changing it with queue_update; to see the actual upcoming dates and which are free or taken by a post, use queue_slots. 404 PLATFORM_SET_NOT_FOUND when the set is not yours or the key is restricted to other sets.

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `platformSetId` | path | string | yes | Platform set id (UUID): `id` from platform_sets_list |

Example response:

```json
{
  "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
  "timezone": "Europe/Warsaw",
  "slots": [
    {
      "day": "monday",
      "time": "09:00"
    },
    {
      "day": "wednesday",
      "time": "12:30"
    },
    {
      "day": "friday",
      "time": "17:00"
    }
  ],
  "updatedAt": "2026-10-06T09:00:00.000Z"
}
```

### Update a posting queue

`PATCH /api/platform-sets/{platformSetId}/queue` · MCP tool `queue_update` · scope `posts:write` · rate limit `createPost` · success `200`

Set the time zone or the weekly slots of a platform set's queue; `slots` replaces the whole list. Queues need the Pro plan or above (403 UPGRADE_REQUIRED). Posts already in the queue keep their time. Returns the saved queue; omitted fields keep their value. 403 PLATFORM_SET_NOT_ALLOWED for a set the key is restricted from; 404 PLATFORM_SET_NOT_FOUND for an unknown set.

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `platformSetId` | path | string | yes | Platform set id (UUID): `id` from platform_sets_list |
| `timezone` | body | string | no | IANA time zone the slot times are in, for example Europe/Warsaw. Slots follow its daylight saving changes. |
| `slots` | body | object[] | no | Replaces every slot (max 100); duplicates are merged. An empty list turns the queue off. |

Example request:

```json
{
  "timezone": "Europe/Warsaw",
  "slots": [
    {
      "day": "monday",
      "time": "09:00"
    },
    {
      "day": "wednesday",
      "time": "12:30"
    },
    {
      "day": "friday",
      "time": "17:00"
    }
  ]
}
```

Example response:

```json
{
  "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
  "timezone": "Europe/Warsaw",
  "slots": [
    {
      "day": "monday",
      "time": "09:00"
    },
    {
      "day": "wednesday",
      "time": "12:30"
    },
    {
      "day": "friday",
      "time": "17:00"
    }
  ],
  "updatedAt": "2026-10-06T09:00:00.000Z"
}
```

### Preview queue slots

`GET /api/platform-sets/{platformSetId}/queue/slots` · MCP tool `queue_slots` · scope `posts:read` · rate limit `apiRead` · success `200`

The queue's next slot times from now on, as ISO timestamps (`scheduledFor`), each with the queued post holding it (`postId`, null when free); empty when the queue has no slots. With `filter: free` the first slot is where posts_create with `useQueue` puts the next post. Use it to tell the user when a queued post would go out or which times are taken; to read or change the weekly pattern itself, use queue_get and queue_update. `count` sets how many slots (1-50, default 10). 404 PLATFORM_SET_NOT_FOUND when the set is not yours or the key is restricted to other sets.

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `platformSetId` | path | string | yes | Platform set id (UUID): `id` from platform_sets_list |
| `count` | query | integer | no | How many slots, 1-50. Default 10. |
| `filter` | query | all \| free | no | `free`: only free slots, the ones posts_create with `useQueue` fills next, in order. Default `all`: taken slots too, with their post. |

Example response:

```json
{
  "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
  "timezone": "Europe/Warsaw",
  "slots": [
    {
      "scheduledFor": "2027-01-11T08:00:00.000Z",
      "postId": "7f1c2a9e-4b1d-4c55-9a0e-2f6d8b3c1a10"
    },
    {
      "scheduledFor": "2027-01-13T11:30:00.000Z",
      "postId": null
    },
    {
      "scheduledFor": "2027-01-15T16:00:00.000Z",
      "postId": null
    }
  ]
}
```
