# Workspaces, products and set-up

> Look up the REST routes for workspaces, members, products, keys, page settings and the set-up checklist, with their fields and who may call them.

The REST routes for workspaces, products and set-up, generated with `npm run openapi` from the schemas Handline validates every request with. Routes are under `https://app.handline.io/api/v1` and take `Authorization: Bearer <key or token>`; the ids in braces are path parameters. The OpenAPI document is at `https://app.handline.io/api/v1/openapi.json`.

A `GET` or `DELETE` takes its fields as query parameters: numbers and `true` or `false` are read as such, and a repeated key is a list. Other methods take a JSON body with `content-type: application/json`.

## `GET /me`

Read who you are and the workspaces you belong to.

**Operation:** `me.get`, MCP tool `me_get`. **Who:** any signed-in person, for themselves; not agent keys.

No query parameters.

## `GET /workspaces/{workspaceId}`

Read a workspace.

**Operation:** `workspaces.get`, MCP tool `workspaces_get`. **Who:** owners, admins, editors and viewers (`workspace.read`); not agent keys.

No query parameters.

## `PATCH /workspaces/{workspaceId}`

Rename a workspace.

**Operation:** `workspaces.rename`, MCP tool `workspaces_rename`. **Who:** owners and admins (`workspace.rename`); not agent keys.

| Body | Type | Required | Rules |
| --- | --- | --- | --- |
| `name` | string | Yes | 1 to 80 characters. |

## `GET /workspaces/{workspaceId}/products`

List the products in a workspace.

**Operation:** `products.list`, MCP tool `products_list`. **Who:** owners, admins, editors and viewers (`workspace.read`); not agent keys.

No query parameters.

## `POST /workspaces/{workspaceId}/products`

Create a product: one thing being marketed, with its own ground rules, domain and settings.

**Operation:** `products.create`, MCP tool `products_create`. **Who:** owners and admins (`products.create`); not agent keys.

| Body | Type | Required | Rules |
| --- | --- | --- | --- |
| `name` | string | Yes | 1 to 80 characters. |
| `siteUrl` | string | No | A URL. |
| `timezone` | string | No | Default `UTC`. |
| `currency` | string | No | Matches `^[A-Z]{3}$`. Default `EUR`. |

## `GET /products/{productId}`

Read a product and its settings.

**Operation:** `products.get`, MCP tool `products_get`. **Who:** owners, admins, editors and viewers (`record.read`); agent keys with `read`.

No query parameters.

## `PATCH /products/{productId}`

Change a product: its name, site, time zone, currency or settings. Settings that checks read (check modes, channels) mark every open change set as needing a recheck before it can be published.

**Operation:** `products.update`, MCP tool `products_update`. **Who:** owners and admins (`products.settings`); not agent keys.

| Body | Type | Required | Rules |
| --- | --- | --- | --- |
| `name` | string | No | 1 to 80 characters. |
| `siteUrl` | string or null | No | A URL. |
| `timezone` | string | No |  |
| `currency` | string | No | Matches `^[A-Z]{3}$`. |
| `settings` | object | No |  |
| `settings.checkModes` | object | No | Any keys; each value string. |
| `settings.approval` | object | No | Any keys; each value string. |
| `settings.channels` | object | No | Any keys; each value object. |
| `settings.channels.<key>.enabled` | boolean | Yes |  |
| `settings.emailApprovers` | boolean | No |  |

## `GET /workspaces/{workspaceId}/members`

List the members of a workspace and the invitations waiting.

**Operation:** `members.list`, MCP tool `members_list`. **Who:** owners, admins, editors and viewers (`workspace.read`); not agent keys.

No query parameters.

## `POST /workspaces/{workspaceId}/invites`

Invite a person to the workspace by email, with a role.

**Operation:** `members.invite`, MCP tool `members_invite`. **Who:** owners and admins (`members.manage`); not agent keys.

| Body | Type | Required | Rules |
| --- | --- | --- | --- |
| `email` | string | Yes | An email address. |
| `role` | string | Yes | One of `owner`, `admin`, `editor`, `viewer`. |

## `DELETE /workspaces/{workspaceId}/invites/{inviteId}`

Withdraw an invitation that has not been accepted.

**Operation:** `invites.revoke`, MCP tool `invites_revoke`. **Who:** owners and admins (`members.manage`); not agent keys.

No query parameters.

## `PATCH /workspaces/{workspaceId}/members/{userId}`

Change a member's role.

**Operation:** `members.changeRole`, MCP tool `members_changeRole`. **Who:** owners and admins (`members.manage`); not agent keys.

| Body | Type | Required | Rules |
| --- | --- | --- | --- |
| `role` | string | Yes | One of `owner`, `admin`, `editor`, `viewer`. |

## `DELETE /workspaces/{workspaceId}/members/{userId}`

Remove a member from the workspace. They lose access on their next request.

**Operation:** `members.remove`, MCP tool `members_remove`. **Who:** owners and admins (`members.manage`); not agent keys.

No query parameters.

## `GET /products/{productId}/counts`

Count what needs attention: change sets awaiting approval and open work items.

**Operation:** `products.counts`, MCP tool `products_counts`. **Who:** owners, admins, editors and viewers (`record.read`); agent keys with `read`.

No query parameters.

## `GET /products/{productId}/keys`

List the agent and product keys of a product, with their scopes and when each was last used.

**Operation:** `keys.list`, MCP tool `keys_list`. **Who:** owners and admins (`keys.manage`); not agent keys.

No query parameters.

## `POST /products/{productId}/keys`

Create an agent key with scopes, or a product key that can only report outcomes. The key is shown once.

**Operation:** `keys.create`. **Who:** owners and admins (`keys.manage`); not agent keys.

| Body | Type | Required | Rules |
| --- | --- | --- | --- |
| `kind` | string | Yes | One of `agent`, `product`. |
| `name` | string | Yes | 1 to 60 characters. |
| `scopes` | string[] | No | At least 1 item. Each one of `read`, `propose`, `publish`, `report`. |

## `POST /products/{productId}/keys/{keyId}/rotate`

Rotate a key: a new key with the same scopes, and the old one revoked at once.

**Operation:** `keys.rotate`. **Who:** owners and admins (`keys.manage`); not agent keys.

No body.

## `POST /products/{productId}/keys/{keyId}/revoke`

Revoke a key. It is refused on its next call.

**Operation:** `keys.revoke`, MCP tool `keys_revoke`. **Who:** owners and admins (`keys.manage`); not agent keys.

No body.

## `PUT /products/{productId}/theme`

Set the product’s brand theme for its pages. Every page changes, with no page edit. A theme whose text and background colours fail WCAG AA contrast is refused, with the failing pair named.

**Operation:** `products.setTheme`, MCP tool `products_setTheme`. **Who:** owners and admins (`products.settings`); not agent keys.

| Body | Type | Required | Rules |
| --- | --- | --- | --- |
| `theme` | object | Yes |  |
| `theme.colors` | object | Yes |  |
| `theme.colors.background` | string | Yes | Matches `^#[0-9a-fA-F]{6}$`. |
| `theme.colors.surface` | string | Yes | Matches `^#[0-9a-fA-F]{6}$`. |
| `theme.colors.text` | string | Yes | Matches `^#[0-9a-fA-F]{6}$`. |
| `theme.colors.muted` | string | Yes | Matches `^#[0-9a-fA-F]{6}$`. |
| `theme.colors.primary` | string | Yes | Matches `^#[0-9a-fA-F]{6}$`. |
| `theme.colors.onPrimary` | string | Yes | Matches `^#[0-9a-fA-F]{6}$`. |
| `theme.colors.border` | string | Yes | Matches `^#[0-9a-fA-F]{6}$`. |
| `theme.fonts` | object | Yes |  |
| `theme.fonts.heading` | string | Yes | One of `system-sans`, `system-serif`, `atkinson`, `inter`, `source-sans`, `ibm-plex-sans`, `lora`, `merriweather`. |
| `theme.fonts.body` | string | Yes | One of `system-sans`, `system-serif`, `atkinson`, `inter`, `source-sans`, `ibm-plex-sans`, `lora`, `merriweather`. |
| `theme.radius` | integer | Yes | From 0 to 24. |
| `theme.logo` | object or null | Yes |  |
| `theme.logo.src` | string | Yes | A URL. |
| `theme.logo.alt` | string | Yes | 1 to 100 characters. |
| `theme.logo.height` | integer | No | From 16 to 64. Default `28`. |
| `theme.favicon` | string or null | Yes | A URL. |
| `theme.allowThirdPartyFonts` | boolean | No | Default `false`. |

## `PATCH /products/{productId}/page-settings`

Set the product’s page settings: privacy notice, fallback address, indexing, allowed destinations and the consent wording.

**Operation:** `products.setPageSettings`, MCP tool `products_setPageSettings`. **Who:** owners and admins (`products.settings`); not agent keys.

| Body | Type | Required | Rules |
| --- | --- | --- | --- |
| `privacyUrl` | string or null | No | A URL. |
| `fallbackUrl` | string or null | No | A URL. |
| `indexable` | boolean | No |  |
| `allowedDestinations` | string[] | No | At most 20 items. Each matches `^([a-z0-9-]+\.)+[a-z]{2,}$`. |
| `consentText` | object | No |  |
| `consentText.title` | string | Yes | 1 to 80 characters. |
| `consentText.body` | string | Yes | 1 to 400 characters. |
| `consentText.accept` | string | Yes | 1 to 30 characters. |
| `consentText.decline` | string | Yes | 1 to 30 characters. |

## `PUT /products/{productId}/retention`

Set how long visit detail, and the IP address and browser string, are kept.

**Operation:** `products.setRetention`, MCP tool `products_setRetention`. **Who:** owners and admins (`products.settings`); not agent keys.

| Body | Type | Required | Rules |
| --- | --- | --- | --- |
| `visitDays` | integer | Yes | From 1 to 400. |
| `ipUaDays` | integer | Yes | From 1 to 30. |

## `GET /products/{productId}/page-setup`

Read the product’s theme, page settings and retention.

**Operation:** `products.pageSetup`, MCP tool `products_pageSetup`. **Who:** owners, admins, editors and viewers (`record.read`); agent keys with `read`.

No query parameters.

## `GET /products/{productId}/setup`

The product’s set-up checklist: each step done or not, exactly what is missing, and who can do it. Steps an agent can do list their tools. The product is ready to run when every step passes; until then placements can be planned, not marked live.

**Operation:** `setup.checklist`, MCP tool `setup_checklist`. **Who:** owners, admins, editors and viewers (`record.read`); agent keys with `read`.

No query parameters.

## `GET /products/{productId}/setup/test-link`

A test link to one of the product’s pages: its visits and outcomes are marked as tests. Test visits and test outcomes show on the checklist, never in results, and are never sent to a platform.

**Operation:** `setup.testLink`, MCP tool `setup_testLink`. **Who:** owners, admins, editors and viewers (`record.read`); agent keys with `read`.

| Query | Type | Required | Rules |
| --- | --- | --- | --- |
| `pageId` | string | Yes |  |
