# Quickstart

[Open in the interactive reference](https://docs.api.lensing.ai/?op=guide%3Astart)

Make a first call in a few minutes. The guides after this one cover what holds for every endpoint; the endpoints themselves are on the Reference tab.

### 1. Create an access token

In your tenant, open **API Hub › Connect › Access Tokens** and create a token. Tick **Restrict this token to a sandbox** and choose a sandbox, so that your test calls never touch live data. A token that is not restricted reads and writes your live data, whichever sandbox you are working in. Copy the token's value straight away, because it is shown only once.

### 2. Grant it access

A new token can call nothing. Open it and grant it access to the operation that lists customers, which the next step calls. [Access tokens](https://docs.api.lensing.ai/api/app/uiengine/static/content-isolation-assets/guides/tokens.html) explains grants in full.

### 3. Send a request

Ask for the first two customers. Every request carries the token in an `Authorization` header and the version it is written against in an `Api-Version` header.

**Request**

```
curl -g 'https://<your-tenant-host>/public/api/lensing/accounting/customers?page[size]=2' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Api-Version: v1'
```

Replace `<your-tenant-host>` with the address of your tenant, the one you sign in to the product at. `-g` stops curl from reading the brackets in `page[size]` as a pattern of its own.

### 4. Read the response

**Response**

```json
{
  "data": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "customerNumber": "CUST-0001",
      "customerName": "Acme Inc.",
      …
    },
    { … }
  ],
  "pagination": { "hasMore": true, "nextCursor": "…" }
}
```

The records are under `data`, and `pagination.nextCursor` fetches the next page. A `401` means the token is missing or not valid; a `403` means it has not been granted this endpoint.

### Next steps

- Read every page of a collection: [Pagination and querying](https://docs.api.lensing.ai/api/app/uiengine/static/content-isolation-assets/guides/pagination.html).
- Handle failures: [Responses and errors](https://docs.api.lensing.ai/api/app/uiengine/static/content-isolation-assets/guides/responses.html).
- Create and change records, and retry safely: [Writes](https://docs.api.lensing.ai/api/app/uiengine/static/content-isolation-assets/guides/writes.html) and [Idempotency](https://docs.api.lensing.ai/api/app/uiengine/static/content-isolation-assets/guides/idempotency.html).
- Be told about changes instead of polling for them: [Webhooks](https://docs.api.lensing.ai/api/app/uiengine/static/content-isolation-assets/guides/webhooks.html).

## Examples

**Base URL**

```
https://<your-tenant-host>/public/api/lensing
```

**Headers**

```
Authorization: Bearer <access token>
Api-Version: v1
Content-Type: application/json
```

Every path is appended to the base URL. `<your-tenant-host>` stands for your tenant's address. `Content-Type` is needed only on a request with a body; without it, the body is not read. The samples use `v1`, the version selected at the top of the page.
