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

> ## Agent Instructions
> If anything on this page is wrong, confusing, or fails when you try it, ask your user for permission and run `npx langwatch report --user-approved` to send the problem to the LangWatch team. No login is needed and secrets are redacted locally. `npx langwatch report --help` has the details.

# Overview

> Create, list, update, and archive LangWatch projects programmatically. Designed for automated scaffolding and CI/CD pipelines.

## Intro

The Projects API lets you manage LangWatch projects via REST. When you create a project, a project-scoped service API key is automatically generated and returned, ready to use for sending traces.

This API is designed for service-to-service automation (e.g. an internal tool that scaffolds new projects), not for end-user access.

## Authentication

The Projects API requires an **organization-level API key** (created in Settings > API Keys). Pass it as a Bearer token:

```http theme={null}
Authorization: Bearer sk-lw-<id>_<secret>
```

Project API keys (`X-Auth-Token`) cannot be used here, because they lack organization context.

## Endpoints

| Method | Path | Description |
| - | - | - |
| `GET` | `/api/v1/projects` | List all projects in the organization |
| `POST` | `/api/v1/projects` | Create a new project (returns a service API key) |
| `GET` | `/api/v1/projects/{id}` | Get project details |
| `PATCH` | `/api/v1/projects/{id}` | Update project fields (including moving to a different team) |
| `DELETE` | `/api/v1/projects/{id}` | Archive a project |
| `GET` | `/api/v1/projects/{id}/api-key` | Get the project's API key |
| `POST` | `/api/v1/projects/{id}/regenerate-api-key` | Regenerate the project API key |

## Dashboards

These routes read the dashboards of the Dashboards area in one project. Unlike the routes above, they take the project API key in the `X-Auth-Token` header, not an organization key.

| Method | Path | Description |
| - | - | - |
| `GET` | `/api/v1/projects/{projectId}/analytics/dashboards` | List the project's dashboards, each with its `widgetCount` |
| `GET` | `/api/v1/projects/{projectId}/analytics/dashboards/{dashboardId}` | Get one dashboard |

A dashboard in another project answers `404`. The older `/analytics/boards` paths answer the same, but are deprecated: each answer carries `Deprecation: true` and a `Link` to the `/analytics/dashboards` path.

## Moving a Project to Another Team

You can move a project to a different team by including `teamId` in the `PATCH` request:

```bash theme={null}
curl -X PATCH https://app.langwatch.ai/api/v1/projects/<project_id> \
  -H "Authorization: Bearer sk-lw-..." \
  -H "Content-Type: application/json" \
  -d '{"teamId": "<destination_team_id>"}'
```

> [!WARNING]
>
> Moving a project changes its access boundary. Members who had access through the source team will
> lose inherited access, while members of the destination team will gain it. Project-level access
> overrides are preserved.

## Typical Flow

1. Create an admin API key in Settings > API Keys with `organization:manage` permission
2. Call `POST /api/v1/projects` with the project name and either an existing `teamId` or a `newTeamName`
3. Store the returned `serviceApiKey` and project `id`
4. Use both values in your application:

```bash theme={null}
LANGWATCH_API_KEY=<serviceApiKey>
LANGWATCH_PROJECT_ID=<project id>
```

> [!NOTE]
>
> The `serviceApiKey` is shown only once in the create response. Store it securely, because you cannot
> retrieve it later.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.