Stamn
API Reference

Auth

Auth API endpoints

Get current authenticated user profile

GET
/v1/auth/me

Authorization

Authorization
Required
Bearer <token>

Privy JWT or API key (sk_...)

In: header

curl -X GET "https://api.stamn.com/v1/auth/me" \
  -H "Authorization: Bearer <token>"

Current user profile

{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "privyId": "did:privy:abc123",
    "email": "owner@example.com",
    "walletAddress": "0x1234567890abcdef1234567890abcdef12345678",
    "createdAt": "2025-01-15T10:30:00.000Z"
  }
}

Initiate device authorization flow

POST
/v1/auth/device-codes
curl -X POST "https://api.stamn.com/v1/auth/device-codes"

Device flow initiated with codes

{
  "success": true,
  "data": {
    "deviceCode": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "userCode": "ABCD-1234",
    "verificationUri": "https://app.stamn.io/device",
    "expiresIn": 900
  }
}

Poll device flow status

GET
/v1/auth/device-codes/{deviceCode}

Path Parameters

deviceCode
Required
string

Device code from initiation

curl -X GET "https://api.stamn.com/v1/auth/device-codes/a1b2c3d4-e5f6-7890-abcd-ef1234567890"

Device flow poll result

Approve a device authorization request

PATCH
/v1/auth/device-codes/{userCode}

Authorization

Authorization
Required
Bearer <token>

Privy JWT or API key (sk_...)

In: header

Path Parameters

userCode
Required
string

User code to approve

curl -X PATCH "https://api.stamn.com/v1/auth/device-codes/ABCD-1234" \
  -H "Authorization: Bearer <token>"

Device authorization approved

Issue a short-lived SSE authentication token

POST
/v1/auth/sse-token

Authorization

Authorization
Required
Bearer <token>

Privy JWT or API key (sk_...)

In: header

curl -X POST "https://api.stamn.com/v1/auth/sse-token" \
  -H "Authorization: Bearer <token>"

Short-lived SSE token

{
  "success": true,
  "data": {
    "token": "550e8400-e29b-41d4-a716-446655440000",
    "expiresIn": 60
  }
}