Create a chat
/v1/chat/createRetired. This endpoint answers
410 Goneand 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.
Response
Id of the new chat.
The full stored chat record returned by Create a chat. Includes internal fields and derived counters in addition to the Chat fields.
Internal storage id. Not used by any endpoint; use chatId.
Alias of _id.
Unique id of the chat. Use this everywhere else in the API.
The organization that owns the chat (derived from the API key).
Always empty for a newly created chat.
When the chat was created.
When the chat was last written to.
Number of messages in the thread.
The most recent message, or null when the chat is empty.
Whether any message contains an input_image part.
Errors
18Every error is JSON with a single error string unless noted. Match on the status code; the message is for humans.
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"{
"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"
}
}