# API: Agent access

| Method | Path | What it does | Scope |
|---|---|---|---|
| GET | `/v1/agent-access` | Where assistants connect (the MCP server), each assistant that connected with what it may do, and whether only allowed ones may connect | `agents:read` |
| PUT | `/v1/agent-access/allowlist` | Only allowed assistants may connect (owners): turning it on works from anywhere; turning it off is done in the web app | `settings:write` |
| PATCH | `/v1/agent-access/assistants/:id` | Change what one assistant may do (owners): lowering works from anywhere; raising it or allowing it is done in the web app | `settings:write` |

## Examples

### GET /v1/agent-access

Where assistants connect (the MCP server), each assistant that connected with what it may do, and whether only allowed ones may connect

```bash
curl -s "https://manage.restolayer.com/v1/agent-access" \
  -H "Authorization: Bearer $LG_API_KEY"
```

```js
const res = await fetch(`https://manage.restolayer.com/v1/agent-access`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.LG_API_KEY}` },
});
const data = await res.json();
```

### PUT /v1/agent-access/allowlist

Only allowed assistants may connect (owners): turning it on works from anywhere; turning it off is done in the web app

```bash
curl -s -X PUT "https://manage.restolayer.com/v1/agent-access/allowlist" \
  -H "Authorization: Bearer $LG_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://manage.restolayer.com/v1/agent-access/allowlist`, {
  method: "PUT",
  headers: { authorization: `Bearer ${process.env.LG_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### PATCH /v1/agent-access/assistants/$ID

Change what one assistant may do (owners): lowering works from anywhere; raising it or allowing it is done in the web app

```bash
curl -s -X PATCH "https://manage.restolayer.com/v1/agent-access/assistants/$ID" \
  -H "Authorization: Bearer $LG_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://manage.restolayer.com/v1/agent-access/assistants/${id}`, {
  method: "PATCH",
  headers: { authorization: `Bearer ${process.env.LG_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

Request and response schemas: [https://www.restolayer.com/openapi.json](https://www.restolayer.com/openapi.json). All resources: [API reference](https://www.restolayer.com/docs/api).
