Skip to main content

Update Client Field (v1)

Method + Path

PATCH /v1/workspace/:workspaceId/clients/fields/:fieldId

Actual backend path: /v1/workspace/:workspaceId/clients/fields/:fieldId

Description

Update an existing custom field definition for clients. All fields are optional - only provided fields will be updated.

Authentication

Required - JWT token in Authorization header

Required Permissions:

  • clients.update

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token: Bearer <token>
Content-TypestringYesapplication/json

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace identifier
fieldIdstringYesField identifier

Request Body

{
"label": "Updated Notes",
"description": "Updated description",
"isRequired": true,
"isFilterable": false
}

Body Parameters

ParameterTypeRequiredDescription
labelstringNoDisplay label for the field
descriptionstringNoField description
isRequiredbooleanNoWhether the field is required
isUniquebooleanNoWhether field values must be unique
isFilterablebooleanNoWhether the field can be used for filtering
metadataobjectNoAdditional metadata for the field

Response (200)

{
"field": {
"id": "507f1f77bcf86cd799439011",
"key": "notes",
"label": "Updated Notes",
"description": "Updated description",
"type": "text",
"isRequired": true,
"isUnique": false,
"isFilterable": false,
"order": 1,
"updatedAt": "2024-01-15T11:00:00Z"
}
}

Common Errors

  • 400 Bad Request: Invalid request body
  • 401 Unauthorized: Missing or invalid authentication token
  • 403 Forbidden: Insufficient permissions (requires clients.update)
  • 404 Not Found: Field or workspace not found
  • 422 Unprocessable Entity: Validation errors
  • 500 Internal Server Error: Server error