# Update a custom field

`PATCH https://api.cademi.com.br/api/v3/settings/user-profile/custom-fields/{custom_field_id}`

Operation ID: `custom_fields.update` · API v3

Updates a custom field definition. Fields omitted from the request keep their current values.

The `type` of a field cannot be changed once users have filled in values for it. Such requests return the `state_conflict` error code.

To avoid overwriting a newer version, send the `ETag` returned by the retrieve operation in the `If-Match` header.

Required permissions: `custom_fields.update`.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `custom_field_id` | path | string | yes |  |

## Request body

Content type: `application/json`.

| Field | Type | Required | Description |
|---|---|---|---|
| `label` | string | no |  |
| `position` | integer | no |  |
| `required` | boolean | no |  |
| `type` | string, one of `text`, `number`, `date` | no |  |

## Responses

### 200

Returns the updated custom field.

Body: `data`: CustomField.

Fields of CustomField:

| Field | Type | Required | Description |
|---|---|---|---|
| `created_at` | string (date-time) | yes |  |
| `id` | string | yes |  |
| `label` | string | yes |  |
| `object` | string, one of `custom_field` | yes |  |
| `position` | integer | yes |  |
| `required` | boolean | yes |  |
| `revision` | string | yes |  |
| `type` | string, one of `text`, `number`, `date` | yes |  |
| `updated_at` | string (date-time) | yes |  |

### 401

The credential is missing, malformed, expired, or revoked.

Body: Error.

### 403

The current credentials do not have the permission required by this operation.

Body: Error.

### 404

The custom field was not found or is not accessible with the current credentials.

Body: Error.

### 409

The field type cannot be changed because users have already filled in values for this field.

Body: Error.

### 412

The custom field has changed since the supplied revision was retrieved.

Body: Error.

### 422

The request body or query parameters failed validation.

Body: ValidationFailed.

Full schema: https://cademi.dev/openapi/v3.json
