HTTP API
ベース URL は https://addtothese.com/api/v1 です。Authorization: Bearer att_...(API トークン)、またはブラウザのセッションと X-CSRF-Token で認証します。ボディはすべて JSON で、エラーは {"error": "...", "code": "..."} の形式です。
| メソッド | パス | 用途 |
|---|---|---|
| POST | /auth/register | {email, password, name} |
| POST | /auth/login | {email, password}。{mfa_required: true} が返る場合あり |
| POST | /auth/totp/verify | {code} |
| POST | /auth/logout | |
| POST | /auth/password/forgot | /auth/password/reset | {email} | {token, password} |
| GET | /auth/oauth/{google|github} | OAuth を開始 |
| GET/PATCH | /me | アカウント。PATCH {name} |
| POST | /me/totp/setup | enable | disable | 二要素認証 |
| POST | /me/password | {current_password, new_password} |
| GET/POST/DELETE | /tokens[/{id}] | API トークン。POST {name} はシークレットを一度だけ返す |
| GET/POST/DELETE | /endpoints[/{id}] | POST {subdomain, protocol} |
| POST | /endpoints/ephemeral | {protocol} ランダムな名前 |
| GET/POST/DELETE | /domains[/{id}] | POST {domain, endpoint_id} |
| POST | /domains/{id}/verify | DNS チェック |
| POST | /agent-token | {endpoints: []} で {token, upstream_url, endpoints, expires_at} を返す |
| GET | /usage | 現在の期間と履歴 |
| GET | /tunnels | 接続中のエージェント |
| GET | /billing/prices | プランと Stripe の価格 |
| POST | /billing/checkout | /billing/portal | {price} で {url} を返す |