> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maple.inc/llms.txt
> Use this file to discover all available pages before exploring further.

# List grants

> Lists the app's grants in the key's mode, newest first, revoked ones included.

GET`https://api.maple.inc/v1/grants`API key

Lists the app’s grants in the key’s mode, newest first, revoked ones included. A grant is the app’s access to one location: `scopes` are what the restaurant approved, `pending_scopes` what the app’s listing asks for that it has not. Filter by `location_id` and `status`. While `has_more` is true, repeat with `starting_after` set to the last grant id. Needs `locations:read`.

## Authorization

Send your API key as `Authorization: Bearer <key>`: `mpk_test_…` for test mode, `mpk_live_…` for live mode. Both use `https://api.maple.inc/v1`. See [Authentication](https://docs.maple.inc/developer-api/concepts/authentication.md). The samples read the key from `MAPLE_KEY` and the base URL from `MAPLE_BASE`, as set up in the [Quickstart](https://docs.maple.inc/developer-api/quickstart.md).

## Parameters

- `location_id` string or null query

- `status` string or null query

- `starting_after` string or null query

- `limit` string or null query

## Responses

### 200 OK

- `object` string required

  Always `list`.

- `data` object\[] required

- `data[].object` string required

  Always `grant`.

- `data[].id` string required

- `data[].location_id` string required

- `data[].livemode` boolean required

- `data[].status` string required

  One of `active`, `revoked`.

- `data[].origin` string required

  One of `install`, `staff`, `test`.

- `data[].scopes` string\[] required

- `data[].pending_scopes` string\[] required

- `data[].created` number required

- `data[].revoked_at` number or null required

- `has_more` boolean required

### Errors

- `400` Bad request Invalid request (`invalid_request_error`)

- `401` Unauthorized Missing or invalid credential (`authentication_error`)

- `403` Forbidden Not allowed (`permission_error`)

- `429` Too many requests Rate limit reached (`rate_limit_error`)

Every error body is one `error` object: branch on its `type` and `code`; `message` is for people, `param` names the field at fault, and `doc_url` links the code on [Errors](https://docs.maple.inc/developer-api/concepts/errors.md).

A `429` also sends `Retry-After`: Seconds to wait before retrying; also returned as error.retry\_after in the body.

List grants

```sh
curl "$MAPLE_BASE/grants" \
  -H "Authorization: Bearer $MAPLE_KEY"
```

```python
import os
import requests


r = requests.get(
    f"{os.environ['MAPLE_BASE']}/grants",
    headers={"Authorization": f"Bearer {os.environ['MAPLE_KEY']}"},
    timeout=30,
)
r.raise_for_status()
print(r.json())
```

```js
const res = await fetch(`${process.env.MAPLE_BASE}/grants`, {
  headers: {
    Authorization: `Bearer ${process.env.MAPLE_KEY}`,
  },
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());
```

```json
{
  "object": "list",
  "data": [
    {
      "object": "grant",
      "id": "string",
      "location_id": "str_123",
      "livemode": true,
      "status": "active",
      "origin": "install",
      "scopes": [
        "string"
      ],
      "pending_scopes": [
        "string"
      ],
      "created": 1.5,
      "revoked_at": 1.5
    }
  ],
  "has_more": true
}
```

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_request",
    "message": "string",
    "doc_url": "string",
    "feedback": "string"
  }
}
```
