# DeleteUserDefinedField

Delete a User Defined Field by User Defined Field id for a company.

`DELETE /api/v2/companies/{companyId}/userdefinedfields/{id}`

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

Source: https://developer.avalara.com/products/crossborder/api/methods/UserDefinedFields/DeleteUserDefinedField/

## Description

Marks the existing user defined field for a company as deleted.

### 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 | path | Yes | The id of the User Defined Field you wish to delete. |
| `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/) . |

## Responses

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

## Example Request

```bash
curl -X DELETE "https://sandbox-rest.avatax.com/api/v2/companies/{companyId}/userdefinedfields/{id}" \
  -H "Authorization: Basic <credentials>" \
  -H "Accept: application/json"
```