> ## Documentation Index
> Fetch the complete documentation index at: https://docs.buildpixel.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Projects

> List, create, update, delete projects.

A project links a source-controlled codebase (GitHub repo or Perforce stream) to a set of build settings.

## `GET /projects`

List projects in the current org.

```bash theme={null}
curl https://api.buildpixel.io/projects \
  -H "Authorization: Bearer $TOKEN"
```

Query params:

* `sourceControl=github|perforce` — filter
* `limit`, `cursor` — pagination

Response:

```json theme={null}
{
  "items": [
    {
      "id": "...",
      "name": "MyGame",
      "sourceControl": "github",
      "repoLink": "mystudio/mygame",
      "lastBuildAt": "...",
      "lastBuildStatus": "complete"
    }
  ],
  "nextCursor": null
}
```

## `GET /projects/:id`

Project detail, including build settings and detected `.uproject` info.

## `POST /projects/add-repo`

Create a GitHub-backed project.

```json theme={null}
{
  "name": "MyGame",
  "installationId": "12345",
  "repoFullName": "mystudio/mygame",
  "defaultBranch": "main",
  "uprojectPath": "MyGame.uproject"
}
```

If `uprojectPath` is omitted, BuildPixel auto-detects it (depth ≤ 3).

## `POST /projects/add-perforce`

Create a Perforce-backed project.

```json theme={null}
{
  "name": "MyGame",
  "depot": "//streams/mygame-mainline/main",
  "streamPath": "//streams/mygame-mainline/main",
  "uprojectPath": "MyGame.uproject"
}
```

Requires the org's Perforce credentials to be configured first.

## `PATCH /projects/:id`

Update project metadata (name, description). You can't change the source-control link via this endpoint — delete and recreate if you need to.

## `DELETE /projects/:id`

Delete a project. Build settings are deleted with it. Past build records are retained.
