Skip to main content
PUT
/
api
/
assessments
/
:id
# Simple update without version check
curl -X PUT https://api.example.com/api/assessments/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Assessment Name",
    "progress": 50
  }'

# Update with optimistic locking
curl -X PUT https://api.example.com/api/assessments/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "COMPLETE",
    "progress": 100,
    "version": 3
  }'
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Updated Assessment Name",
  "companyName": "Acme Coffee Cooperative",
  "companyType": "Cooperative",
  "country": "Kenya",
  "status": "COMPLETE",
  "intakeMode": "UPLOAD",
  "progress": 100,
  "version": 4,
  "overallRiskScore": 38.5,
  "overallRiskLevel": "MODERATE",
  "userId": "auth0|123456789",
  "createdAt": "2026-03-04T10:30:00.000Z",
  "updatedAt": "2026-03-04T14:20:00.000Z"
}
Update an existing assessment. Supports optimistic locking via version number.

Path parameters

id
string
required
Assessment ID (UUID).

Request body

All fields are optional. Only provided fields will be updated.
name
string
Assessment name or identifier.Maximum length: 200 characters.
companyName
string
Name of the company being assessed.Maximum length: 200 characters.
companyType
string
Type or category of company.Maximum length: 100 characters.
status
string
Update the assessment status.Allowed values: DRAFT, ANALYZING, ACTION_REQUIRED, COMPLETE
progress
number
Update completion percentage.Range: 0-100
version
number
Current version number for optimistic locking.If provided, the update will only succeed if the current database version matches this value. This prevents concurrent updates from overwriting each other. If the version doesn’t match, a 409 Conflict error is returned.The version is automatically incremented on each update.

Response

Returns the updated assessment object with all fields.
id
string
Unique assessment identifier (UUID).
name
string
Assessment name.
companyName
string
Company name.
companyType
string
Company type.
country
string
Country of operation.
status
string
Current status: DRAFT, ANALYZING, ACTION_REQUIRED, or COMPLETE
intakeMode
string
Data collection method: UPLOAD, GUIDED_INTERVIEW, or MANUAL_ENTRY
progress
number
Completion percentage (0-100).
version
number
Version number (incremented on each update).
overallRiskScore
number
Aggregated risk score (0-100). Null until complete.
overallRiskLevel
string
Risk classification: LOW, MODERATE, HIGH, or CRITICAL. Null until complete.
userId
string
Creator user ID.
createdAt
string
ISO 8601 creation timestamp.
updatedAt
string
ISO 8601 last update timestamp.
# Simple update without version check
curl -X PUT https://api.example.com/api/assessments/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Assessment Name",
    "progress": 50
  }'

# Update with optimistic locking
curl -X PUT https://api.example.com/api/assessments/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "COMPLETE",
    "progress": 100,
    "version": 3
  }'
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Updated Assessment Name",
  "companyName": "Acme Coffee Cooperative",
  "companyType": "Cooperative",
  "country": "Kenya",
  "status": "COMPLETE",
  "intakeMode": "UPLOAD",
  "progress": 100,
  "version": 4,
  "overallRiskScore": 38.5,
  "overallRiskLevel": "MODERATE",
  "userId": "auth0|123456789",
  "createdAt": "2026-03-04T10:30:00.000Z",
  "updatedAt": "2026-03-04T14:20:00.000Z"
}

Optimistic locking workflow

To prevent concurrent updates from conflicting:
1

Fetch current assessment

GET the assessment to retrieve the current version number.
2

Make changes

Modify the assessment data in your application.
3

Submit update with version

Include the version field in your PUT request body.
4

Handle conflicts

If you receive a 409 Conflict response, refresh the assessment data and ask the user to re-apply their changes.
Omitting the version field disables optimistic locking. The update will always succeed (unless the assessment doesn’t exist), but you risk overwriting concurrent changes.

Build docs developers (and LLMs) love