Query parameters

  • chatId string Required

    The CUID of the chat to associate the uploaded file with.

multipart/form-data

Body Required

  • file string(binary) Required

    The PDF file to upload.

Responses

  • 200 application/json

    File uploaded and record saved 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
      • fileUrl string(url) Required

        The URL of the uploaded file in Vercel Blob Storage.

      • recordId string Required

        The CUID of the created file upload record in the database.

  • 400 application/json

    Bad Request (e.g., no file uploaded, invalid file type, file too large, missing chatId)

    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 (e.g., missing blob token, upload failed, database error)

    Hide response attributes Show response attributes object
    • success boolean Required
    • statusCode integer Required
    • message string Required
POST /upload
curl \
 --request POST 'https://referspecs-backend.onrender.com/api/v1/upload?chatId=string' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: multipart/form-data" \
 --form "file=@file"
Response examples (200)
{
  "success": true,
  "statusCode": 200,
  "message": "File uploaded and record saved successfully",
  "data": {
    "fileUrl": "string",
    "recordId": "string"
  }
}
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"
}