---
docId: doc_3b86a6613e1143f1ae71585fd1054100
title: Update a custom field
description: "Updates the editable properties of a custom field."
api:
  group: campos-personalizados
  auth: bearer
  operations:
    - operationId: updateCustomField
      method: PATCH
      path: '/v1/custom-fields/{fieldId}'
      postmanName: Update a custom field
---

<script>
  import { Ways } from '$lib/components';
</script>

# Update a custom field

Change a field’s description, how AI fills it or the options of a `select` field. Send at least one field you want to update; other fields keep their values.

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl -X PATCH https://api.platic.ai/v1/custom-fields/$FIELD_ID \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "description": "The plan the customer pays for" }'
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.customFields.update("plan", { description: "The plan the customer pays for" });
```

</Ways.Way>
</Ways>

If your credential covers several workspaces, add `?workspace=<id>` to say which one you work in ([list workspaces](/api-reference/workspaces)); without it the answer is `400`. A single-workspace credential never needs it.

## URL parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|-----------|
| `fieldId` | string | Unique identifier of the custom field | ✓ |

## Request body

```json
{
  "description": "Current membership type of the customer",
  "automatic": true,
  "overwritable": false
}
```

## Body parameters

All parameters are optional, but the request must include at least one.

| Parameter | Type | Description |
|-----------|------|-------------|
| `description` | string | Field description (max 500 characters) |
| `automatic` | boolean | Whether the AI should fill the field automatically from the conversation |
| `overwritable` | boolean | Whether the AI can overwrite the field's existing value |
| `options` | array | **`select` only.** Fully replaces the option catalog. At least one active (non-archived) option must remain. Up to 50 options. |
| `ordered` | boolean | **`select` only.** Whether the options are an ordered sequence (stages/steps). |

## Editing a `select` field's options

Send the full option catalog in `options`. Keep the `id` of existing options so you don't break values already stored on customers; options without an `id` are treated as new.

```json
{
  "ordered": true,
  "options": [
    { "id": "new", "label": "New" },
    { "id": "contacted", "label": "Contacted" },
    { "id": "closed", "label": "Closed", "archived": true },
    { "label": "Won" }
  ]
}
```

## Response

```json
{
  "status": "success",
  "message": "Custom field updated successfully",
  "data": {
    "id": "membership_level"
  }
}
```

## Errors

| Status | `details.code` | When it happens |
|--------|----------------|-----------------|
| `400` | `INVALID_REQUEST` | The body is empty, `description` is longer than 500 characters, or a value does not have the expected type. `details.issues` says which field |
| `400` | `INVALID_REQUEST` | The `options` of a `select` are not valid (repeated ids, no active option…). `details.message` says what happened |
| `400` | `INVALID_REQUEST` | Your credential covers several workspaces and you did not send `?workspace=`, or you sent one it does not cover. `details.available` lists the ones you can use |
| `401` | `UNAUTHENTICATED` | The credential is missing or invalid |
| `403` | `FORBIDDEN` | The credential does not have the Contacts module (`Missing contacts permission`), or it is an OAuth token without the `platica:write` scope |
| `404` | `CUSTOM_FIELD_NOT_FOUND` | The field does not exist in the workspace or was deleted |

```json
{
  "code": 400,
  "error": "Bad Request - The request has validation errors",
  "details": {
    "code": "INVALID_REQUEST",
    "message": "The request has validation errors",
    "issues": [
      {
        "code": "custom",
        "path": [],
        "message": "At least one of description, automatic, overwritable, options, or ordered must be provided"
      }
    ]
  }
}
```

The general error format is in [Errors](/api-reference/errors).

## Notes

- You cannot change `name` or `type` after creating the field. To change them, delete the field and create it again.
- In a `select` field, to "remove" an option mark it as `archived: true` instead of dropping it from the array: this preserves historical values on customers while hiding the option from new assignments.
- `options` and `ordered` only apply to `select` fields; they are ignored for other types.
- If the field does not exist or has been deleted, the API returns `404`.
