# UpdateDataSource

Update a datasource identified by id for a company

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

**API:** AvaTax API
**Tag:** DataSources
**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/DataSources/UpdateDataSource/

## Description

Updates a datasource 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 datasource belongs to. |
| `id` | integer | path | Yes | The id of the datasource 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/) . |

## Request Body

**Schema:** `DataSourceModel`

Data source object

| Property | Type | Required | Description |
|---|---|---|---|
| `id` | integer | No | The id of the datasource. Example: `1`. |
| `companyId` | integer | **Yes** | The id of the company to which the datasource belongs to. Example: `12345`. |
| `source` | string | **Yes** | The extractor/connector id. Example: `Amazon v2 Extractor`. |
| `instance` | string | No | The unique ID number of this connection. Example: `82f62704-7eaa-48ba-8422-410746a4bf3f`. |
| `isEnabled` | boolean | No | The connection using the connection_id is enabled. The customer is responsible to enable or disable. Example: `false`. |
| `isSynced` | boolean | No | If all the information has been transferred from the extractor to the database. Example: `false`. |
| `isAuthorized` | boolean | No | True if this data source is authorized. Example: `false`. |
| `lastSyncedDate` | string | No | The date when the information was last synched. |
| `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`. |
| `deletedDate` | string | No | The date when this record was deleted. |
| `recalculate` | boolean | No | Specifies whether transactions created by this data source needs to re-calculate tax or not |
| `name` | string | No | Specifies the name of the extractor Example: `TestName`. |
| `externalState` | string | No | Specifies any implementation-specific information along with the DataSource.This field has no internal meaning in AvaTax and is purely for the convenience of the DataSource API user Example: `Test Path`. |

## Responses

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

### 200 Response: `DataSourceModel`

Data source object

| Property | Type | Required | Description |
|---|---|---|---|
| `id` | integer | No | The id of the datasource. Example: `1`. |
| `companyId` | integer | **Yes** | The id of the company to which the datasource belongs to. Example: `12345`. |
| `source` | string | **Yes** | The extractor/connector id. Example: `Amazon v2 Extractor`. |
| `instance` | string | No | The unique ID number of this connection. Example: `82f62704-7eaa-48ba-8422-410746a4bf3f`. |
| `isEnabled` | boolean | No | The connection using the connection_id is enabled. The customer is responsible to enable or disable. Example: `false`. |
| `isSynced` | boolean | No | If all the information has been transferred from the extractor to the database. Example: `false`. |
| `isAuthorized` | boolean | No | True if this data source is authorized. Example: `false`. |
| `lastSyncedDate` | string | No | The date when the information was last synched. |
| `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`. |
| `deletedDate` | string | No | The date when this record was deleted. |
| `recalculate` | boolean | No | Specifies whether transactions created by this data source needs to re-calculate tax or not |
| `name` | string | No | Specifies the name of the extractor Example: `TestName`. |
| `externalState` | string | No | Specifies any implementation-specific information along with the DataSource.This field has no internal meaning in AvaTax and is purely for the convenience of the DataSource API user Example: `Test Path`. |

## Example Request

```bash
curl -X PUT "https://sandbox-rest.avatax.com/api/v2/companies/{companyId}/datasources/{id}" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
  "id": 1,
  "companyId": 12345,
  "source": "Amazon v2 Extractor",
  "instance": "82f62704-7eaa-48ba-8422-410746a4bf3f",
  "isEnabled": false,
  "isSynced": false,
  "isAuthorized": false,
  "createdUserId": 123,
  "createdDate": "2026-07-02T00:00:00+00:00",
  "modifiedUserId": 12,
  "modifiedDate": "2026-07-02T00:00:00+00:00",
  "name": "TestName",
  "externalState": "Test Path"
}'
```