---
title: "Create Web Widget"
method: POST
path: "/core/web-widgets"
tags: ["Web Widgets"]
---

# Create Web Widget

`POST /core/web-widgets`

## Request

- Base URL: `https://api.anyreach.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.anyreach.ai/core/web-widgets`
- Auth: HTTP bearer

Create a web widget.

## Headers

- `x-anyreach-org` string, nullable: Organization ID for user PATs (pat_ prefix tokens)

## Request body

- WebWidgetCreateRequest: Schema for API requests to create a new web widget (excludes organization_id).
  - `agent_id` string, required
  - `agent_version_id` string, required
  - `name` string, nullable
  - `domains` string[]
  - `published` boolean
  - `collect_analytics` boolean
  - `config` object
  - `preset_id` string, nullable
  - `preset_sections` string[]

## Response `200`

Successful Response

- WebWidget: Web widget entity representing a web embed configuration. `config` is the effective config: the widget's own, with the sections it follows replaced by its preset's. Every read resolves it, so the embed and every other reader see what the widget actually shows.
  - `id` string, required
  - `organization_id` string, required
  - `agent_id` string, required
  - `agent_version_id` string, required
  - `name` string, nullable
  - `domains` string[], required
  - `published` boolean, required
  - `collect_analytics` boolean
  - `config` object, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `created_by` string, nullable
  - `modified_by` string, nullable
  - `preset_id` string, nullable
  - `preset_sections` string[]

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/anyreach/apis/anyreach-api.md) - [All operations](https://skmtc.dev/anyreach/apis/anyreach-api/llms.txt) - [OpenAPI document](https://skmtc.dev/anyreach/apis/anyreach-api/revisions/2eddf40c8c93?raw)
