# How access works

An Application calls the Aryeo API with an access token. The token says whom the Application acts for, and in which company. The Aryeo authorization server, `https://auth.aryeo.com`, issues it.

An Application uses three kinds of token. The sections below outline each, describing what it can be used for, how to get it, and what limits it. [Getting a token](/apis/vendor-platform/guides/authentication/tokens/getting-a-token) gives the steps that every kind shares.

## Application token

**For work about the Application itself:** its record, its Versions, its Client Keys, its Installations, its Webhook Endpoints, and its Delegated Grants. Nobody is signed in, and no company is named.

- **How to get it:** the `client_credentials` grant, with no `tenant`. It works before any company installs the Application, and before any Version is approved.
- **What limits it:** the fixed scopes that every Application can ask for. It reaches no company's data.
- **How long it lasts:** 15 minutes, with no refresh token.


[Application token](/apis/vendor-platform/guides/authentication/tokens/application-token) gives the steps and the scopes.

## Application Installation token

**For unattended work inside one company,** such as a scheduled sync or a webhook handler. Nobody is signed in.

- **How to get it:** the `client_credentials` grant, with `tenant` naming the company. The company must install the Application first, as [Getting a company to install the Application](/apis/vendor-platform/guides/authentication/setting-up/getting-a-company-to-install-the-application) describes.
- **What limits it:** what the company approved: the permissions of the Application Version it approved.
- **How long it lasts:** 15 minutes, with no refresh token. It stops working when the company uninstalls or suspends the Application.


Recommendation
We recommend an Application Installation token for most unattended integrations. It is not dependent on a single user.

[Application Installation token](/apis/vendor-platform/guides/authentication/tokens/application-installation-token) gives the steps.

## Application User token

**For work on behalf of one person in one company,** who agreed to it. The token can do only what that person could do themselves.

- **How to get it:** the `authorization_code` grant with PKCE, with `tenant` naming the company. The person signs in and agrees, and Aryeo records that agreement as an Application Delegated Grant.
- **What limits it:** the company's approval, and what the person consented to.
- **How long it lasts:** 15 minutes. Asking for `offline_access` adds a refresh token, which renews access for 90 days from its last use, and 365 days in all. It stops working when the person withdraws their Delegated Grant, leaves the company, or the company uninstalls the Application.


[Application User token](/apis/vendor-platform/guides/authentication/tokens/application-user-token) gives the steps, for [signing a person in](/apis/vendor-platform/guides/authentication/tokens/application-user-token#signing-a-person-in) and for [acting for a person](/apis/vendor-platform/guides/authentication/tokens/application-user-token#acting-for-a-person) after they leave.

## Every token

- **Names at most one company.** A token that works inside a company names exactly one, in `tenant`. Serving fifty companies takes fifty token requests with one signing key. A token for company A cannot read or write company B's data.
- **Reaches only the operations that admit its kind.** Each operation admits some token kinds, and names one scope for each. A token of any other kind gets a 403 with the code `authorization`, whatever scopes it holds.
- **Holds one level per resource.** Each scope sets a level, `read` or `manage`, for one resource. [Scopes and authority](/apis/vendor-platform/guides/authentication/scopes) explains the levels and what limits them.


## Where next

The [Authorization server reference](/apis/vendor-platform/guides/authorization-server) describes each endpoint, grant, token lifetime, and error. [When access ends](/apis/vendor-platform/guides/authentication/when-access-ends) lists every event that ends access early.