# UpdateSetting

Update a single setting

`PUT /api/v2/companies/{companyId}/settings/{id}`

**API:** AvaTax API
**Tag:** Settings
**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/crossborder/api/methods/Settings/UpdateSetting/

## Description

Replace the existing setting object at this URL with an updated object.
            
The company settings system is a metadata system that you can use to store extra information
about a company.  Your integration or connector could use this data storage to keep track of
preference information, reminders, or any other storage that would need to persist even if
the customer uninstalls your application.
            
A setting can refer to any type of data you need to remember about this company object.
When creating this object, you may define your own `set`, `name`, and `value` parameters.
To define your own values, please choose a `set` name that begins with `X-` to indicate an extension.
            
All data from the existing object will be replaced with data in the object you `PUT`.
            
To set a field's value to `null`, you may either set its value to `null` or omit that field from the object when calling update.

### Security Policies

* This API requires one of the following user roles: AccountAdmin, AvaTaxOnlyAccountAdmin, AvaTaxOnlyCompanyAdmin, BatchServiceAdmin, CompanyAdmin, CSPTester, ProStoresOperator, Registrar, ReturnsOnlyAccountAdmin, ReturnsOnlyCompanyAdmin, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `companyId` | integer | path | Yes | The ID of the company that this setting belongs to. |
| `id` | integer | path | Yes | The ID of the setting you wish to update |
| `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:** `SettingModel`

This object is used to keep track of custom information about a company.
            
The company settings system is a metadata system that you can use to store extra information
about a company.  Your integration or connector could use this data storage to keep track of
preference information, reminders, or any other storage that would need to persist even if
the customer uninstalls your application.
            
A setting can refer to any type of data you need to remember about this company object.
When creating this object, you may define your own `set`, `name`, and `value` parameters.
To define your own values, please choose a `set` name that begins with `X-` to indicate an extension.

| Property | Type | Required | Description |
|---|---|---|---|
| `id` | integer | **Yes** | The unique ID number of this setting. Example: `56789`. |
| `companyId` | integer | No | The unique ID number of the company this setting refers to. Example: `12345`. |
| `set` | string | **Yes** | A user-defined "set" containing this setting.
            
Avalara defines some sets that cannot be changed.  To create your own set, choose a set
name that begins with `X-` to indicate that this is an extension value.
            
We recommend that you choose a set name that clearly identifies your application, and then
store data within name/value pairs within that set.  For example, if you were creating an
application called MyApp, you might choose to create a set named `X-MyCompany-MyApp`. Example: `ItemsToRemember`. |
| `name` | string | **Yes** | A user-defined "name" for this name-value pair. Example: `Texas`. |
| `value` | string | No | The value of this name-value pair. Example: `Alamo`. |
| `modifiedDate` | string | No | The value when the entry was last modified. |
| `modifiedUserId` | integer | No | The value identifying who last modified the entry. |

## Responses

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

### 200 Response: `SettingModel`

This object is used to keep track of custom information about a company.
            
The company settings system is a metadata system that you can use to store extra information
about a company.  Your integration or connector could use this data storage to keep track of
preference information, reminders, or any other storage that would need to persist even if
the customer uninstalls your application.
            
A setting can refer to any type of data you need to remember about this company object.
When creating this object, you may define your own `set`, `name`, and `value` parameters.
To define your own values, please choose a `set` name that begins with `X-` to indicate an extension.

| Property | Type | Required | Description |
|---|---|---|---|
| `id` | integer | **Yes** | The unique ID number of this setting. Example: `56789`. |
| `companyId` | integer | No | The unique ID number of the company this setting refers to. Example: `12345`. |
| `set` | string | **Yes** | A user-defined "set" containing this setting.
            
Avalara defines some sets that cannot be changed.  To create your own set, choose a set
name that begins with `X-` to indicate that this is an extension value.
            
We recommend that you choose a set name that clearly identifies your application, and then
store data within name/value pairs within that set.  For example, if you were creating an
application called MyApp, you might choose to create a set named `X-MyCompany-MyApp`. Example: `ItemsToRemember`. |
| `name` | string | **Yes** | A user-defined "name" for this name-value pair. Example: `Texas`. |
| `value` | string | No | The value of this name-value pair. Example: `Alamo`. |
| `modifiedDate` | string | No | The value when the entry was last modified. |
| `modifiedUserId` | integer | No | The value identifying who last modified the entry. |

## Example Request

```bash
curl -X PUT "https://sandbox-rest.avatax.com/api/v2/companies/{companyId}/settings/{id}" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
  "id": 56789,
  "companyId": 12345,
  "set": "ItemsToRemember",
  "name": "Texas",
  "value": "Alamo"
}'
```