Create a chat

post/v1/chat/create

Retired. This endpoint answers 410 Gone and no longer works. It is documented for reference only; use the v2 agent API's Chat instead.

Create an empty conversation and get its chatId back. Use it when you want a stable id before the first message is sent — for example to attach analytics or to hand the id to a widget. You do not need this for normal use: Send a message without a chatId creates a chat automatically.

The request has no body. The response includes the full stored record under chat.

Private keyapi.v1.chat.createNo demoDeprecated

Response

200The chat was created.
chatIdstring (uuid)required

Id of the new chat.

e.g. "3f0c2a4e-8b1d-4c6a-9e2f-7a5b1c0d9e88"
ChatRecordrequired

The full stored chat record returned by Create a chat. Includes internal fields and derived counters in addition to the Chat fields.

_idstring

Internal storage id. Not used by any endpoint; use chatId.

e.g. "66f1c2d3e4a5b6c7d8e9f0a1"
idstring

Alias of _id.

e.g. "66f1c2d3e4a5b6c7d8e9f0a1"
chatIdstring (uuid)required

Unique id of the chat. Use this everywhere else in the API.

e.g. "3f0c2a4e-8b1d-4c6a-9e2f-7a5b1c0d9e88"
organizationIdstring (uuid)required

The organization that owns the chat (derived from the API key).

e.g. "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
array<ChatMessage>required

Always empty for a newly created chat.

createdAtstring (date-time)required

When the chat was created.

updatedAtstring (date-time)required

When the chat was last written to.

messageCountinteger

Number of messages in the thread.

e.g. 0
ChatMessage | null

The most recent message, or null when the chat is empty.

hasImagesboolean

Whether any message contains an input_image part.

e.g. false

Errors

18

Every error is JSON with a single error string unless noted. Match on the status code; the message is for humans.

410
This endpoint has been retired (v1/chat/create).

Always, for API callers. This check runs before authentication and consumes no quota.

curl -X POST "https://stylor.ai/api/v1/chat/create" \
  -H "Authorization: Bearer $STYLOR_API_KEY"
Response · 200
{
  "chatId": "3f0c2a4e-8b1d-4c6a-9e2f-7a5b1c0d9e88",
  "chat": {
    "_id": "66f1c2d3e4a5b6c7d8e9f0a1",
    "chatId": "3f0c2a4e-8b1d-4c6a-9e2f-7a5b1c0d9e88",
    "organizationId": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
    "messages": [],
    "createdAt": "2026-09-12T14:03:11.412Z",
    "updatedAt": "2026-09-12T14:03:11.412Z",
    "messageCount": 0,
    "lastMessage": null,
    "hasImages": false,
    "id": "66f1c2d3e4a5b6c7d8e9f0a1"
  }
}