Create Chat
Create a new chat room.
Endpoint
POST https://recoup-api.vercel.app/api/chatsAuthentication
| Header | Type | Required | Description |
|---|---|---|---|
| x-api-key | string | Yes | Your Recoup API key. See Getting Started for how to create and manage keys. |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| artistId | string | No | UUID of the artist account the chat is associated with |
| chatId | string | No | UUID for the new chat (client-generated). If not provided, one will be generated automatically. |
Request Examples
cURL
curl -X POST "https://recoup-api.vercel.app/api/chats" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{}'Response Format
{
"status": "success",
"chat": {
"id": "f1b2c3d4-5678-4abc-9def-1234567890ab",
"account_id": "848cd58d-700f-4b38-ab4c-d9f52a1b2c3d",
"artist_id": null,
"topic": null,
"updated_at": "2025-01-09T12:00:00.000Z"
}
}{
"status": "error",
"message": "Failed to create chat"
}Response Properties
| Property | Type | Description |
|---|---|---|
| status | string | Status of the request ("success" or "error") |
| chat | object | The created chat object |
| chat.id | string | UUID of the created chat |
| chat.account_id | string | UUID of the account that owns the chat |
| chat.artist_id | string | UUID of the associated artist (null if not provided) |
| chat.topic | string | Title of the chat (null on creation) |
| chat.updated_at | string | ISO timestamp of the last update |
| message | string | Error message (only present if status is "error") |
Notes
- If
chatIdis not provided, a UUID will be generated automatically - If
artistIdis not provided, the chat will not be associated with any artist - After creating a chat, use the Chat Stream API or Chat Generate API to send messages