# Update Custom Field

PUT https://services.leadconnectorhq.com/locations/{locationId}/customFields/{id}

Update Custom Field

## Authentication

Send `Authorization: Bearer <token>` using:

- **Sub-Account token: OAuth access token or Private Integration Token.** No scopes required.

## Parameters

### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Version` | string | Yes | API Version |

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `locationId` | string | Yes | Location Id |
| `id` | string | Yes | Custom Field Id |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "HighLevel API",
    "version": "2023-02-21"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/locations/{locationId}/customFields/{id}": {
      "put": {
        "summary": "Update Custom Field",
        "operationId": "updateCustomField",
        "description": "Update Custom Field",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "2023-02-21"
              ]
            }
          },
          {
            "name": "locationId",
            "required": true,
            "in": "path",
            "description": "Location Id",
            "example": "ve9EPM428h8vShlRW1KT",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Custom Field Id",
            "example": "00NhGCcN1tlO8ZHcu7Wb",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCustomFieldsDTO"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomFieldSuccessfulResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestDTO"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedDTO"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnprocessableDTO"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account.",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency (OR) Private Integration Token of Agency.",
        "type": "http"
      }
    },
    "schemas": {
      "UpdateCustomFieldsDTO": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Custom Field"
          },
          "placeholder": {
            "type": "string",
            "example": "Placeholder Text"
          },
          "acceptedFormat": {
            "example": [
              ".pdf",
              ".docx",
              ".jpeg"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "isMultipleFile": {
            "type": "boolean",
            "example": false
          },
          "maxNumberOfFiles": {
            "type": "number",
            "example": 2
          },
          "textBoxListOptions": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "label": {
                      "type": "string",
                      "example": "First"
                    },
                    "prefillValue": {
                      "type": "string",
                      "example": ""
                    }
                  },
                  "title": "textBoxListOptionsSchema"
                },
                {
                  "type": "object",
                  "properties": {
                    "label": {
                      "type": "string",
                      "example": "First"
                    },
                    "prefillValue": {
                      "type": "string",
                      "example": ""
                    }
                  },
                  "title": "textBoxListOptionsSchema"
                }
              ]
            },
            "example": [
              {
                "label": "First",
                "prefillValue": ""
              }
            ]
          },
          "position": {
            "type": "number",
            "example": 0,
            "default": 0
          },
          "model": {
            "type": "string",
            "description": "Model of the custom field you want to update",
            "example": "opportunity",
            "enum": [
              "contact",
              "opportunity"
            ]
          },
          "urlValidation": {
            "example": {
              "mode": "allow_only",
              "allowedDomains": [
                "example.com"
              ]
            },
            "description": "When provided, replaces URL validation rules (URL fields only).",
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "enum": [
                      "allow_all",
                      "allow_only",
                      "block"
                    ],
                    "example": "allow_all",
                    "description": "allow_all: any url. allow_only: only allowedDomains. block: anything but blockedDomains."
                  },
                  "allowedDomains": {
                    "example": [
                      "example.com"
                    ],
                    "description": "Domains accepted when mode is allow_only",
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "blockedDomains": {
                    "example": [],
                    "description": "Domains rejected when mode is block",
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "title": "UrlValidationDto"
              }
            ]
          },
          "dateTimeValidation": {
            "example": {
              "mode": "range",
              "rangeMin": "2026-01-01",
              "rangeMax": "2026-12-31"
            },
            "description": "When provided, replaces date/time validation rules (DATE, TIME, DATE_TIME fields only).",
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "enum": [
                      "any",
                      "future_only",
                      "past_only",
                      "range"
                    ],
                    "example": "any",
                    "description": "any: no restriction. future_only: value must be in future. past_only: value must be in past. range: value within rangeMin-rangeMax."
                  },
                  "bufferDays": {
                    "type": "number",
                    "example": 2,
                    "description": "For future_only: minimum days from today before a date is selectable"
                  },
                  "rollingDays": {
                    "type": "number",
                    "example": 30,
                    "description": "For future_only: rolling window in days from today (e.g. 30 = next 30 days). Mutually exclusive with bufferDays."
                  },
                  "rangeMin": {
                    "type": "string",
                    "example": "2026-01-01",
                    "description": "Required when mode is range. ISO date or datetime string"
                  },
                  "rangeMax": {
                    "type": "string",
                    "example": "2026-12-31",
                    "description": "Required when mode is range. ISO date or datetime string"
                  },
                  "daysAllowed": {
                    "description": "Days of week 0=Sunday..6=Saturday. Works alongside future_only, past_only, or range modes.",
                    "example": [
                      1,
                      2,
                      3,
                      4,
                      5
                    ],
                    "type": "array",
                    "items": {
                      "type": "number"
                    }
                  },
                  "inputType": {
                    "type": "string",
                    "enum": [
                      "date_only",
                      "time_only",
                      "date_and_time"
                    ],
                    "example": "date_and_time",
                    "description": "For DATE_TIME fields: collect date only, time only, or both (defaults per product if omitted)."
                  }
                },
                "title": "DateTimeValidationDto"
              }
            ]
          },
          "userFieldConfig": {
            "example": {
              "multiSelect": false
            },
            "description": "When provided, updates user field options except multiSelect (immutable after create).",
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "multiSelect": {
                    "type": "boolean",
                    "example": false,
                    "description": "Single or multi-select; cannot change after create"
                  }
                },
                "title": "UserFieldConfigDto"
              }
            ]
          },
          "optionDisplayType": {
            "type": "string",
            "enum": [
              "TEXT_ONLY",
              "TEXT_WITH_ICON",
              "TEXT_WITH_IMAGE"
            ],
            "example": "TEXT_WITH_IMAGE",
            "description": "When provided, updates the option rendering mode (RADIO / CHECKBOX only). One of TEXT_ONLY, TEXT_WITH_ICON, TEXT_WITH_IMAGE."
          }
        },
        "required": [
          "name"
        ],
        "title": "UpdateCustomFieldsDTO"
      },
      "CustomFieldSuccessfulResponseDto": {
        "type": "object",
        "properties": {
          "customField": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "example": "3sv6UEo51C9Bmpo1cKTq"
              },
              "name": {
                "type": "string",
                "example": "pincode"
              },
              "fieldKey": {
                "type": "string",
                "example": "contact.pincode"
              },
              "placeholder": {
                "type": "string",
                "example": "Pin code"
              },
              "dataType": {
                "type": "string",
                "example": "TEXT",
                "description": "Data type of the custom field.\n\nURL, USER, TIME, DATE_TIME and RICH_TEXT are Labs-only for now.",
                "enum": [
                  "TEXT",
                  "LARGE_TEXT",
                  "NUMERICAL",
                  "PHONE",
                  "MONETORY",
                  "CHECKBOX",
                  "SINGLE_OPTIONS",
                  "MULTIPLE_OPTIONS",
                  "FLOAT",
                  "TIME",
                  "DATE",
                  "TEXTBOX_LIST",
                  "FILE_UPLOAD",
                  "SIGNATURE",
                  "RADIO",
                  "URL",
                  "DATE_TIME",
                  "USER",
                  "RICH_TEXT"
                ]
              },
              "position": {
                "type": "number",
                "example": 0
              },
              "picklistOptions": {
                "example": [
                  "first option"
                ],
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "picklistImageOptions": {
                "example": [],
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "isAllowedCustomOption": {
                "type": "boolean",
                "example": false
              },
              "isMultiFileAllowed": {
                "type": "boolean",
                "example": true
              },
              "maxFileLimit": {
                "type": "number",
                "example": 4
              },
              "locationId": {
                "type": "string",
                "example": "3sv6UEo51C9Bmpo1cKTq"
              },
              "model": {
                "type": "string",
                "description": "Model of the custom field",
                "example": "opportunity",
                "enum": [
                  "contact",
                  "opportunity"
                ]
              },
              "urlValidation": {
                "example": {
                  "mode": "allow_only",
                  "allowedDomains": [
                    "example.com"
                  ]
                },
                "description": "URL validation (URL fields). Labs-only as of now.",
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "mode": {
                        "type": "string",
                        "enum": [
                          "allow_all",
                          "allow_only",
                          "block"
                        ],
                        "example": "allow_all",
                        "description": "allow_all: any url. allow_only: only allowedDomains. block: anything but blockedDomains."
                      },
                      "allowedDomains": {
                        "example": [
                          "example.com"
                        ],
                        "description": "Domains accepted when mode is allow_only",
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "blockedDomains": {
                        "example": [],
                        "description": "Domains rejected when mode is block",
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "title": "UrlValidationDto"
                  }
                ]
              },
              "dateTimeValidation": {
                "example": {
                  "mode": "range",
                  "rangeMin": "2026-01-01",
                  "rangeMax": "2026-12-31"
                },
                "description": "Date/time validation (DATE, TIME, DATE_TIME). DATE_TIME and TIME are Labs-only as of now.",
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "mode": {
                        "type": "string",
                        "enum": [
                          "any",
                          "future_only",
                          "past_only",
                          "range"
                        ],
                        "example": "any",
                        "description": "any: no restriction. future_only: value must be in future. past_only: value must be in past. range: value within rangeMin-rangeMax."
                      },
                      "bufferDays": {
                        "type": "number",
                        "example": 2,
                        "description": "For future_only: minimum days from today before a date is selectable"
                      },
                      "rollingDays": {
                        "type": "number",
                        "example": 30,
                        "description": "For future_only: rolling window in days from today (e.g. 30 = next 30 days). Mutually exclusive with bufferDays."
                      },
                      "rangeMin": {
                        "type": "string",
                        "example": "2026-01-01",
                        "description": "Required when mode is range. ISO date or datetime string"
                      },
                      "rangeMax": {
                        "type": "string",
                        "example": "2026-12-31",
                        "description": "Required when mode is range. ISO date or datetime string"
                      },
                      "daysAllowed": {
                        "description": "Days of week 0=Sunday..6=Saturday. Works alongside future_only, past_only, or range modes.",
                        "example": [
                          1,
                          2,
                          3,
                          4,
                          5
                        ],
                        "type": "array",
                        "items": {
                          "type": "number"
                        }
                      },
                      "inputType": {
                        "type": "string",
                        "enum": [
                          "date_only",
                          "time_only",
                          "date_and_time"
                        ],
                        "example": "date_and_time",
                        "description": "For DATE_TIME fields: collect date only, time only, or both (defaults per product if omitted)."
                      }
                    },
                    "title": "DateTimeValidationDto"
                  }
                ]
              },
              "userFieldConfig": {
                "example": {
                  "multiSelect": false
                },
                "description": "User field config (USER fields). Labs-only as of now.",
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "multiSelect": {
                        "type": "boolean",
                        "example": false,
                        "description": "Single or multi-select; cannot change after create"
                      }
                    },
                    "title": "UserFieldConfigDto"
                  }
                ]
              },
              "optionDisplayType": {
                "type": "string",
                "enum": [
                  "TEXT_ONLY",
                  "TEXT_WITH_ICON",
                  "TEXT_WITH_IMAGE"
                ],
                "example": "TEXT_WITH_IMAGE",
                "description": "Option rendering mode for RADIO / CHECKBOX. One of TEXT_ONLY, TEXT_WITH_ICON, TEXT_WITH_IMAGE."
              }
            },
            "title": "CustomFieldSchema"
          }
        },
        "title": "CustomFieldSuccessfulResponseDto"
      },
      "BadRequestDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 400
          },
          "message": {
            "type": "string",
            "example": "Bad Request"
          }
        },
        "title": "BadRequestDTO"
      },
      "UnauthorizedDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 401
          },
          "message": {
            "type": "string",
            "example": "Invalid token: access token is invalid"
          },
          "error": {
            "type": "string",
            "example": "Unauthorized"
          }
        },
        "title": "UnauthorizedDTO"
      },
      "UnprocessableDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 422
          },
          "message": {
            "example": [
              "Unprocessable Entity"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "error": {
            "type": "string",
            "example": "Unprocessable Entity"
          }
        },
        "title": "UnprocessableDTO"
      }
    }
  }
}
```

## HighLevel SDK Examples

**Node.js** (`@gohighlevel/api-client`)

```javascript
import HighLevel from '@gohighlevel/api-client';

const ghl = new HighLevel({
  privateIntegrationToken: '<PRIVATE_INTEGRATION_TOKEN>'
});

const body = {
  "name": "Custom Field",
  "placeholder": "Placeholder Text",
  "acceptedFormat": [
    ".pdf",
    ".docx",
    ".jpeg"
  ],
  "isMultipleFile": false,
  "maxNumberOfFiles": 2,
  "textBoxListOptions": [
    {
      "label": "First",
      "prefillValue": ""
    }
  ],
  "position": 0,
  "model": "opportunity",
  "urlValidation": {
    "mode": "allow_only",
    "allowedDomains": [
      "example.com"
    ]
  },
  "dateTimeValidation": {
    "mode": "range",
    "rangeMin": "2026-01-01",
    "rangeMax": "2026-12-31"
  },
  "userFieldConfig": {
    "multiSelect": false
  },
  "optionDisplayType": "TEXT_WITH_IMAGE"
};

const response = await ghl.locations.updateCustomField('<LOCATIONID>', '<ID>', body);
console.log(response);
```

**Python** (`gohighlevel-api-client`)

```python
from highlevel import HighLevel

client = HighLevel(
    private_integration_token='<PRIVATE_INTEGRATION_TOKEN>'
)

body = {
    "name": "Custom Field",
    "placeholder": "Placeholder Text",
    "acceptedFormat": [
        ".pdf",
        ".docx",
        ".jpeg"
    ],
    "isMultipleFile": false,
    "maxNumberOfFiles": 2,
    "textBoxListOptions": [
        {
            "label": "First",
            "prefillValue": ""
        }
    ],
    "position": 0,
    "model": "opportunity",
    "urlValidation": {
        "mode": "allow_only",
        "allowedDomains": [
            "example.com"
        ]
    },
    "dateTimeValidation": {
        "mode": "range",
        "rangeMin": "2026-01-01",
        "rangeMax": "2026-12-31"
    },
    "userFieldConfig": {
        "multiSelect": false
    },
    "optionDisplayType": "TEXT_WITH_IMAGE"
}

response = await client.locations.update_custom_field('<LOCATIONID>', '<ID>', body=body)
print(response)
```

**PHP** (`gohighlevel/api-client`)

```php
<?php
require_once 'vendor/autoload.php';

use HighLevel\HighLevel;
use HighLevel\HighLevelConfig;

$config = new HighLevelConfig([
    'privateIntegrationToken' => '<PRIVATE_INTEGRATION_TOKEN>'
]);
$ghl = new HighLevel($config);

$body = [
    'name' => 'Custom Field',
    'placeholder' => 'Placeholder Text',
    'acceptedFormat' => [
        '.pdf',
        '.docx',
        '.jpeg'
    ],
    'isMultipleFile' => false,
    'maxNumberOfFiles' => 2,
    'textBoxListOptions' => [
        [
            'label' => 'First',
            'prefillValue' => ''
        ]
    ],
    'position' => 0,
    'model' => 'opportunity',
    'urlValidation' => [
        'mode' => 'allow_only',
        'allowedDomains' => [
            'example.com'
        ]
    ],
    'dateTimeValidation' => [
        'mode' => 'range',
        'rangeMin' => '2026-01-01',
        'rangeMax' => '2026-12-31'
    ],
    'userFieldConfig' => [
        'multiSelect' => false
    ],
    'optionDisplayType' => 'TEXT_WITH_IMAGE'
];

$response = $ghl->locations->updateCustomField('<LOCATIONID>', '<ID>', $body);
echo json_encode($response, JSON_PRETTY_PRINT);
```

## Code Examples

**cURL**

```bash
curl -L -X PUT 'https://services.leadconnectorhq.com/locations/<locationId>/customFields/<id>' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: 2023-02-21' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "name": "Custom Field",
  "placeholder": "Placeholder Text",
  "acceptedFormat": [
    ".pdf",
    ".docx",
    ".jpeg"
  ],
  "isMultipleFile": false,
  "maxNumberOfFiles": 2,
  "textBoxListOptions": [
    {
      "label": "First",
      "prefillValue": ""
    }
  ],
  "position": 0,
  "model": "opportunity",
  "urlValidation": {
    "mode": "allow_only",
    "allowedDomains": [
      "example.com"
    ]
  },
  "dateTimeValidation": {
    "mode": "range",
    "rangeMin": "2026-01-01",
    "rangeMax": "2026-12-31"
  },
  "userFieldConfig": {
    "multiSelect": false
  },
  "optionDisplayType": "TEXT_WITH_IMAGE"
}'
```

**Node.js**

```javascript
const options = {
  method: 'PUT',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: '2023-02-21',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
      "name": "Custom Field",
      "placeholder": "Placeholder Text",
      "acceptedFormat": [
        ".pdf",
        ".docx",
        ".jpeg"
      ],
      "isMultipleFile": false,
      "maxNumberOfFiles": 2,
      "textBoxListOptions": [
        {
          "label": "First",
          "prefillValue": ""
        }
      ],
      "position": 0,
      "model": "opportunity",
      "urlValidation": {
        "mode": "allow_only",
        "allowedDomains": [
          "example.com"
        ]
      },
      "dateTimeValidation": {
        "mode": "range",
        "rangeMin": "2026-01-01",
        "rangeMax": "2026-12-31"
      },
      "userFieldConfig": {
        "multiSelect": false
      },
      "optionDisplayType": "TEXT_WITH_IMAGE"
  })
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/locations/<locationId>/customFields/<id>', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/locations/{locationId}/customFields/{id}"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "2023-02-21"
}

payload = {
    "name": "Custom Field",
    "placeholder": "Placeholder Text",
    "acceptedFormat": [
        ".pdf",
        ".docx",
        ".jpeg"
    ],
    "isMultipleFile": false,
    "maxNumberOfFiles": 2,
    "textBoxListOptions": [
        {
            "label": "First",
            "prefillValue": ""
        }
    ],
    "position": 0,
    "model": "opportunity",
    "urlValidation": {
        "mode": "allow_only",
        "allowedDomains": [
            "example.com"
        ]
    },
    "dateTimeValidation": {
        "mode": "range",
        "rangeMin": "2026-01-01",
        "rangeMax": "2026-12-31"
    },
    "userFieldConfig": {
        "multiSelect": false
    },
    "optionDisplayType": "TEXT_WITH_IMAGE"
}

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

**PHP**

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/locations/<locationId>/customFields/<id>',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'PUT',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: 2023-02-21',
    'Content-Type: application/json',
  ],
  CURLOPT_POSTFIELDS => '{
  "name": "Custom Field",
  "placeholder": "Placeholder Text",
  "acceptedFormat": [
    ".pdf",
    ".docx",
    ".jpeg"
  ],
  "isMultipleFile": false,
  "maxNumberOfFiles": 2,
  "textBoxListOptions": [
    {
      "label": "First",
      "prefillValue": ""
    }
  ],
  "position": 0,
  "model": "opportunity",
  "urlValidation": {
    "mode": "allow_only",
    "allowedDomains": [
      "example.com"
    ]
  },
  "dateTimeValidation": {
    "mode": "range",
    "rangeMin": "2026-01-01",
    "rangeMax": "2026-12-31"
  },
  "userFieldConfig": {
    "multiSelect": false
  },
  "optionDisplayType": "TEXT_WITH_IMAGE"
}',
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

**Java**

```java
HttpResponse<String> response = Unirest
  .put("https://services.leadconnectorhq.com/locations/<locationId>/customFields/<id>")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "2023-02-21")
  .header("Content-Type", "application/json")
  .body("{\"name\":\"Custom Field\",\"placeholder\":\"Placeholder Text\",\"acceptedFormat\":[\".pdf\",\".docx\",\".jpeg\"],\"isMultipleFile\":false,\"maxNumberOfFiles\":2,\"textBoxListOptions\":[{\"label\":\"First\",\"prefillValue\":\"\"}],\"position\":0,\"model\":\"opportunity\",\"urlValidation\":{\"mode\":\"allow_only\",\"allowedDomains\":[\"example.com\"]},\"dateTimeValidation\":{\"mode\":\"range\",\"rangeMin\":\"2026-01-01\",\"rangeMax\":\"2026-12-31\"},\"userFieldConfig\":{\"multiSelect\":false},\"optionDisplayType\":\"TEXT_WITH_IMAGE\"}")
  .asString();
```

**Go**

```go
package main

import (
  "fmt"
  "net/http"
  "io"
  "strings"
)

func main() {
  url := "https://services.leadconnectorhq.com/locations/<locationId>/customFields/<id>"
  payload := strings.NewReader(`{
  "name": "Custom Field",
  "placeholder": "Placeholder Text",
  "acceptedFormat": [
    ".pdf",
    ".docx",
    ".jpeg"
  ],
  "isMultipleFile": false,
  "maxNumberOfFiles": 2,
  "textBoxListOptions": [
    {
      "label": "First",
      "prefillValue": ""
    }
  ],
  "position": 0,
  "model": "opportunity",
  "urlValidation": {
    "mode": "allow_only",
    "allowedDomains": [
      "example.com"
    ]
  },
  "dateTimeValidation": {
    "mode": "range",
    "rangeMin": "2026-01-01",
    "rangeMax": "2026-12-31"
  },
  "userFieldConfig": {
    "multiSelect": false
  },
  "optionDisplayType": "TEXT_WITH_IMAGE"
}`)
  req, _ := http.NewRequest("PUT", url, payload)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "2023-02-21")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

**Ruby**

```ruby
require 'uri'
require 'net/http'

url = URI("https://services.leadconnectorhq.com/locations/<locationId>/customFields/<id>")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "2023-02-21"
request["Content-Type"] = "application/json"
request.body = '{
  "name": "Custom Field",
  "placeholder": "Placeholder Text",
  "acceptedFormat": [
    ".pdf",
    ".docx",
    ".jpeg"
  ],
  "isMultipleFile": false,
  "maxNumberOfFiles": 2,
  "textBoxListOptions": [
    {
      "label": "First",
      "prefillValue": ""
    }
  ],
  "position": 0,
  "model": "opportunity",
  "urlValidation": {
    "mode": "allow_only",
    "allowedDomains": [
      "example.com"
    ]
  },
  "dateTimeValidation": {
    "mode": "range",
    "rangeMin": "2026-01-01",
    "rangeMax": "2026-12-31"
  },
  "userFieldConfig": {
    "multiSelect": false
  },
  "optionDisplayType": "TEXT_WITH_IMAGE"
}'

response = http.request(request)
puts response.read_body
```

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "2023-02-21"
}

$body = '{
  "name": "Custom Field",
  "placeholder": "Placeholder Text",
  "acceptedFormat": [
    ".pdf",
    ".docx",
    ".jpeg"
  ],
  "isMultipleFile": false,
  "maxNumberOfFiles": 2,
  "textBoxListOptions": [
    {
      "label": "First",
      "prefillValue": ""
    }
  ],
  "position": 0,
  "model": "opportunity",
  "urlValidation": {
    "mode": "allow_only",
    "allowedDomains": [
      "example.com"
    ]
  },
  "dateTimeValidation": {
    "mode": "range",
    "rangeMin": "2026-01-01",
    "rangeMax": "2026-12-31"
  },
  "userFieldConfig": {
    "multiSelect": false
  },
  "optionDisplayType": "TEXT_WITH_IMAGE"
}'

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/locations/<locationId>/customFields/<id>' -Method 'PUT' -Headers $headers -Body $body -ContentType 'application/json'
$response | ConvertTo-Json
```
