Two credentials
- API key: send with
X-Partner-Keyfor server‑to‑server calls (mint sessions). Never expose it to clients. - Session token: short‑lived JWT for protected endpoints. Send with
Authorization: Bearer <token>.
Flow
API flows (step‑by‑step)
Create a session token (server-to-server)
Endpoint:
Body:
POST /sessionsBody:
userId(string, your user id)walletAddress(0x… address, optional)scopes(array of strings)ttlSeconds(integer, optional)
sessionToken(use asAuthorization: Bearer <token>)sessionId,userId,expiresAt,scopes
Use the session token
Send Missing/expired tokens return
Authorization: Bearer <token> on protected endpoints.401; missing permissions return 403.All available scopes
Deposits and balances do not require extra scopes.Headers quick reference
Token basics
- Short‑lived by default (e.g., ~15 minutes). Rotate by minting a new session.
- Session payload includes account id, user id, wallet address, scopes, expiry.
- Never log tokens or card data; always use HTTPS.
Use
https://dev-api.machines.cash in sandbox. Switch to production only after key validation.