---
title: "Create anonymous visitor"
method: POST
path: "/v2/visitors"
tags: ["Agent End User Sessions"]
---

# Create anonymous visitor

`POST /v2/visitors`

Mints the anonymous identity a widget visitor presents as `X-Visitor-Id` on `/v2/agent_aliases/{alias_key}/end_user_sessions` requests, naming a connector in the session create body.
No credential is required. The `X-Customer-Id` header carries the `customer_id` served by the public connector view; the minted id is scoped to that customer and authenticates the same visitor on any of the customer's widgets that admit anonymous visitors.

Call this only when the client holds no visitor id. The id never expires — store it durably; it is the only proof of ownership of the sessions it creates, and a repeat call mints a fresh identity that owns none of the previous identity's sessions.

Returns `404` when the customer does not exist, is disabled, or has no enabled widget connector that admits anonymous visitors — one indistinguishable refusal, so the endpoint confirms nothing about which customer ids exist.

## Headers

- `Request-Timeout` integer
- `Request-Timeout-Millis` integer
- `X-Customer-Id` integer, required

## Response `201`

The minted anonymous visitor identity.

- CreateVisitorResponse — The minted anonymous visitor identity.
  - `visitor_id` string, required — The anonymous identity minted for this visitor, presented as the `X-Visitor-Id` header on every end-user session request. Scoped to the customer, not the minting widget: it authenticates the same visitor on any of the customer's widgets that admit anonymous visitors. Store it durably on the client; it never expires, and it is the only proof of ownership of the sessions it creates.

## Other responses

- `400` — The `X-Customer-Id` header is missing or is not a customer id.
- `404` — The customer does not exist, is disabled, or has no enabled widget connector that admits anonymous visitors.
- `429` — The caller's network address exceeded the per-address minting rate. Try again shortly.

## Changes

- **2026-09-16** `de6b34bc4a4f` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/vectara/apis/vectara-rest-api-v2/changes/v2/visitors/post.md)

---

[API](https://skmtc.dev/vectara/apis/vectara-rest-api-v2.md) · [All operations](https://skmtc.dev/vectara/apis/vectara-rest-api-v2/llms.txt) · [OpenAPI document](https://skmtc.dev/vectara/apis/vectara-rest-api-v2/revisions/4557c44ba062?raw)
