---
title: "create"
method: POST
path: "/api/chats"
tags: ["Chat"]
---

# create

`POST /api/chats`

## Request body

- object
  - `data` object, required
    - `type` string, required
    - `attributes` object, required
      - `agentId` string
      - `promptId` string
      - `integrationId` string
      - `attachments` object[]
        - `binaryBase64` string, required
        - `contentType` string, required
        - `inputFieldName` string, required
      - `actionId` string
      - `formInterfaceId` string
      - `inputParameters` string
      - `chatInterfaceId` string
      - `textResourceId` string
      - `userProperties` object[], nullable
        - `name` string, required
        - `value` string, required

## Response `201`

POST /api/chats normalizes null userProperties to empty array

## Other responses

- `401` — Rejected by 401
- `403` — returns 403
- `422` — POST /api/chats rejects userProperties with more than 10 items

---

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