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

# Platform API

> The public /v1 contract for organization, project, billing, campaign, session, and embedded-signup automation.

The Platform API provides organization, project, billing, campaign, template,
session, and embedded-signup operations under `/v1/*`.

## Authentication

Each generated endpoint page lists its supported credential. Server automation
operations accept a scoped `titan_…` organization key or a verified dashboard
bearer. Operations that authorize an action by a specific member accept only a
verified dashboard bearer. This dashboard-only group includes organization and
member changes and message-template management. Organization and member changes
and template create, update, and delete operations require an organization
owner or admin. Template reads require active organization membership.
Template responses identify drafts with `id` and `createdAt`.
Template list responses contain at most 500 drafts.

Project tokens (`titan_pt_…`) are rejected on `/v1/*`. For organization-key
calls, the generated endpoint page lists the required scope in
`x-required-scope`. Dashboard calls use the member's current organization and
authorization.

## Public domains

The Platform API supports session management and testing numbers, campaign
listing, message-template management, billing and usage reads, billing reminder
settings, organization settings, projects, members, and embedded-signup
settings. Use only the operations documented in the generated endpoint pages.

## Embedded-signup settings

| Method and path  | Operation               | Result                                            |
| ---------------- | ----------------------- | ------------------------------------------------- |
| `GET /v1/widget` | `widgetSettings.get`    | Effective organization or project settings        |
| `PUT /v1/widget` | `widgetSettings.upsert` | Saved settings after applying the supplied fields |

Organization-key callers use the widget permission represented by
`widget:create`; dashboard callers use their active organization membership.
Project tokens and client tokens are rejected. Pass `projectId` to read or
update project-specific settings; omit it to use the organization defaults.
See [Manage saved settings](/integrations/widget#manage-saved-settings) for the
supported fields.

## Session-management operations

Organization-key callers need `sessions:manage`. Dashboard callers need current
membership and authorization in the active organization.

| Method and path                      | Operation                      | Request data                                     | `data` result                         |
| ------------------------------------ | ------------------------------ | ------------------------------------------------ | ------------------------------------- |
| `POST /v1/sessions/{sessionId}/stop` | `sessions.stop`                | optional `projectId`                             | `{ stopping: true, sessionId: UUID }` |
| `DELETE /v1/sessions/{sessionId}`    | `sessions.remove`              | none                                             | `{ removed: true, sessionId: UUID }`  |
| `PATCH /v1/sessions/{sessionId}`     | `sessions.setTierOverride`     | `tierOverride`; optional `projectId`             | managed session row                   |
| `POST /v1/sessions/stop`             | `sessions.batchStop`           | `sessionIds`; optional `projectId`               | `{ stopping: number }`                |
| `POST /v1/sessions/delete`           | `sessions.batchRemove`         | `sessionIds`; optional `projectId`               | `{ removed: number }`                 |
| `POST /v1/sessions/testing`          | `sessions.createTestingNumber` | required `projectId`; optional `name`, `country` | generated `test_…` session slug       |

`sessionId` accepts a session UUID or a stable session slug up to 64
characters. Batch requests accept 1–100 unique identifiers. `ids` remains a
deprecated compatibility alias for `sessionIds`.

`tierOverride` is `free`, `standard`, `pro`, `scale`, or `null` to
inherit the project plan. Testing-number `country` is `US`, `GB`, `BR`, or `IN`
and defaults to `US`. `name` is an optional 1–100 character display name.

Stop operations acknowledge an asynchronous stop request. Remove operations
permanently remove the session and end its active connection when needed. The
generated endpoint pages document the exact validation, not-found, and
temporary service-error responses for each operation.

Use the generated **Platform API endpoints** group for every path,
parameter, body, response, and shared schema.
