Polyrankdocs
ApiUser

PATCH /v1/user-prefs

Save preferences for this account (all devices). Send `view_mode`, `onboarding`, `lab_invite`, or several; no other key. `lab_invite` (closed | clicked | expired | opened) records why the AI Lab invite is no longer offered: the first state recorded is final, a later one changes nothing. `view_mode: null` clears the choice, so the plan default applies again. `onboarding` is the WHOLE record ({ state: pending | done | dismissed, step: 0..2, answers: { styles, topics } (each at most 20 strings of at most 64 characters), checklist_closed, first_run_seen_at? (an ISO instant: when the first-run flow was shown), start_closed? (Home’s “Start with a wallet” strip was closed) }) and replaces the stored one, except `first_run_seen_at`, which is kept once the stored record has it; an account without an onboarding record answers 409 `onboarding_not_available` and nothing is saved.

PATCH
/v1/user-prefs

Save preferences for this account (all devices). Send view_mode, onboarding, lab_invite, or several; no other key. lab_invite (closed | clicked | expired | opened) records why the AI Lab invite is no longer offered: the first state recorded is final, a later one changes nothing. view_mode: null clears the choice, so the plan default applies again. onboarding is the WHOLE record ({ state: pending | done | dismissed, step: 0..2, answers: { styles, topics } (each at most 20 strings of at most 64 characters), checklist_closed, first_run_seen_at? (an ISO instant: when the first-run flow was shown), start_closed? (Home’s “Start with a wallet” strip was closed) }) and replaces the stored one, except first_run_seen_at, which is kept once the stored record has it; an account without an onboarding record answers 409 onboarding_not_available and nothing is saved.

AuthorizationBearer <token>

API key: Authorization: Bearer pk_live_… (mint at polyrank.app/api-keys)

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/v1/user-prefs" \  -H "Content-Type: application/json" \  -d '{}'
{  "view_mode": "essentials",  "view_mode_saved": true,  "default_view_mode": "essentials",  "onboarding": {    "state": "pending",    "step": 0,    "answers": {      "styles": [        "string"      ],      "topics": [        "string"      ]    },    "checklist_closed": true,    "first_run_seen_at": "2019-08-24T14:15:22Z",    "start_closed": true  },  "lab_invite": {    "state": "closed",    "at": "string"  }}
{  "error": "string",  "message": "string",  "feature": "string",  "field": "string",  "plan": "string",  "retry_after_sec": 0,  "retry_after_seconds": 0,  "reason": "string",  "running": 0,  "limit": 0,  "issues": [    null  ],  "trace_id": "string"}
{  "error": "string",  "message": "string",  "feature": "string",  "field": "string",  "plan": "string",  "retry_after_sec": 0,  "retry_after_seconds": 0,  "reason": "string",  "running": 0,  "limit": 0,  "issues": [    null  ],  "trace_id": "string"}
{  "error": "string",  "message": "string",  "feature": "string",  "field": "string",  "plan": "string",  "retry_after_sec": 0,  "retry_after_seconds": 0,  "reason": "string",  "running": 0,  "limit": 0,  "issues": [    null  ],  "trace_id": "string"}
{  "error": "string",  "message": "string",  "feature": "string",  "field": "string",  "plan": "string",  "retry_after_sec": 0,  "retry_after_seconds": 0,  "reason": "string",  "running": 0,  "limit": 0,  "issues": [    null  ],  "trace_id": "string"}
{  "error": "string",  "message": "string",  "feature": "string",  "field": "string",  "plan": "string",  "retry_after_sec": 0,  "retry_after_seconds": 0,  "reason": "string",  "running": 0,  "limit": 0,  "issues": [    null  ],  "trace_id": "string"}
{  "error": "string",  "message": "string",  "feature": "string",  "field": "string",  "plan": "string",  "retry_after_sec": 0,  "retry_after_seconds": 0,  "reason": "string",  "running": 0,  "limit": 0,  "issues": [    null  ],  "trace_id": "string"}
{  "error": "string",  "message": "string",  "feature": "string",  "field": "string",  "plan": "string",  "retry_after_sec": 0,  "retry_after_seconds": 0,  "reason": "string",  "running": 0,  "limit": 0,  "issues": [    null  ],  "trace_id": "string"}