Account — K8 HQ Sign-in API
Account operations for K8 HQ Sign-in API. Requests, permissions and responses.
Before making requests, read the authentication and request requirements.
Read the signed-in person's account and change their display name.
Base URL
| Base URL | For |
|---|---|
https://api.k8hq.com/auth | The K8 HQ web app, and programs acting with a person's session |
Endpoints
Account
Get the account
The person's user ID and display name: the name every organization they're in shows for them (in List members). Not available to an assistant's delegated token. Includes any waiting recovery and when the limits after account recovery end.
For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused.
Response body (JSON)
| Field | Type | Description |
|---|---|---|
name required | string | Their display name; empty if they chose none. |
userId required | string | The person (usr_). |
recoveredUntil | integer | Unix time when the seven-day limits end, or zero when they do not apply. Expired records do not extend the limits. |
recovery | any | The waiting recovery from the account recovery lock, or null. Use this for the banner on every page and the notice shown after passkey sign-in. The address is masked; no cancel token or pending credential is returned. |
Responses
| Status | Body | Meaning |
|---|---|---|
| 200 | JSON | The account. |
| 401 | application/problem+json | No session, or it expired or was revoked (unauthenticated): refresh, or sign in again. |
| 403 | application/problem+json | Not allowed (forbidden): an assistant's delegated token, or a browser origin other than the web app's. |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 500 | application/problem+json | A temporary problem (unavailable); retry. |
Change the display name
Changes the person's display name, the same in every organization they're in, or clears it with "". Spaces are collapsed; up to 100 characters, without control characters. Only the person can change it, never an assistant's delegated token. A change records user.name.changed in their own scope.
For a person's own session (x-k8hq-token) only: assistants' delegated tokens and API tokens are refused.
Parameters
| Name | Type | Description |
|---|---|---|
x-amz-content-sha256 (header) required | string | The body's SHA-256, lowercase hex. CloudFront signs requests to this service and refuses a POST without it (403, not a problem detail). For {}: 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a. |
Request body (JSON)
| Field | Type | Description |
|---|---|---|
name required | string | The new name, or "" to clear it. |
{"name":"Dee Porter"}
Response body (JSON)
| Field | Type | Description |
|---|---|---|
name required | string | The name as stored; empty if cleared. |
Responses
| Status | Body | Meaning |
|---|---|---|
| 200 | JSON | Changed (or unchanged): the name as stored. |
| 400 | application/problem+json | The request is malformed or a field is invalid (invalid). |
| 401 | application/problem+json | No session, or it expired or was revoked (unauthenticated): refresh, or sign in again. |
| 403 | application/problem+json | Not allowed (forbidden): an assistant's delegated token, or a browser origin other than the web app's. |
| 405 | application/problem+json | Method not allowed. The Allow header lists supported methods. |
| 409 | application/problem+json | Your account changed meanwhile (another passkey, session or name change won the race), so nothing was changed (conflict); reload and try again. |
| 500 | application/problem+json | A temporary problem (unavailable); retry. |