PUT /chat/{chatId}

Path parameters

  • chatId string Required

    The CUID of the chat to update

application/json

Body Required

  • chatName string

    The new name for the chat session

  • status string

    The new status for the chat session

    Values are active or deactivated.

Responses

  • 200 application/json

    Chat updated 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., invalid status, no fields provided)

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

    Unauthorized

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

    Chat not found or user does not have permission

    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
PUT /chat/{chatId}
curl \
 --request PUT 'https://referspecs-backend.onrender.com/api/v1/chat/{chatId}' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"chatName":"Updated Chat Name"}'
Request example
{
  "chatName": "Updated Chat Name"
}
Response examples (200)
{
  "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 (404)
{
  "success": false,
  "statusCode": 400,
  "message": "Error description"
}
Response examples (500)
{
  "success": false,
  "statusCode": 400,
  "message": "Error description"
}