# UpdateContact

Update a single contact

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

**API:** AvaTax API
**Tag:** Contacts
**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/Contacts/UpdateContact/

## Description

Replace the existing contact object at this URL with an updated object.
A 'contact' is a person associated with a company who is designated to handle certain responsibilities of
a tax collecting and filing entity.
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 you post.

### Security Policies

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

## Parameters

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

A contact person for a company.

| Property | Type | Required | Description |
|---|---|---|---|
| `id` | integer | No | The unique ID number of this contact. Example: `56789`. |
| `companyId` | integer | No | The unique ID number of the company to which this contact belongs. Example: `12345`. |
| `contactCode` | string | **Yes** | A unique code for this contact which is unique throughout company. Example: `TestContact24a472560d9140`. |
| `firstName` | string | No | The first or given name of this contact. Example: `Bob`. |
| `middleName` | string | No | The middle name of this contact. |
| `lastName` | string | No | The last or family name of this contact. Example: `McExample`. |
| `title` | string | No | Professional title of this contact. Example: `Owner`. |
| `line1` | string | No | The first line of the postal mailing address of this contact. Example: `2000 Main Street`. |
| `line2` | string | No | The second line of the postal mailing address of this contact. |
| `line3` | string | No | The third line of the postal mailing address of this contact. |
| `city` | string | No | The city of the postal mailing address of this contact. Example: `Irvine`. |
| `region` | string | No | Name or ISO 3166 code identifying the region within the country.
            
This field supports many different region identifiers:
 * Two and three character ISO 3166 region codes
 * Fully spelled out names of the region in ISO supported languages
 * Common alternative spellings for many regions
            
For a full list of all supported codes and names, please see the Definitions API `ListRegions`. Example: `CA`. |
| `postalCode` | string | No | The postal code or zip code of the postal mailing address of this contact. Example: `92614`. |
| `country` | string | No | Name or ISO 3166 code identifying the country.
            
This field supports many different country identifiers:
 * Two character ISO 3166 codes
 * Three character ISO 3166 codes
 * Fully spelled out names of the country in ISO supported languages
 * Common alternative spellings for many countries
            
For a full list of all supported codes and names, please see the Definitions API `ListCountries`. Example: `US`. |
| `email` | string | No | The email address of this contact. Example: `bob@example.org`. |
| `phone` | string | No | The main phone number for this contact. Example: `714 555-1212`. |
| `mobile` | string | No | The mobile phone number for this contact. |
| `fax` | string | No | The facsimile phone number for this contact. |
| `createdDate` | string | No | The date when this record was created. |
| `createdUserId` | integer | No | The User ID of the user who created this record. |
| `modifiedDate` | string | No | The date/time when this record was last modified. |
| `modifiedUserId` | integer | No | The user ID of the user who last modified this record. |

## Responses

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

### 200 Response: `ContactModel`

A contact person for a company.

| Property | Type | Required | Description |
|---|---|---|---|
| `id` | integer | No | The unique ID number of this contact. Example: `56789`. |
| `companyId` | integer | No | The unique ID number of the company to which this contact belongs. Example: `12345`. |
| `contactCode` | string | **Yes** | A unique code for this contact which is unique throughout company. Example: `TestContact24a472560d9140`. |
| `firstName` | string | No | The first or given name of this contact. Example: `Bob`. |
| `middleName` | string | No | The middle name of this contact. |
| `lastName` | string | No | The last or family name of this contact. Example: `McExample`. |
| `title` | string | No | Professional title of this contact. Example: `Owner`. |
| `line1` | string | No | The first line of the postal mailing address of this contact. Example: `2000 Main Street`. |
| `line2` | string | No | The second line of the postal mailing address of this contact. |
| `line3` | string | No | The third line of the postal mailing address of this contact. |
| `city` | string | No | The city of the postal mailing address of this contact. Example: `Irvine`. |
| `region` | string | No | Name or ISO 3166 code identifying the region within the country.
            
This field supports many different region identifiers:
 * Two and three character ISO 3166 region codes
 * Fully spelled out names of the region in ISO supported languages
 * Common alternative spellings for many regions
            
For a full list of all supported codes and names, please see the Definitions API `ListRegions`. Example: `CA`. |
| `postalCode` | string | No | The postal code or zip code of the postal mailing address of this contact. Example: `92614`. |
| `country` | string | No | Name or ISO 3166 code identifying the country.
            
This field supports many different country identifiers:
 * Two character ISO 3166 codes
 * Three character ISO 3166 codes
 * Fully spelled out names of the country in ISO supported languages
 * Common alternative spellings for many countries
            
For a full list of all supported codes and names, please see the Definitions API `ListCountries`. Example: `US`. |
| `email` | string | No | The email address of this contact. Example: `bob@example.org`. |
| `phone` | string | No | The main phone number for this contact. Example: `714 555-1212`. |
| `mobile` | string | No | The mobile phone number for this contact. |
| `fax` | string | No | The facsimile phone number for this contact. |
| `createdDate` | string | No | The date when this record was created. |
| `createdUserId` | integer | No | The User ID of the user who created this record. |
| `modifiedDate` | string | No | The date/time when this record was last modified. |
| `modifiedUserId` | integer | No | The user ID of the user who last modified this record. |

## Example Request

```bash
curl -X PUT "https://sandbox-rest.avatax.com/api/v2/companies/{companyId}/contacts/{id}" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
  "id": 56789,
  "companyId": 12345,
  "contactCode": "TestContact24a472560d9140",
  "firstName": "Bob",
  "lastName": "McExample",
  "title": "Owner",
  "line1": "2000 Main Street",
  "city": "Irvine",
  "region": "CA",
  "postalCode": "92614",
  "country": "US",
  "email": "bob@example.org",
  "phone": "714 555-1212"
}'
```