Skip to content

Create Chat

Create a new chat room.

Endpoint

POST https://recoup-api.vercel.app/api/chats

Authentication

HeaderTypeRequiredDescription
x-api-keystringYesYour Recoup API key. See Getting Started for how to create and manage keys.

Parameters

NameTypeRequiredDescription
artistIdstringNoUUID of the artist account the chat is associated with
chatIdstringNoUUID 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

PropertyTypeDescription
statusstringStatus of the request ("success" or "error")
chatobjectThe created chat object
chat.idstringUUID of the created chat
chat.account_idstringUUID of the account that owns the chat
chat.artist_idstringUUID of the associated artist (null if not provided)
chat.topicstringTitle of the chat (null on creation)
chat.updated_atstringISO timestamp of the last update
messagestringError message (only present if status is "error")

Notes

  • If chatId is not provided, a UUID will be generated automatically
  • If artistId is 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