---
title: "Bulk lifecycle/archive patch across many contexts in one call"
method: POST
path: "/api/contexts/bulk"
tags: ["Contexts"]
---

# Bulk lifecycle/archive patch across many contexts in one call

`POST /api/contexts/bulk`

## Request

- Base URL: `http://localhost:38200`
- URL: `http://localhost:38200/api/contexts/bulk`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `token`

Backs the dashboard multi-select toolbar. Tenant + per-user visibility isolation is enforced by the service layer.

## Request body

- object
  - `ids` integer[], required
  - `patch` object, required: At least one of lifecycle/archive is required.
    - `lifecycle` 'fleeting' | 'working' | 'evergreen' | 'archived'
    - `archive` boolean

## Response `200`

Per-id outcome.

- object
  - `updated` integer[]
  - `failed` object[]
    - `id` integer
    - `error` string

## Other responses

- `400`: Request body/query failed Zod validation.
- `401`: Missing or invalid credentials.

---

[API](https://skmtc.dev/contextq/apis/contextq-api.md) · [All operations](https://skmtc.dev/contextq/apis/contextq-api/llms.txt) · [OpenAPI document](https://skmtc.dev/contextq/apis/contextq-api/revisions/7afc44056a22?raw)
