API Reference
Archive / Unarchive Project
Toggle a project's archived state. Archiving sets
archived_at to the current UTC timestamp; unarchiving clears it. The default project for an organisation cannot be archived. Both endpoints are idempotent — calling archive on an already-archived project (or unarchive on a live one) returns the unchanged record.POST/org/projects/{project_id}/archive
Authentication
Accepts a JWT bearer token (Authorization: Bearer eyJ…) or an API key (X-API-Key: ms_live_…). API-key callers should send X-Project-ID unless the key is project-locked. Cross-tenant operators must send X-Tenant-ID.
Path parameters
| Field | Type | Required | Description |
|---|---|---|---|
project_id | string | required | Project id. Must match the active tenant. |
Response
Returns 200 OK with the following body.
| Field | Type | Required | Description |
|---|---|---|---|
project_id | string | optional | Project id. |
tenant_id | string | optional | Owning tenant id. |
name | string | optional | Display name. |
slug | string | optional | URL slug. |
description | string | optional | Project description (nullable). |
is_default | boolean | optional | true for the org default project. |
archived_at | string | optional | RFC 3339 UTC. null when the project is live. |
created_at | string | optional | RFC 3339 UTC. |
200.json
{"project_id": "proj_support_bot","tenant_id": "t_acme","name": "Customer Support Bot","slug": "support-bot","description": "Tier-1 customer support assistant.","is_default": false,"archived_at": "2026-05-04T12:31:00Z","created_at": "2026-05-04T12:30:11Z"}
Errors
| Status | Code | Description |
|---|---|---|
| 400 | validation_error | Body or query failed schema validation. The error includes the offending field name. |
| 401 | unauthenticated | Missing or invalid bearer token / API key. |
| 403 | forbidden | Authenticated principal lacks the required scope, role, or project access. |
| 404 | not_found | Target resource does not exist or is not visible to the calling tenant. |
| 429 | rate_limited | Per-IP or per-route limit exceeded. Respect the Retry-After header. |
| 500 | internal_error | Unhandled server error. Quote the request_id when contacting support. |
Examples
cURL
curl -X POST https://api.memorysync.io/org/projects/EXAMPLE_ID/archive \-H "Authorization: Bearer $MEMORYSYNC_KEY"
javascript
import { MemorySync } from 'memorysync'const client = new MemorySync({ apiKey: process.env.MEMORYSYNC_KEY })const result = await client.request({method: 'POST',path: '/org/projects/EXAMPLE_ID/archive',})console.log(result)
python
from memorysync import Clientclient = Client(api_key=os.environ["MEMORYSYNC_KEY"])result = client.request(method="POST",path="/org/projects/EXAMPLE_ID/archive",)print(result)
Behavior & notes
The companion route is POST /org/projects/{project_id}/unarchive with the same response shape. Archiving the default project returns 400 with detail "Cannot archive the default project". Archived projects remain readable through GET /org/projects but are excluded from default project switchers.