Projects

Operations for managing analytics projects.

Endpoints

GET NEXT_PUBLIC_API_URL/projects
POST NEXT_PUBLIC_API_URL/projects
GET NEXT_PUBLIC_API_URL/projects/:projectId
POST NEXT_PUBLIC_API_URL/projects/:projectId
DELETE NEXT_PUBLIC_API_URL/projects/:projectId
POST NEXT_PUBLIC_API_URL/projects/:projectId/transfer

GET NEXT_PUBLIC_API_URL/projects

Returns a paginated list of projects belonging to the authenticated user.

Parameters

ParameterTypeDescription
includeOrganizationsboolean(optional) Set to true to include projects from organizations you belong to.
searchstring(optional) Search text to filter projects by name or domain.
pagenumber(optional, default 1) Current page.
pageSizenumber(optional, default 10) Number of projects per page.

Sample response

{
  "data": [
    {
      "id": "3b290947-8a3d-4cbf-8468-b328a6fcf7bb",
      "name": "Production App",
      "domain": "myapp.com",
      "shareId": null,
      "userId": "c7a6e11b-3b4e-4f3b-8219-482a5c2d1b82",
      "organizationId": null,
      "autocaptureEnabled": true,
      "createdAt": "2026-01-20T10:00:00.000Z",
      "updatedAt": "2026-01-20T10:00:00.000Z",
      "deletedAt": null
    }
  ],
  "count": 1,
  "page": 1,
  "pageSize": 10
}

POST NEXT_PUBLIC_API_URL/projects

Creates a new analytics project.

Request body

PropertyTypeDescription
namestringRequired. Project display name (max 100 chars).
domainstringRequired. Tracking domain (e.g. myapp.com).
shareIdstring(optional) Custom unique alphanumeric share ID (8-50 chars).
organizationIdstring(optional) UUID of organization to assign the project to.
autocaptureEnabledboolean(optional, default true) Whether autocapture is enabled.
{
  "name": "My Landing Page",
  "domain": "landing.example.com",
  "autocaptureEnabled": true
}

Sample response

{
  "id": "3b290947-8a3d-4cbf-8468-b328a6fcf7bb",
  "name": "My Landing Page",
  "domain": "landing.example.com",
  "shareId": null,
  "userId": "c7a6e11b-3b4e-4f3b-8219-482a5c2d1b82",
  "organizationId": null,
  "autocaptureEnabled": true,
  "createdAt": "2026-02-01T15:20:00.000Z",
  "updatedAt": "2026-02-01T15:20:00.000Z"
}

GET NEXT_PUBLIC_API_URL/projects/:projectId

Fetches the configuration and metadata for a specific project.

Sample response

{
  "id": "3b290947-8a3d-4cbf-8468-b328a6fcf7bb",
  "name": "My Landing Page",
  "domain": "landing.example.com",
  "shareId": null,
  "userId": "c7a6e11b-3b4e-4f3b-8219-482a5c2d1b82",
  "organizationId": null,
  "autocaptureEnabled": true,
  "createdAt": "2026-02-01T15:20:00.000Z",
  "updatedAt": "2026-02-01T15:20:00.000Z"
}

POST NEXT_PUBLIC_API_URL/projects/:projectId

Updates an existing project's settings. You can also use the PATCH HTTP method.

Request body

PropertyTypeDescription
namestring(optional) New project name.
domainstring(optional) New project domain.
shareIdstring(optional) Custom unique share ID, or null to remove.
autocaptureEnabledboolean(optional) Toggle autocapture.
{
  "name": "Updated Project Name",
  "shareId": "public-view-123"
}

DELETE NEXT_PUBLIC_API_URL/projects/:projectId

Permanently deletes the specified project. Requires project owner permissions.

Sample response

{
  "ok": true
}

POST NEXT_PUBLIC_API_URL/projects/:projectId/transfer

Transfers ownership of a project to another user by email address.

Request body

PropertyTypeDescription
emailstringRequired. Valid email address of target user.
{
  "email": "colleague@example.com"
}

Sample response

{
  "ok": true
}