Appearance
Authentication
3 operations. Paths are relative to https://api.frege.io.
Email a one-time sign-in code
POST/v1/auth/magic
Sends a six-digit code to the address, creating the account on first use. The SPA collects the code and posts it to /auth/magic/verify — sign-in stays entirely in Frege's own UI.
Authentication: none.
Request body (application/json)
Schema: api.magicRequest.
| Field | Type | Description |
|---|---|---|
email | string |
Responses
| Status | Description | Body |
|---|---|---|
| 204 | No Content | |
| 422 | Unprocessable Entity | error envelope |
| 502 | Bad Gateway | error envelope |
Exchange a one-time code for a session
POST/v1/auth/magic/verify
Verifies the emailed six-digit code, provisioning (or linking) the Frege user on first sign-in. Returns the session, whose token is the API's bearer token and whose refresh_token renews it through /auth/refresh.
Authentication: none.
Request body (application/json)
Schema: api.magicVerifyRequest.
| Field | Type | Description |
|---|---|---|
code | string | |
email | string |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 401 | Unauthorized | error envelope |
| 422 | Unprocessable Entity | error envelope |
Exchange a refresh token for a fresh session
POST/v1/auth/refresh
Trades a still-valid refresh token for a new access token (and rotated refresh token) without another interactive sign-in. Call this when the access token is near or past expiry.
Authentication: none.
Request body (application/json)
Schema: api.refreshRequest.
| Field | Type | Description |
|---|---|---|
refresh_token | string |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 401 | Unauthorized | error envelope |
| 422 | Unprocessable Entity | error envelope |