๐ง API ยท CLI ยท Server-to-Server Track โ
Source:
en/tracks/api.mdยท Live: https://docs.1pass.dev/en/tracks/api LLM-sanitized: internal links absolutized, VitePress containers โ admonitions, line numbers in the Jump-to Index reference this rendered file (1-indexed).
๐ Jump-to Index โ
- L29-L77: ## Branching by pattern
- L31-L41: ### 1. Machine โ machine (CLI / daemon / CI)
- L42-L49: ### 2. AI agents / LLMs
- L50-L59: ### 3. Backend โ logi API
- L60-L69: ### 4. logi โ backend (webhook)
- L70-L77: ### 5. Management API (Org / Team / App management)
- L78-L88: ## Common reference
- L89-L94: ## Hand the whole thing to an AI
๐ง API ยท CLI ยท Server-to-Server Track โ
Every case where the user doesn't log in through a browser directly: CLI, daemons, CI/CD, AI agents, and webhook receivers.
๐ก Tip: Is this the right track?
- โ Yes: backend-to-backend communication only, or a CLI tool calling logi on the user's behalf
- โ Yes: an AI agent (Claude/Cursor/Codex) driving logi over MCP
- โ Mobile app โ ๐ฑ Mobile Track
- โ User browser login โ ๐ Web Track
Branching by pattern โ
1. Machine โ machine (CLI / daemon / CI) โ
An environment where user interaction is possible but you can't open a browser.
- OAuth 2.0 Device Flow (RFC 8628) โ the standard for TV / CLI / IoT
- The
logiCLI โ runlogi loginto get a device code and approve it in a browser- Quick install:
gem install logi-cli - CLI install ยท Login ยท Managing apps ยท Managing teams
- Using it in CI/CD โ non-interactive token injection pattern
- Quick install:
2. AI agents / LLMs โ
Claude Code, Cursor, and Codex driving logi in natural language.
- MCP (
@1pass/mcp) โ the Model Context Protocol server - AI assistant integration โ the
llms.txt/llms-full.txtstandard endpoints - ๐ฅ
/llms-full.txtโ the full docs as an LLM-friendly package (~500 KB)
3. Backend โ logi API โ
Verifying user tokens, looking up user info, and changing permissions.
- API reference (OpenAPI) โ interactive Scalar viewer
- Token Introspection & JWKS โ verify
id_token/ fetch public keys - Polling Events API โ pull-based delivery of user events (account deletion / disconnection)
POST /api/v1/me/anonymous_swapโ swap/merge an anonymous account into a canonical (email/SSO) account. For the full flow, see Anonymous โ Canonical Account Swap.GET/POST /developer/applications/:id/{redirect_uri_verifications,verify_redirect_uri}(session) ยทGET/POST /api/v1/admin/applications/:id/{redirect_uri_verifications,verify_redirect_uri}(admin) โ verify domain ownership of an RP redirect_uri (DNS TXT + .well-known, two-pronged). Redirect URI Verification.
4. logi โ backend (webhook) โ
logi pushes asynchronous events to the RP backend.
- Webhook integration
- HMAC signature verification
- Event Delivery (3-tier)
- Webhook signing-key rotation
- RP Health Check Protocol โ an active probe separate from webhooks (logi โ RP
/healthHMAC handshake). logi actively confirms the RP is alive.
5. Management API (Org / Team / App management) โ
Everything the logi console does, via the API.
- API reference โ the complete set of management API endpoints
Common reference โ
- Core concepts
- Choosing Public vs Confidential
- Error codes ยท Rate Limits
- Security best practices ยท Threat Model
demo.1pass.dev/oauthโ a PKCE round-trip walking sample (CLI and server integrations follow the same PKCE shape)- Demo page walkthrough โ flows organized by scenario
Hand the whole thing to an AI โ
Paste @/llms-full.txt into an LLM and say:
"Connect the logi MCP server to Claude Code. Then make my CLI script obtain a token via device flow and call
/api/v1/applications."