# scheduled.reschedule

Change a scheduled send's release time.

Moves WHEN a pending scheduled send fires. The message itself is untouched — same draft, same delivery id, same recipients — so this is not the draft-replacing 'edit in place' the design rules out; editing the MESSAGE remains cancel + resubmit. Pending sends only: once a release has started its legs may already be on the wire, and moving the time would neither recall them nor stop it.

```ts
openemail.scheduled.reschedule(
  mailboxId: string,
  scheduleId: string,
  body: ScheduledRescheduleBody,
  options?: CallOptions,
): ApiPromise<ScheduledSend>
```

It calls `PATCH /mailboxes/{mailboxId}/scheduled/{scheduleId}`: [Change a scheduled send's release time](/docs/api/delivery/patch_ScheduledReschedule) in the API reference.

## Example

```ts
const scheduledSend = await openemail.scheduled.reschedule(mailboxId, scheduleId, { sendAt: 1 })
```

## Arguments

| Argument | Type | Description |
| --- | --- | --- |
| `mailboxId` | `string` | Mailbox ULID identifier. The path's `{mailboxId}`. |
| `scheduleId` | `string` | Scheduled send ULID identifier. The path's `{scheduleId}`. |
| `body` | [`ScheduledRescheduleBody`](#scheduledreschedulebody) | The request's body. |

## Options

It takes no options of its own. Every call also takes `signal`, `timeout`, `retry` and `headers`, which say how that one call is sent ([call options](/docs/sdks/typescript/calling-methods#call-options)).

## Answer

Awaited, it is the API's JSON, [`ScheduledSend`](/docs/sdks/typescript/types/scheduled-send). It is an [`ApiPromise`](/docs/sdks/typescript/responses): `.withResponse()` gives the same with the `Response` it came in, for its headers.

## Errors

| Status | What it means |
| --- | --- |
| `400` | send_at_in_past or send_at_too_far |
| `401` | unauthorized: the bearer credential is missing, malformed, expired, or revoked. Carries a `WWW-Authenticate: Bearer` challenge |
| `404` | Mailbox or schedule not found |
| `409` | cannot_unsend (release already started), schedule_failed, or already_canceled |
| `413` | too_large: JSON request body exceeds 1 MiB or 500,000 values (object keys included), checked before parsing |
| `503` | temporary_failure: the platform's storage could not answer just now; retry after the Retry-After window. Any operation can answer this. A write that got it may have been applied, so retry it with the same idempotency key where it takes one, or read the state back first (see Transient failures in the API description) |

A failed call rejects with a [`RequestError`](/docs/sdks/typescript/errors): its `status`, and its `code`, the API's `error`. Decide on the code: one status covers several.

## Types

### ScheduledRescheduleBody

```ts
/** The body of `scheduled.reschedule`. */
type ScheduledRescheduleBody = {
  /** New release time, epoch seconds. Must be in the future and within the same horizon a schedule may be created at. */
  sendAt: number
}
```

It names these types of the API, each on a page of its own: [`ScheduledSend`](/docs/sdks/typescript/types/scheduled-send).
