---
title: "Reschedule to a queue or time, cancel, or publish now"
description: "PubNio API schedule.change: reschedule to a queue or time, cancel, or publish now. Request fields, examples in five clients, errors, and idempotency."
---

> Documentation Index
> Fetch the complete documentation index at: https://pubnio.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Reschedule to a queue or time, cancel, or publish now

Reschedule to a queue or time, cancel, or publish now with [`POST /api/v1/posts/{postId}/targets/{targetId}/schedule`](https://pubnio.com/api/v1/docs#tag/schedule/POST/api/v1/posts/{postId}/targets/{targetId}/schedule). Requires an API key with the `publish` scope or a signed-in workspace owner.

## Request

Send the current attempt ID from post status. A queueId assigns the next free occurrence or the pinned slot. scheduledAt detaches the target from its queue.

| Parameter     | In    | Type | Required |
| ------------- | ----- | ---- | -------- |
| `postId`      | path  | UUID | Yes      |
| `targetId`    | path  | UUID | Yes      |
| `workspaceId` | query | UUID | Yes      |

The body takes one of 3 shapes.

| Body field          | Type                        | Required      |
| ------------------- | --------------------------- | ------------- |
| `expectedAttemptId` | UUID                        | Yes (shape 1) |
| `action`            | `"reschedule"`              | Yes (shape 1) |
| `scheduledAt`       | string                      | Yes (shape 1) |
| `expectedAttemptId` | UUID                        | Yes (shape 2) |
| `action`            | `"reschedule"`              | Yes (shape 2) |
| `queueId`           | UUID                        | Yes (shape 2) |
| `pinned`            | object                      | No (shape 2)  |
| `expectedAttemptId` | UUID                        | Yes (shape 3) |
| `action`            | `"publish_now"`, `"cancel"` | Yes (shape 3) |

## Response

- HTTP 202: an object with `targetId`, `attemptId`, `accountId`, `scheduledAt`, `queueId`, `slotId`, `assignmentId`, `occurrenceDate`, `localDate`, `localTime`, `timezone`, `status`.
  - `status`: `scheduled`, `queued`, `submitting`, `confirming`, `published`, `provider_draft`, `failed`, `unresolved`, `cancelled`

The [OpenAPI document](https://pubnio.com/api/v1/openapi) has each field's type.

## Examples

### TypeScript

```ts
const result = await workspace.schedule.change(postId, targetId, {
  expectedAttemptId: attemptId,
  action: "reschedule",
  scheduledAt: "2026-12-10T15:00:00Z",
});
```

### Python

```python
result = workspace.schedule.change(
    post_id,
    target_id,
    expected_attempt_id=attempt_id,
    action="reschedule",
    scheduled_at="2026-12-10T15:00:00Z",
)
```

### cURL

```sh
curl -X POST "https://pubnio.com/api/v1/posts/$POST_ID/targets/$TARGET_ID/schedule?workspaceId=$WORKSPACE_ID" \
  -H "Authorization: Bearer $PUBNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"expectedAttemptId":"'"$ATTEMPT_ID"'","action":"reschedule","scheduledAt":"2026-12-10T15:00:00Z"}'
```

### CLI

```sh
pnio posts reschedule "$POST_ID" "$TARGET_ID" --attempt "$ATTEMPT_ID" --at 2026-12-10T15:00:00Z
```

Also: `pnio posts cancel`, `pnio posts publish-now`, `pnio schedule skip-to-next`.

### MCP execute

```js
async () => {
  const postId = "<postId>";
  const targetId = "<targetId>";
  const attemptId = "<attemptId>";
  const response = await codemode.request({
    method: "POST",
    path: `/api/v1/posts/${postId}/targets/${targetId}/schedule`,
    query: { workspaceId: codemode.workspaceId },
    body: {
      expectedAttemptId: attemptId,
      action: "reschedule",
      scheduledAt: "2026-12-10T15:00:00Z",
    },
  });
  return response.data;
};
```

## Errors

- [`attempt-changed`](https://pubnio.com/docs/problems/attempt-changed/): HTTP 409, Delivery attempt changed
- [`delivery-schedule-locked`](https://pubnio.com/docs/problems/delivery-schedule-locked/): HTTP 409, Delivery schedule cannot change

It also declares the problems [most operations](https://pubnio.com/docs/reference/#shared-problems) declare.

## Idempotency

No key. The required `expectedAttemptId` makes a stale retry fail instead of applying twice.

## Limits

- Field lengths and ranges are in the [OpenAPI document](https://pubnio.com/api/v1/openapi).

## Related

- [Schedule operations](https://pubnio.com/docs/reference/#schedule)
- [Publishing](https://pubnio.com/docs/publishing/)

Source: https://pubnio.com/docs/reference/schedule-change/index.mdx
