# Update a Tenant

`PATCH https://api.agilitycredit.net/v3/tenants/{id}`

Docs page: https://apidocs.agilitycredit.com/api/update-tenant · Tag: Administration

Updates the account details and driver license verification addons of a tenant. You can update your own tenant or any tenant you are an integrator of. Every other configuration setting is managed from the Agility Portal. Returns the updated tenant.

Authentication: `Authorization: Bearer <api key>`.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `id` | path | yes | ID of the tenant. |
| `Agc-Tenant-Id` | header | yes | The tenant ID provided by Agility Credit. |
| `Agc-User-Id` | header | yes | The requestor user ID. |

## Request body (`application/json`), required

Schema: `UpdateTenant`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `account_name` | string |  |  |
| `legal_name` | string |  |  |
| `address_billing` | object |  |  |
| `address_billing.street` | string | yes |  |
| `address_billing.city` | string | yes |  |
| `address_billing.state_code` | string | yes | Two-letter uppercase state code. |
| `address_billing.postal_code` | string | yes |  |
| `address_billing.country_code` | string | yes | Two-letter uppercase ISO country code. |
| `address_physical` | object |  |  |
| `address_physical.street` | string | yes |  |
| `address_physical.city` | string | yes |  |
| `address_physical.state_code` | string | yes | Two-letter uppercase state code. |
| `address_physical.postal_code` | string | yes |  |
| `address_physical.country_code` | string | yes | Two-letter uppercase ISO country code. |
| `phone_number` | string |  |  |
| `website` | string |  |  |
| `tax_id` | string |  |  |
| `company_established_date` | string |  | Date in `YYYY-MM-DD` format. |
| `timezone` | string |  | IANA timezone name. Defaults to `America/Los_Angeles`. |
| `subdomain` | string |  | Lowercase letters, digits and hyphens (1 to 63 characters, not starting or ending with a hyphen). Must be unique across Agility Credit. Defaults to the generated tenant ID. |
| `market` | string: `automotive`, `non-automotive`, `mortgage` |  |  |
| `enduser_type` | string |  |  |
| `nature_of_business` | string: `auto_dealer`, `vehicle_financing`, `auto_refinance`, `equipment_financing`, `medical_financing`, `home_improvement_financing`, `buy_now_pay_later`, `unsecured`, `personal_loans`, `tax_relief`, … (6 more) |  |  |
| `primary_title` | string |  |  |
| `inspection_email` | string |  |  |
| `inspection_full_name` | string |  |  |
| `inspection_phone` | string |  |  |
| `inspection_title` | string |  |  |
| `product_addons` | object |  | Driver license verification is the only product addon that can be changed through the API. `driver_license_verify` must be enabled (in the same request or already on the tenant) to enable `driver_license_verify_doc_liveness` or `driver_lic… |
| `product_addons.driver_license_verify` | boolean |  |  |
| `product_addons.driver_license_verify_doc_liveness` | boolean |  |  |
| `product_addons.driver_license_verify_selfie` | boolean |  |  |
| `ip_whitelist` | array of object |  |  |
| `ip_whitelist[].value` | string | yes |  |
| `ip_whitelist[].description` | string | yes |  |

Example:

```json
{
  "phone_number": "5125550199",
  "product_addons": {
    "driver_license_verify_selfie": true
  }
}
```

## Responses

| Status | Description | Body |
| --- | --- | --- |
| 200 | Tenant updated | TenantResponse |
| 400 | Bad Request. Returned when the body fails schema validation, when no field is sent, or when `driver_license_verify_doc_liveness` or `driver_license_verify_selfie` would be enabled without `driver_license_verify`. | BadRequestResponse |
| 401 | Unauthorized | UnauthorizedResponse |
| 404 | The tenant does not exist, or it is neither your own tenant nor one you are an integrator of. | TenantErrorResponse |
| 409 | The subdomain is already taken. | TenantErrorResponse |
| 429 | Too Many Requests | TooManyRequestsResponse |
| 500 | Internal Server Error | AgilityServerErrorResponse |
Top-level 200 fields: `tenant_id`, `account_name`, `legal_name`, `address_billing`, `address_physical`, `phone_number`, `website`, `tax_id`, `company_established_date`, `timezone`, `subdomain`, `market`, `enduser_type`, `nature_of_business`, `primary_title`, `inspection_email`, `inspection_full_name`, `inspection_phone`, `inspection_title`, `ip_whitelist`, `product_addons`, `parent_id`, `status`, `type`, `created_at`, `updated_at`.

### Error bodies

400:

```json
{
  "error": "driver_license_verify must be enabled to enable driver_license_verify_selfie"
}
```

401:

```json
{
  "message": "Unauthorized"
}
```

404:

```json
{
  "error": "Tenant Not Found"
}
```

409:

```json
{
  "error": "Subdomain already exists"
}
```

429:

```json
{
  "error": "Too Many Requests"
}
```

500:

```json
{
  "message": "Agility Server Error"
}
```
