> ## Documentation Index
> Fetch the complete documentation index at: https://docs.theomnibot.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a Contact Custom Field via the ChatbotX API

> Use PUT /api/v1/custom-fields/{id} to rename a custom field, update its description, or move it to a different folder in your ChatbotX workspace.

Use this endpoint to modify an existing custom field. You can rename the field, update its description, or move it to a different folder. Supply the field's numeric ID in the URL path along with the fields you want to change in the request body.

<Info>
  **PUT** `/api/v1/custom-fields/{id}`
</Info>

## Path Parameters

<ParamField path="id" type="string" required>
  The numeric ID of the custom field to update. Must match the pattern `\d+`.
</ParamField>

## Request Body

<ParamField body="name" type="string" required>
  The updated name for the custom field. Must be between 1 and 255 characters.
</ParamField>

<ParamField body="description" type="string">
  An optional description for the custom field.
</ParamField>

<ParamField body="folderId" type="string | null">
  Move the field to a different folder by providing its ID, or pass `null` to remove it from any folder.
</ParamField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl --request PUT \
    --url https://app.chatbotx.io/api/v1/custom-fields/103 \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "name": "Customer Tier",
      "description": "Subscription tier level for this contact.",
      "folderId": "7"
    }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://app.chatbotx.io/api/v1/custom-fields/103"

  payload = {
      "name": "Customer Tier",
      "description": "Subscription tier level for this contact.",
      "folderId": "7"
  }
  headers = {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
  }

  response = requests.put(url, json=payload, headers=headers)
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const options = {
    method: 'PUT',
    headers: {
      Authorization: 'Bearer <token>',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'Customer Tier',
      description: 'Subscription tier level for this contact.',
      folderId: '7'
    })
  };

  fetch('https://app.chatbotx.io/api/v1/custom-fields/103', options)
    .then(res => res.json())
    .then(res => console.log(res))
    .catch(err => console.error(err));
  ```
</CodeGroup>

## Response

Returns `200 OK` with the updated custom field object.

### Response Fields

<ResponseField name="id" type="string" required>
  The unique identifier of the updated custom field.
</ResponseField>

<ResponseField name="name" type="string" required>
  The updated name of the custom field.
</ResponseField>

<ResponseField name="type" type="string" required>
  The data type of the field. One of `shortText`, `longText`, `number`, `date`, `datetime`, `boolean`, `email`, or `phoneNumber`.
</ResponseField>

<ResponseField name="description" type="string | null" required>
  The updated description, or `null` if none was set.
</ResponseField>

### Example Response

```json theme={null}
{
  "id": "103",
  "name": "Customer Tier",
  "type": "shortText",
  "description": "Subscription tier level for this contact."
}
```
