Projects API

Manage projects and API keys. All project endpoints require cookie-based authentication.

Create Project

POST
/api/v1/projects

Create a new project

json
{
  "name": "My Web App",
  "domain": "myapp.com"
}

Response (201)

json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "My Web App",
  "domain": "myapp.com",
  "apiKey": "bsk_pub_a1b2c3d4e5f6...",
  "isActive": true,
  "createdAt": "2026-01-15T10:30:00Z",
  "settings": {}
}

List Projects

GET
/api/v1/projects

List all active projects for the current user

Returns an array of project objects.

Get Project

GET
/api/v1/projects/:id

Get a single project by ID

Update Project

PATCH
/api/v1/projects/:id

Update project fields

json
{
  "name": "Updated Name",
  "domain": "newdomain.com",
  "settings": {
    "webhookUrl": "https://hooks.slack.com/...",
    "notifyOnCritical": true
  }
}

Delete Project

DELETE
/api/v1/projects/:id

Soft-delete a project (204 No Content)

Deleted projects are deactivated, not permanently removed. Their reports are preserved.

Rotate API Key

POST
/api/v1/projects/:id/rotate-key

Generate a new API key (invalidates the old one)

Returns the updated project with the new API key. Make sure to update your widget configuration after rotating.