---
title: "Create Widget Task"
method: POST
path: "/api/widget/chat/task/create"
tags: ["widget"]
---

# Create Widget Task

`POST /api/widget/chat/task/create`

Create new chat task for widget guest.

## Request body

- TaskCreateRequest — Create task request
  - `title` string, required
  - `description` string, nullable
  - `agent_id` integer, nullable
  - `files` string[], nullable
  - `llm_ids` string[], nullable
  - `memory_similarity_threshold` number, nullable
  - `agent_type` string, nullable
  - `agent_config` object, nullable
  - `is_preview` boolean
  - `is_visible` boolean
  - `execution_mode` string, nullable
  - `process_description` string, nullable
  - `examples` ExampleItem[], nullable
    - `input` string, required
    - `output` string, required

## Response `200`

Successful Response

- TaskCreateResponse — Create task response
  - `task_id` integer, required
  - `title` string, required
  - `status` string, required
  - `created_at` string, required
  - `model_id` string, nullable
  - `small_fast_model_id` string, nullable
  - `visual_model_id` string, nullable
  - `compact_model_id` string, nullable
  - `model_name` string, nullable
  - `small_fast_model_name` string, nullable
  - `visual_model_name` string, nullable
  - `compact_model_name` string, nullable
  - `execution_mode` string, nullable
  - `channel_id` integer, nullable
  - `channel_name` string, nullable
  - `agent_id` integer, nullable
  - `agent_name` string, nullable
  - `agent_logo_url` string, nullable

## Other responses

- `422` — Validation Error

## Changes

- **2026-06-13** `33e4ba4936ad` — 5 info
  - added the new optional request property `is_preview`
  - added the new optional request property `is_visible`
  - added the optional property `agent_id` to the response with the `200` status
  - added the optional property `agent_logo_url` to the response with the `200` status
  - …1 more
- **2026-05-01** `c9eb29ec9a1b` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/xorbitsai/apis/xagent/changes/api/widget/chat/task/create/post.md)

---

[API](https://skmtc.dev/xorbitsai/apis/xagent.md) · [All operations](https://skmtc.dev/xorbitsai/apis/xagent/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/xorbitsai/xagent/revisions/33e4ba4936ad/schema)
