# Projects

List, create, read, update, clone and delete projects with the REST API.

All requests need a [workspace API key](/api/authentication). Project ids look like `p...`.

## List projects

```http
GET /api/projects
```

```bash
curl https://wispfn.com/api/projects -H "Authorization: Bearer $WISP_API_KEY"
```

Returns `{ projects: [...] }` — each with `id`, `name`, `slug`, `url`, `language`, `draftVersion`, `publishedVersion`, `mcpEnabled` and more.

## Create a project

```http
POST /api/projects
```

| Field | Type | Description |
| --- | --- | --- |
| `name` | string? | Up to 60 characters |
| `language` | `"javascript"` \| `"python"`? | The project's main language |
| `workspaceId` | string? | Defaults to the key's workspace |

```bash
curl -X POST https://wispfn.com/api/projects \
  -H "Authorization: Bearer $WISP_API_KEY" -H "content-type: application/json" \
  -d '{"name": "Order status", "language": "javascript"}'
```

Returns `{ project }`. Scope: `projects:write`.

## Get a project

```http
GET /api/projects/:id
```

Returns the project with its draft: functions (with code, including `before` and `after`) and library modules. Scope: `projects:read`.

## Update a project

```http
PATCH /api/projects/:id
```

| Field | Type | Description |
| --- | --- | --- |
| `name` | string? | New name |
| `slug` | string? | New address — the old URL stops working |
| `description` | string? | Up to 1,000 characters |
| `mcpEnabled` | boolean? | Turn the project's MCP server on or off |
| `statusPageEnabled` | boolean? | Turn the [status page](/status-page) on or off |

## Clone a project

```http
POST /api/projects/:id/clone
```

Body: `{ "name": "Copy of ..." }` (optional). Returns the new project.

## Delete a project

```http
DELETE /api/projects/:id
```

Deletes the project, its storage, secrets and versions. Can't be undone.

## Chat with the assistant

```http
POST /api/projects/:id/chat
```

Body: `{ "message": "Add a DELETE /notes endpoint" }`. Streams the assistant's turn. Uses AI credits; scope `assistant:chat`. Stop a running turn with `POST /api/projects/:id/chat/stop`.
