Archive up to 50 Forward Schedules by explicit ID.
POST /api/v1/forward/schedules/archive
Archives Schedules without physically deleting Schedules or Schedule Runs. Only PATs and administrator SATs may call this endpoint. Identity-bound SATs cannot archive schedules in bulk.
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <PAT or administrator SAT> |
Content-Type | Yes | application/json |
Idempotency-Key | No | Optional idempotency key. Requests with the same owner, path, and body can be replayed safely. |
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
schedule_ids | array<string> | Yes | After deduplication, 1–50 non-empty Schedule IDs. |
400 invalid_request_body.
Example request
Archive all schedules for an Identity or owner
The endpoint does not provide an unbounded synchronous operation for an entire Identity or owner. First list the target records with GET /api/v1/forward/schedules?identity_id=<id>&limit=100, or omit identity_id for the current owner. Continue pagination by passing last_id as after_id, confirm the targets, and submit IDs in batches of at most 50. Use a separate Idempotency-Key for each batch.
Each batch is atomic, but multiple batches are not. If new Schedules might be created during cleanup, query again from the first page after each pass until no targets remain.
Example response
archived_count is the number of Schedules changed from unarchived to archived. Already archived targets are not counted again.
Archive semantics
- Both
activeandpausedSchedules can be archived. Archiving setsarchived_at, clears the next scheduled run time, and prevents new Runs. - The server resolves all IDs within the current owner before changing any record. If any ID does not exist or belongs to another owner, the whole batch returns 404 without identifying the failed ID.
- An already archived ID is an idempotent no-op. If every target is already archived, the response is
archived_count: 0. - Existing
pendingorrunningRuns do not block archiving and are not canceled, skipped, terminated, changed, or deleted. - Archived Schedules remain retrievable by ID and appear in lists with
include_archived=true. Historical Schedule Runs remain queryable. - Without
Idempotency-Key, repeated requests remain naturally idempotent. Reusing the same key with the same body replays the first response withIdempotency-Replayed: true. - Forward provides neither
DELETE /api/v1/forward/schedulesnor physical deletion of Schedules or Schedule Runs.
Errors
| HTTP | Type | Code | Trigger |
|---|---|---|---|
| 400 | invalid_request_error | invalid_request_body | Invalid JSON, unknown fields such as scope or identity_id, or a trailing JSON value. |
| 400 | invalid_request_error | invalid_request | An ID is empty or the deduplicated count is outside 1–50. |
| 401 | authentication_error | authentication_required | PAT or SAT invalid or expired. |
| 403 | permission_error | identity_mismatch | An Identity-bound SAT calls this administrator endpoint. |
| 404 | not_found_error | schedule_not_found | A Schedule does not exist or belongs to another owner. |
| 409 | conflict_error | idempotency_key_reused | The same Idempotency-Key is reused with a different body. |