App sign-in API
The OpenTodo app signs in through the system's authentication sheet (ASWebAuthenticationSession on iOS, a Custom Tab on Android) with an authorization code and PKCE (RFC 7636, S256 only).
Implementation notes
The OpenTodo app signs in through the system's authentication sheet (ASWebAuthenticationSession on iOS, a Custom Tab on Android) with an authorization code and PKCE (RFC 7636, S256 only). The sheet shares the browser's cookies and passkeys, so every sign-in method of the web app works, and a browser that is already signed in only confirms. It does not depend on the owner's AI assistants (MCP) switch. A server that has it says so in GET /api/v1/health with "app_sign_in": true.
- POST
/api/v1/app/sign-out - POST
/api/v1/app/token - POST
/api/v1/me/app-sign-in - GET
/api/v1/me/apps - DELETE
/api/v1/me/apps/{id}
POST /api/v1/app/sign-out
App sign out · Token or session
→ 204: ends the grant of the app token sent (signing out in the app); any other credential → 400 invalid_request
POST /api/v1/app/token
App token · No authentication
{grant_type: "authorization_code", code, code_verifier, state} or {grant_type: "refresh_token", refresh_token} → {access_token, token_type: "Bearer", expires_in: 3600, refresh_token, scope: "app"} with Cache-Control: no-store; the errors below
No authentication.
| Field | Type | Description |
|---|---|---|
code required | string | |
code_verifier required | string | |
grant_type required | string | |
refresh_token required | string | |
state required | string |
| Field | Type | Description |
|---|---|---|
access_token required | string | |
expires_in required | number | |
refresh_token required | string | |
scope required | string | |
token_type required | string |
POST /api/v1/me/app-sign-in
Me app sign in · Session only
{query, allow} (the confirmation's answer; query is the sign-in request) → {redirect}: opentodo://signed-in with code and state on allow, with error=access_denied and state otherwise; recorded as mcp_oauth.granted with oauth_client_id opentodo-app
Needs a session; tokens are refused.
| Field | Type | Description |
|---|---|---|
allow required | boolean | |
query required | string |
| Field | Type | Description |
|---|---|---|
redirect required | string |
GET /api/v1/me/apps
List me apps · Token or session
{apps:[{id, device, createdAt, lastUsedAt}]}: the signed-in apps, most recently used first, shown with the sessions in Settings → Account
| Field | Type | Description |
|---|---|---|
apps required | array of object |
DELETE /api/v1/me/apps/{id}
Delete a me app · Token or session
204: signs that app out; its next request gets 401; another person's or an unknown id → 404 not_found; recorded as mcp_oauth.revoked
| Field | Type | Description |
|---|---|---|
id required | string | path |