# First call

Your first call reads the account your integration belongs to: the account itself, then its models. Make the integration
in Portal first, as [authentication](/en/developers/api/authentication/) describes.

The requests below use two shell variables: `$CLIENT_ID` and `$CLIENT_SECRET` from your integration. Set `TOKEN` to the
`access_token` from the first step.

## Get a token

Exchange the integration's ID and secret for a token:

```sh title="Request"
curl -X POST https://api.virtualdisplay.io/v1/oauth/token \
  -d grant_type=client_credentials \
  -d client_id=$CLIENT_ID \
  -d client_secret=$CLIENT_SECRET
```

Copy `access_token` from the response into `TOKEN`.

## Read your account

`GET /v1/customers/me` returns the account the token belongs to:

<Operation id="getAccount" />

- `customer` is the account: its `company_name`, when it was created (`created_at`), and how many models it has
  (`model_count`).
- `subscription` is the account's tier (`tier`), its `status` and the `model_limit` it sets. It is left out when the
  account has no subscription.

## List your models

`GET /v1/models` returns one page of the account's models:

<Operation id="listModels" />

- `page` and `per_page` narrow the page: 20 models by default, 100 at most.
- `sort` orders the list: `newest` (the default), `oldest`, `name` or `views`. Any other value is a `validation_error`
  on `sort`.
- `thumbnail_url` is the picture of the model's default app, `null` until it has one.
- `pagination.total` counts all the account's models that match, not only this page.

When this works, [see what changed](/en/developers/api/guides/see-what-changed/) reads the account's history next.
If a request fails, the [errors](/en/developers/api/errors/) page says what each status means and what to do next.