Shadow implements a standard OAuth 2.0 authorization code flow. Third-party applications can request access to user data with scoped permissions.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Application name |
description | string | No | Description |
redirectUris | string[] | Yes | Allowed redirect URIs |
scopes | string[] | No | Requested scopes |
iconUrl | string | No | App icon URL |
Response:
Lists all OAuth apps owned by the current user.
Redirect the user's browser to the authorization page:
| Param | Type | Required | Description |
|---|---|---|---|
response_type | string | Yes | Must be code |
client_id | string | Yes | Your app's client ID |
redirect_uri | string | Yes | Must match a registered URI |
scope | string | No | Space-separated scopes |
state | string | Yes | Random state for CSRF protection |
| Field | Type | Required | Description |
|---|---|---|---|
clientId | string | Yes | Client ID |
redirectUri | string | Yes | Redirect URI |
scope | string | No | Approved scope |
state | string | Yes | Must match the request state |
Response: Returns a redirectTo URL containing the authorization code.
| Field | Type | Required | Description |
|---|---|---|---|
grant_type | string | Yes | authorization_code or refresh_token |
code | string | Conditional | Authorization code (for authorization_code) |
client_id | string | Yes | Client ID |
client_secret | string | Yes | Client secret |
redirect_uri | string | Conditional | Must match the authorize request |
refresh_token | string | Conditional | For refresh_token grant |
Response:
Returns the authenticated user's profile using the OAuth access token.
Lists all apps the user has authorized.
These endpoints use an OAuth access token (Authorization: Bearer <access_token>) and require the corresponding scopes.
| Method | Endpoint | Scope | Description |
|---|---|---|---|
GET | /api/oauth/servers | servers:read | List user's servers |
POST | /api/oauth/servers | servers:write | Create a new server |
POST | /api/oauth/servers/:id/invite | servers:write | Invite a user to a server |
| Method | Endpoint | Scope | Description |
|---|---|---|---|
GET | /api/oauth/servers/:id/channels | channels:read | List channels in a server |
POST | /api/oauth/channels | channels:write | Create a channel |
| Method | Endpoint | Scope | Description |
|---|---|---|---|
GET | /api/oauth/channels/:id/messages | messages:read | Get message history |
POST | /api/oauth/channels/:id/messages | messages:write | Send a message |
| Method | Endpoint | Scope | Description |
|---|---|---|---|
GET | /api/oauth/workspaces/:id | workspaces:read | Get workspace info |
| Method | Endpoint | Scope | Description |
|---|---|---|---|
POST | /api/oauth/buddies | buddies:create | Create a Buddy bot |
POST | /api/oauth/buddies/:id/messages | buddies:manage | Buddy sends a message |
| Scope | Description |
|---|---|
user:read | Read basic profile (username, display name, avatar) |
user:email | Read email address |
servers:read | View server list |
servers:write | Create servers and invite users |
channels:read | View channel list |
channels:write | Create channels |
messages:read | Read message history |
messages:write | Send messages |
attachments:read | View attachments |
attachments:write | Upload attachments |
workspaces:read | View workspace information |
workspaces:write | Modify workspace files |
buddies:create | Create Buddy bots |
buddies:manage | Manage Buddy bots and send messages |
See Platform Appsfor a complete example of building a real application using the OAuth API.