# GetUserEntitlements

Retrieve all entitlements for a single user

`GET /api/v2/accounts/{accountId}/users/{id}/entitlements`

**API:** AvaTax API
**Tag:** Users
**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/avatax/api/methods/Users/GetUserEntitlements/

## Description

Return a list of all entitlements to which this user has rights to access.
Entitlements are a list of specified API calls the user is permitted to make, a list of identifier numbers for companies the user is
allowed to use, and an access level identifier that indicates what types of access roles the user is allowed to use.
This API call is intended to provide a validation endpoint to determine, before making an API call, whether this call is likely to succeed.
For example, if user 567 within account 999 is attempting to create a new child company underneath company 12345, you could preview the user's
entitlements and predict whether this call would succeed:
            
* Retrieve entitlements by calling '/api/v2/accounts/999/users/567/entitlements' .  If the call fails, you do not have accurate
    credentials for this user.
* If the 'accessLevel' field within entitlements is 'None', the call will fail.
* If the 'accessLevel' field within entitlements is 'SingleCompany' or 'SingleAccount', the call will fail if the companies
    table does not contain the ID number 12345.
* If the 'permissions' array within entitlements does not contain 'AccountSvc.CompanySave', the call will fail.
            
For a full list of defined permissions, please use '/api/v2/definitions/permissions' .

### Security Policies

* This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, AvaTaxOnlyAccountAdmin, AvaTaxOnlyAccountUser, AvaTaxOnlyCompanyAdmin, AvaTaxOnlyCompanyUser, AvaTaxOnlyUserAdmin, BatchServiceAdmin, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, ECMAccountUser, ECMCompanyUser, FirmAdmin, FirmUser, ProStoresOperator, Registrar, ReturnsOnlyAccountAdmin, ReturnsOnlyAccountUser, ReturnsOnlyCompanyAdmin, ReturnsOnlyCompanyUser, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `id` | integer | path | Yes | The ID of the user to retrieve. |
| `accountId` | integer | path | Yes | The accountID of the user you wish to get. |
| `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 | `UserEntitlementModel` |
| 400 | Bad Request |  |
| 401 | Unauthorized |  |
| 404 | Not Found |  |

### 200 Response: `UserEntitlementModel`

User Entitlement Model

| Property | Type | Required | Description |
|---|---|---|---|
| `permissions` | string[] | No | List of API names and categories that this user is permitted to access |
| `accessLevel` | string | No | What access privileges does the current user have to see companies? Values: `None`, `SingleCompany`, `SingleAccount`, `AllCompanies`, `FirmManagedAccounts`. Example: `None`. |
| `companies` | integer[] | No | The identities of all companies this user is permitted to access |

## Example Request

```bash
curl -X GET "https://sandbox-rest.avatax.com/api/v2/accounts/{accountId}/users/{id}/entitlements" \
  -H "Authorization: Basic <credentials>" \
  -H "Accept: application/json"
```