# API: App keys

| Method | Path | What it does | Scope |
|---|---|---|---|
| POST | `/v1/app-keys/authorize` | Approve an app's request for a key (the consent screen, web app only): returns where to send the browser back, with a one-time code (web app only) | `gateway:write` |
| POST | `/v1/auth/keys` | Exchange an approved code and its PKCE verifier for the user's key (once, within 10 minutes) (no sign-in) | — |

## Examples

### POST /v1/auth/keys

Exchange an approved code and its PKCE verifier for the user's key (once, within 10 minutes). No sign-in, so it sends no key.

```bash
curl -s -X POST "https://manage.restolayer.com/v1/auth/keys" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://manage.restolayer.com/v1/auth/keys`, {
  method: "POST",
  headers: { "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).
