# Archive a project.

> Not a delete: its crews, pull requests and evidence keep pointing at it and can still be read.
> https://koi.dog/docs/api/projects/archive-project/

`POST /api/v1/projects/{id}/archive` · Scope: `config`

An archived project is left out of `GET /projects` unless asked for, and launching a crew on it is refused (`409 launch_blocked`) until it is unarchived. Crews already running on it are not stopped. Archiving an archived project changes nothing. When an API key calls it, the timeline records who did what and the outcome. No query parameters, and no body.

## Path parameters.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | The project's id. |

## Headers.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | `string` | no | Makes a retry safe: the same key with the same request returns the first answer and does nothing else. |

## Response.

200 OK: a `Project`. The example has placeholder values.

## Request.

```sh
curl -X POST "https://app.koi.dog/api/v1/projects/$ID/archive" \
    -H "Authorization: Bearer $KOIDOG_API_KEY" \
    -H "Idempotency-Key: $(uuidgen)"
```

```js
const res = await fetch(`https://app.koi.dog/api/v1/projects/${process.env.ID}/archive`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KOIDOG_API_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
  },
});
console.log(await res.json());
```

```python
import os
import uuid

import requests

r = requests.post(
    f"https://app.koi.dog/api/v1/projects/{os.environ['ID']}/archive",
    headers={
        "Authorization": f"Bearer {os.environ['KOIDOG_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
)
r.raise_for_status()
print(r.json())
```

## Response example.

```json
{
  "id": "string",
  "name": "string",
  "repo": "string",
  "defaultBranch": "string",
  "instructions": "string",
  "validation": {
    …
  },
  "createdAt": "string",
  "archivedAt": "string"
}
```
