# oauth2

Source: https://zotonic.com/docs/2025/oauth2

URI: https://zotonic.com/id/2025

Language: en



Model for OAuth2 app/client/token administration and user token listings.

Available Model API Paths
-------------------------

| Method | Path pattern                         | Description                                                                      |
| ------ | ------------------------------------ | -------------------------------------------------------------------------------- |
| `get`  | `/client/+clientid/+redirecturl/...` | Validate enabled OAuth2 app `+clientid` and exact redirect URI match for `+redirecturl`, then return client metadata (`id`, `description`) for authorization flow. |
| `get`  | `/apps`                              | Return admin-only OAuth2 app overview list with auth/client-credentials settings and per-app token counts. No further lookups. |
| `get`  | `/apps/+appid`                       | Return admin-only OAuth2 app details for `+appid`, including app secret, redirect URLs, credential settings, and token count. No further lookups. |
| `get`  | `/apps/+appid/tokens/...`            | Return admin-only token rows for app `+appid` (`user_id`, label, access flags, IP restriction, note, validity dates). |
| `get`  | `/user_groups/...`                   | Return ACL user-group ids available in the current context for token group restrictions. |
| `get`  | `/tokens`                            | Alias for `/tokens/list/me`, returning tokens for the current authenticated user. No further lookups. |
| `get`  | `/tokens/list/me`                    | Return token list for the current authenticated user, including app enable/description metadata. No further lookups. |
| `get`  | `/tokens/list`                       | Alias for `/tokens/list/me`, returning current-user tokens (not a global list). No further lookups. |
| `get`  | `/tokens/list/me/...`                | Return token list for the current authenticated user; allowed for self or admin access rules. |
| `get`  | `/tokens/list/+userid/...`           | Return token list for user `+userid` when caller is that user or admin; includes app metadata and token restrictions. |
| `get`  | `/tokens/+tokenid/...`               | Return details for token `+tokenid` (and user-group restrictions when not full-access) when caller is token owner or admin. |

`/+name` marks a variable path segment. A trailing `/...` means extra path segments are accepted for further lookups.

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/2025?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/2025?language=en>)
