# UpdateUserDefinedField

Update a User Defined Field identified by id for a company

`POST /api/v2/companies/{companyId}/userdefinedfields`

**API:** AvaTax API
**Tag:** UserDefinedFields
**API Version:** v2
**Base URL:** https://sandbox-rest.avatax.com/
**Content-Type:** `application/json`
**Accepts:** `application/json`
**Authentication:** API Key (`Authorization` in header) or OAuth 2.0 or Basic (username + license key)

Source: https://developer.avalara.com/products/avatax/api/methods/UserDefinedFields/UpdateUserDefinedField/

## Description

Updates a User Defined Field for a company.

### Security Policies

* This API requires one of the following user roles: AccountAdmin, AvaTaxOnlyAccountAdmin, AvaTaxOnlyCompanyAdmin, BatchServiceAdmin, CompanyAdmin, CSPTester, FirmAdmin, Registrar, ReturnsOnlyAccountAdmin, ReturnsOnlyCompanyAdmin, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
* This API depends on the following active services:*Required* (all):  AvaTaxPro, BasicReturns.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `companyId` | integer | path | Yes | The id of the company the user defined field belongs to. |
| `id` | integer | query | No |  |
| `X-Avalara-Client` | string | header | No | Identifies the software you are using to call this API.  For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . |

## Request Body

**Schema:** `CompanyUserDefinedFieldModel`

| Property | Type | Required | Description |
|---|---|---|---|
| `id` | integer | No | The id of the datasource. Example: `1`. |
| `companyId` | integer | No | The id of the company to which the datasource belongs to. Example: `12345`. |
| `name` | string | **Yes** | The extractor/connector id. Example: `UDF1`. |
| `friendlyName` | string | **Yes** | The unique ID number of this connection. Example: `General Ledger Account Number`. |
| `dataType` | string | No | The unique ID number of this connection. Values: `String`, `Number`, `Date`, `Boolean`. Example: `String`. |
| `userDefinedFieldType` | string | No | The category of user defined type For Example: Document level or Line level UDF. Values: `Document`, `Line`. Example: `Document`. |
| `createdUserId` | integer | No | The User ID of the user who created this record. Example: `123`. |
| `createdDate` | string | No | The date when this record was created. Example: `2026-07-02T00:00:00+00:00`. |
| `modifiedUserId` | integer | No | The user ID of the user who last modified this record. Example: `12`. |
| `modifiedDate` | string | No | The date/time when this record was last modified. Example: `2026-07-02T00:00:00+00:00`. |

## Responses

| Status | Description | Schema |
|---|---|---|
| 200 | Success | `CompanyUserDefinedFieldModel` |
| 400 | Bad Request |  |
| 401 | Unauthorized |  |
| 404 | Not Found |  |

### 200 Response: `CompanyUserDefinedFieldModel`

| Property | Type | Required | Description |
|---|---|---|---|
| `id` | integer | No | The id of the datasource. Example: `1`. |
| `companyId` | integer | No | The id of the company to which the datasource belongs to. Example: `12345`. |
| `name` | string | **Yes** | The extractor/connector id. Example: `UDF1`. |
| `friendlyName` | string | **Yes** | The unique ID number of this connection. Example: `General Ledger Account Number`. |
| `dataType` | string | No | The unique ID number of this connection. Values: `String`, `Number`, `Date`, `Boolean`. Example: `String`. |
| `userDefinedFieldType` | string | No | The category of user defined type For Example: Document level or Line level UDF. Values: `Document`, `Line`. Example: `Document`. |
| `createdUserId` | integer | No | The User ID of the user who created this record. Example: `123`. |
| `createdDate` | string | No | The date when this record was created. Example: `2026-07-02T00:00:00+00:00`. |
| `modifiedUserId` | integer | No | The user ID of the user who last modified this record. Example: `12`. |
| `modifiedDate` | string | No | The date/time when this record was last modified. Example: `2026-07-02T00:00:00+00:00`. |

## Example Request

```bash
curl -X POST "https://sandbox-rest.avatax.com/api/v2/companies/{companyId}/userdefinedfields" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
  "id": 1,
  "companyId": 12345,
  "name": "UDF1",
  "friendlyName": "General Ledger Account Number",
  "dataType": "String",
  "userDefinedFieldType": "Document",
  "createdUserId": 123,
  "createdDate": "2026-07-02T00:00:00+00:00",
  "modifiedUserId": 12,
  "modifiedDate": "2026-07-02T00:00:00+00:00"
}'
```