application/json

Body Required

  • name string

    Optional name for the chat session. Defaults to "New Chat".

  • type string Required

    The type of chat session.

    Values are text or file.

Responses

  • 201 application/json

    Chat created successfully

    Hide response attributes Show response attributes object
    • success boolean Required
    • statusCode integer Required
    • message string Required
    • data object Required
      Hide data attributes Show data attributes object
      • id string Required

        Unique identifier for the chat session (CUID)

      • userId string Required

        CUID of the user who owns the chat

      • chatName string Required

        Name of the chat session

      • systemMessage string Required

        System message for the chat (e.g., AI personality)

      • createdAt string(date-time) Required

        Timestamp when the chat was created

      • updatedAt string(date-time) Required

        Timestamp when the chat was last updated

      • status string Required

        Status of the chat session

        Values are active or deactivated. Default value is active.

      • type string Required

        Type of the chat session

        Values are text or file. Default value is text.

  • 400 application/json

    Bad Request (e.g., missing type, invalid type)

    Hide response attributes Show response attributes object
    • success boolean Required
    • statusCode integer Required
    • message string Required
  • 401 application/json

    Unauthorized (User not authenticated)

    Hide response attributes Show response attributes object
    • success boolean Required
    • statusCode integer Required
    • message string Required
  • 500 application/json

    Internal Server Error

    Hide response attributes Show response attributes object
    • success boolean Required
    • statusCode integer Required
    • message string Required
POST /chat
curl \
 --request POST 'https://referspecs-backend.onrender.com/api/v1/chat' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"name":"My File Chat","type":"file"}'
Request example
{
  "name": "My File Chat",
  "type": "file"
}
Response examples (201)
{
  "success": true,
  "statusCode": 200,
  "message": "string",
  "data": {
    "id": "string",
    "userId": "string",
    "chatName": "string",
    "systemMessage": "string",
    "createdAt": "2025-05-04T09:42:00Z",
    "updatedAt": "2025-05-04T09:42:00Z",
    "status": "active",
    "type": "text"
  }
}
Response examples (400)
{
  "success": false,
  "statusCode": 400,
  "message": "Error description"
}
Response examples (401)
{
  "success": false,
  "statusCode": 400,
  "message": "Error description"
}
Response examples (500)
{
  "success": false,
  "statusCode": 400,
  "message": "Error description"
}