---
title: "Create chat"
method: POST
path: "/ai/chats"
tags: ["AI - Chats"]
---

# Create chat

`POST /ai/chats`

Create a new chat session

## Request body

- object — Request body schema.
  - `name` string — Chat name.
  - `agentUuid` string, uuid — Agent identifier for the chat.
  - `releaseUuid` string, uuid — Release identifier for the chat.
  - `trigger` union, required — Trigger configuration for the chat.
    - object
      - `type` 'connector', required
      - `connectorUuid` string, required
      - `meta` object, required
    - object
      - `type` 'draft', required
    - object
      - `type` 'web_extension', required
      - `url` string, uri, nullable, required
    - object
      - `type` 'app', required
    - object
      - `type` 'workflow', required
      - `uuid` string, required
      - `nodeUuid` string, required
      - `runUuid` string, nullable, required
  - `heartbeat` object — Optional heartbeat configuration. When set, the chat keeps waking itself up every intervalMinutes minutes, re-sending the prompt, until it reaches maxMessages messages.
    - `intervalMinutes` integer, required
    - `maxMessages` integer, required
    - `prompt` string, nullable, required
  - `evaluator` object — Optional evaluator configuration (rubric + quality threshold). When set, the heartbeat loop grades each output and keeps iterating until the score reaches the threshold or maxMessages is hit.
    - `rubric` string, required
    - `threshold` number, required

## Response `200`

Successful response

- object
  - `chat` object, required — Created chat details.
    - `uuid` string, required
    - `slug` string, required
    - `workspaceUuid` string, required
    - `userUuid` string, nullable, required
    - `agentUuid` string, nullable, required
    - `releaseUuid` string, nullable, required
    - `name` string, nullable, required
    - `trigger` unknown, required
    - `heartbeat` object, nullable, required
      - `intervalMinutes` integer, required
      - `maxMessages` integer, required
      - `prompt` string, nullable, required
    - `evaluator` object, nullable, required
      - `rubric` string, required
      - `threshold` number, required
    - `activeStreamUuid` string, nullable, required
    - `creditsUsedCount` number, required
    - `createdAt` string, required
    - `updatedAt` string, required
    - `deletedAt` string, nullable, required
    - `lastMessage` object, nullable, required
      - `uuid` string, required
      - `workspaceUuid` string, required
      - `agentUuid` string, nullable, required
      - `releaseUuid` string, nullable, required
      - `chatUuid` string, required
      - `userUuid` string, nullable, required
      - `status` 'pending' | 'generating' | 'success' | 'error' | 'cancelling' | 'cancelled', required
      - `errorMessage` string, nullable, required
      - `type` 'user' | 'assistant', required
      - `createdAt` string, required
      - `updatedAt` string, required
      - `finishedAt` string, nullable, required
      - `deletedAt` string, nullable, required

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `404` — Not found
- `500` — Internal server error

---

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