---
title: "create widget session token"
method: POST
path: "/v1/auth/widget"
tags: ["Sessions"]
---

# create widget session token

`POST /v1/auth/widget`

Create a session token for a configured widget. The request origin must be allowed by the persona's widget configuration unless the widget is configured to allow every origin. When watermark removal is configured, the token also requests removal of the AI avatar disclosure; the engine re-checks the organization's current entitlement when the session starts.

## Headers

- `Origin` string, uri

## Request body

- object
  - `agentId` string, required — ID of the persona used by the widget.

## Response `200`

Widget session token created.

- object
  - `sessionToken` string, required — Short-lived token accepted by `POST /v1/engine/session`.

## Other responses

- `400` — Invalid JSON or missing/invalid `agentId`.
- `403` — The request Origin is not allowed by the widget configuration.
- `404` — Persona not found.
- `500` — Session token creation failed.

---

[API](https://skmtc.net/anam/apis/anam-ai-api.md) · [All operations](https://skmtc.net/anam/apis/anam-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/anam/anam-ai-api/revisions/dae97e8eb063/schema)
