Skip to main content

Update Case Product API Documentation

Overview

The UPDATE_CASE_PRODUCT action is part of the Cases API and allows external systems to update a product associated with a specific case. This endpoint is primarily used to update the case product status.

Endpoint

POST /api/v1/cases/:caseId

Authentication

  • Header: cv-api-key (required)
  • Type: String
  • Description: API key used for organization-level authentication

Request Parameters

Path Parameters

ParameterTypeRequiredDescription
caseIdStringYesUnique identifier of the case (UUID)

Request Body

The request body must be a JSON object with the following structure:

{
"action": "UPDATE_CASE_PRODUCT",
"caseProductInput": {
"productId": "string",
"status": "CLOSE",
"reason": "string (optional)"
}
}

Field Specifications

Required Fields

Root Level

  • action: Must be exactly "UPDATE_CASE_PRODUCT"
  • caseProductInput: Object containing update case product details

caseProductInput Object

  • productId: Unique identifier of the product (UUID)
  • status: Case Product Status
  • reason: Optional. Required only when the status is CLOSE

Validation Rules

  • productId is required and must be a valid UUID
  • status must be CLOSE
  • reason is optional but recommended when closing a product
  • action must exactly match UPDATE_CASE_PRODUCT

Response Format

Success Response

{
"status": 200,
"success": true,
"message": "Case Product update successfully",
"data": {
"success": true
}
}

Error Response

{
"status": 400,
"success": false,
"message": "Invalid request",
"error": "No Case found for provided details!",
"code": "VALIDATION_ERROR"
}

Error Scenarios

400 Bad Request

  • Invalid case provide
  • Invalid product id provide
  • Invalid status string provide
  • Missing API key

401 Unauthorized

  • Invalid or missing API key
  • Organization not found

403 Forbidden

  • Case does not belong to the organization
  • Permission denied

Example Request

curl --location 'https://api-staging.care360-next.carevalidate.com/api/v1/cases/ec5e0d29-bf87-46b9-98e7-03848442fe53' \
--header 'cv-api-key: your-api-key-here' \
--header 'Content-Type: application/json' \
--data '{
"action": "UPDATE_CASE_PRODUCT",
"caseProductInput": {
"productId": <product-id>,
"status": "CLOSE",
"reason": "NO spiced"
}
}'

Example Response

Success

{
"status": 200,
"success": true,
"message": "Case Product update successfully",
"data": {
"success": true
}
}

Error

{
"status": 400,
"success": false,
"message": "Invalid request",
"error": "caseProductInput.productId, Product id must be a valid UUID",
"code": "VALIDATION_ERROR"
}

Notes

  1. Notifications: Case Product Close activity notifications are sent via webhooks.