# Users API

The Users API: profiles, upload settings, storage, and a user's images, with every endpoint's fields, who may call it, its rate limit and a curl example.

## Get a single user by ID

`GET /users/:userId`

Needs no token. Rate limit: 120 a minute, per address. An app's token or an API key needs the `users:read` scope.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Response

Returns a [User](https://hematite.gg/docs/developers/models/user) or a [HiddenUser](https://hematite.gg/docs/developers/models/hidden-user).

```bash
curl 'https://api.hematite.gg/v1/users/1'
```

Example `data`:

```json
{
  "id": 1,
  "username": "nova",
  "email": "nova@example.com",
  "emailConfirmedAt": "2026-11-10T18:24:00.000Z",
  "createdAt": "2026-11-10T18:24:00.000Z",
  "updatedAt": "2026-11-10T18:24:00.000Z",
  "permissionGroupId": 1,
  "subscriptionGroupId": 1,
  "stripeSubscriptionId": "string",
  "domainId": 1,
  "avatarId": 1,
  "stripeCustomerId": "string",
  "inviteId": 1,
  "timeZone": "string",
  "avatar": {
    "key": "images/a1b2c3d4e5f6.png"
  },
  "badgeIds": [
    1
  ],
  "storageUsed": 2457600,
  "storageLimit": 1073741824,
  "imageCount": 1,
  "folderCount": 0,
  "publicImageCount": 0,
  "publicFolderCount": 0,
  "profile": {
    "bio": "Screenshots from ranked nights",
    "hideProfile": false,
    "activityVisibility": "All"
  }
}
```

## Update a user by ID

`PATCH /users/:userId`

Needs a session token. Rate limit: 120 a minute, per address. An app's token or an API key needs the `users:write` scope. Apps can't send: `email`, `profile.hideProfile`, `profile.activityVisibility`, `timeZone`.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Body

Send at least one field.

| Field | Type | Required | Notes |
|---|---|---|---|
| `username` | `string` |  | A new username: one nobody has yet, nor gave up in the last 30 days (unless it was you), and not one hematite keeps (`POST /users/check-username` says which). 3 to 64 characters. Matches ^[a-zA-Z0-9_]+$. |
| `email` | `string` |  | A new email address: one no account uses yet, nor a closed account's. |
| `timeZone` | `string` |  | Your time zone by its IANA name (`Europe/Berlin`), as your browser reports it: the calendar your achievements count days by. Apps can't change it. |
| `profile` | `object` |  | What others see of you and who may see it. Send only what changes; the rest stays. |
| `profile.bio` | `string` |  | A line or two about you, on your page. At most 1024 characters. |
| `profile.hideProfile` | `boolean` |  | Hide your page: anyone else then gets only your id and username, and none of your activity. Apps can't change it. |
| `profile.activityVisibility` | `enum` |  | Who sees your upload activity and counts: `All`, anyone, every upload counted (never the images themselves); `Public`, anyone, your public uploads only; `Private`, only you (others' counts are of your public ones). Apps can't change it. One of `All`, `Public`, `Private`. |
| `domainId` | `number` |  | The id of the domain your share links use. It has to exist. |

### Response

Returns a [User](https://hematite.gg/docs/developers/models/user).

```bash
curl -X PATCH 'https://api.hematite.gg/v1/users/1' \
  -H "Authorization: $HEMATITE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"username":"nova"}'
```

Example `data`:

```json
{
  "id": 1,
  "username": "nova",
  "email": "nova@example.com",
  "emailConfirmedAt": "2026-11-10T18:24:00.000Z",
  "createdAt": "2026-11-10T18:24:00.000Z",
  "updatedAt": "2026-11-10T18:24:00.000Z",
  "permissionGroupId": 1,
  "subscriptionGroupId": 1,
  "stripeSubscriptionId": "string",
  "domainId": 1,
  "avatarId": 1,
  "stripeCustomerId": "string",
  "inviteId": 1,
  "timeZone": "string",
  "avatar": {
    "key": "images/a1b2c3d4e5f6.png"
  },
  "badgeIds": [
    1
  ],
  "storageUsed": 2457600,
  "storageLimit": 1073741824,
  "imageCount": 1,
  "folderCount": 0,
  "publicImageCount": 0,
  "publicFolderCount": 0,
  "profile": {
    "bio": "Screenshots from ranked nights",
    "hideProfile": false,
    "activityVisibility": "All"
  }
}
```

## Get a user's achievement assignments: yours with the counts and times, anyone else's with only the tier each reached, and none of a hidden profile's

`GET /users/:userId/achievement-assignments`

Needs no token. Rate limit: 120 a minute, per address. An app's token or an API key needs the `users:read` scope.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Response

Returns a list of [AchievementAssignments](https://hematite.gg/docs/developers/models/achievement-assignment).

```bash
curl 'https://api.hematite.gg/v1/users/1/achievement-assignments'
```

Example `data`:

```json
[
  {
    "id": 1,
    "userId": 1,
    "achievementId": 1,
    "currentValue": 0,
    "bestValue": 0,
    "currentTier": 0,
    "createdAt": "2026-11-10T18:24:00.000Z",
    "updatedAt": "2026-11-10T18:24:00.000Z",
    "unlockedAt": null
  }
]
```

## Get the tiers you reached, newest first (the latest 50): which achievement, which tier and when. Tiers counted from what you did before the achievements' counting started say so (`backfilled`). Only your own.

`GET /users/:userId/achievement-unlocks`

Needs a session token. Rate limit: 120 a minute, per address. An app's token or an API key needs the `users:read` scope.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Response

Returns a list of [AchievementUnlocks](https://hematite.gg/docs/developers/models/achievement-unlock).

```bash
curl 'https://api.hematite.gg/v1/users/1/achievement-unlocks' \
  -H "Authorization: $HEMATITE_TOKEN"
```

Example `data`:

```json
[
  {
    "id": 1,
    "achievementId": 1,
    "tier": 1,
    "reachedAt": "2026-11-10T18:24:00.000Z",
    "backfilled": false
  }
]
```

## Get a user's upload activity. How many images they uploaded on each day that had any (UTC, `YYYY-MM-DD`): counts only, never the images. The user gets all of theirs, private and deleted uploads included. Anyone else gets what the user's `profile.activityVisibility` allows: with `All` every image they have, private and unlisted ones too; with `Public` only the public ones that show who uploaded them; with `Private`, or when the user hides their page, nothing (`{}`).

`GET /users/:userId/activity`

Needs no token. Rate limit: 120 a minute, per address. An app's token or an API key needs the `users:read` scope.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Response

Returns a `map of number`.

```bash
curl 'https://api.hematite.gg/v1/users/1/activity'
```

Example `data`:

```json
{
  "dataKey": 0
}
```

## The apps you registered (D-34), newest first, each with how many people have it connected now. Only your own: the apps you allowed are your connected apps (`/users/:userId/connected-apps`).

`GET /users/:userId/apps`

Needs a session token. Rate limit: 120 a minute, per address. Not open to apps or API keys: apps are registered and managed by their makers, signed in to hematite.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Response

Returns a list of [Apps](https://hematite.gg/docs/developers/models/app).

```bash
curl 'https://api.hematite.gg/v1/users/1/apps' \
  -H "Authorization: $HEMATITE_TOKEN"
```

Example `data`:

```json
[
  {
    "clientId": "string",
    "name": "Ranked",
    "type": "public",
    "redirectUris": [
      "string"
    ],
    "userCount": 0,
    "createdAt": "2026-11-10T18:24:00.000Z",
    "updatedAt": "2026-11-10T18:24:00.000Z"
  }
]
```

## Update a user's avatar

`PUT /users/:userId/avatar`

Needs a session token. Rate limit: 120 a minute, per address. An app's token or an API key needs the `users:write` scope.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Form data

Sent as `multipart/form-data`, the file as `file` (image/png, image/jpeg, image/webp), at most 2097152 bytes.

### Response

Returns a `string`.

```bash
curl -X PUT 'https://api.hematite.gg/v1/users/1/avatar' \
  -H "Authorization: $HEMATITE_TOKEN" \
  -F "file=@screenshot.png"
```

Example `data`:

```json
"string"
```

## Delete a user's avatar

`DELETE /users/:userId/avatar`

Needs a session token. Rate limit: 120 a minute, per address. An app's token or an API key needs the `users:write` scope.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Response

`data` is empty.

```bash
curl -X DELETE 'https://api.hematite.gg/v1/users/1/avatar' \
  -H "Authorization: $HEMATITE_TOKEN"
```

## Get a user's comments

`GET /users/:userId/comments`

Needs a session token. Rate limit: 120 a minute, per address. An app's token or an API key needs the `comments:read` scope.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Response

Returns a list of [Comments](https://hematite.gg/docs/developers/models/comment).

```bash
curl 'https://api.hematite.gg/v1/users/1/comments' \
  -H "Authorization: $HEMATITE_TOKEN"
```

Example `data`:

```json
[
  {
    "id": 1,
    "userId": 1,
    "createdAt": "2026-11-10T18:24:00.000Z",
    "updatedAt": "2026-11-10T18:24:00.000Z",
    "referenceType": "Image",
    "referenceId": 1,
    "content": "That last round",
    "parentId": null,
    "offlineAt": "2026-11-10T18:24:00.000Z",
    "likeCount": 0
  }
]
```

## Get a user's domains

`GET /users/:userId/domains`

Needs a session token. Rate limit: 120 a minute, per address. Not open to apps or API keys: domains change DNS records at Cloudflare; hematite's website manages them.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Response

Returns a list of [Domains](https://hematite.gg/docs/developers/models/domain).

```bash
curl 'https://api.hematite.gg/v1/users/1/domains' \
  -H "Authorization: $HEMATITE_TOKEN"
```

Example `data`:

```json
[
  {
    "id": 1,
    "name": "yourdomain.com",
    "userId": 1,
    "createdAt": "2026-11-10T18:24:00.000Z",
    "updatedAt": "2026-11-10T18:24:00.000Z",
    "cloudflareZoneId": "string",
    "status": "AwaitingNameservers",
    "availability": "Public",
    "supportsSubdomain": false,
    "supportsPath": false,
    "official": false,
    "failedAt": null,
    "uses": 0
  }
]
```

## Get the link preview styles you can choose (Settings → Embeds): the six built-ins every plan has (hematite, Minimal, Detailed, Gamer, Photo mode, Quiet), in that order, then your account's own, then your saved styles by name. Which one your links follow is your upload settings' `embedStyleId`.

`GET /users/:userId/embed-styles`

Needs a session token. Rate limit: 60 a minute, per address. An app's token or an API key needs the `users:read` scope.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Response

Returns a list of [EmbedStyles](https://hematite.gg/docs/developers/models/embed-style).

```bash
curl 'https://api.hematite.gg/v1/users/1/embed-styles' \
  -H "Authorization: $HEMATITE_TOKEN"
```

Example `data`:

```json
[
  {
    "id": 1,
    "key": "hematite",
    "name": "Ranked",
    "about": "string",
    "basedOn": "hematite",
    "version": 0,
    "author": "Uploader",
    "picture": "Large",
    "cropToCard": false,
    "colour": "Hematite",
    "colourHex": "string",
    "showTime": false,
    "motion": false,
    "title": "Clutch on Ascent",
    "description": "1v4 on the last round",
    "site": "Hematite",
    "siteText": "string"
  }
]
```

## Save a link preview style by its name (Silver 10, Gold 25): the built-in it starts from, every choice and its own words. With `use`, it's what your links follow from now on.

`POST /users/:userId/embed-styles`

Needs a session token. Rate limit: 30 a minute, per address. Not open to apps or API keys: a link preview's style is written in Settings → Embeds, which previews it.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Body

| Field | Type | Required | Notes |
|---|---|---|---|
| `basedOn` | `enum` | required | The built-in it starts from, whose words the card says where it has none of its own. One of `hematite`, `minimal`, `detailed`, `gamer`, `photo-mode`, `quiet`. |
| `author` | `enum` | required | Who the card names over its title, in Discord through oEmbed: `Uploader` (the uploader, or a folder's owner) or `None`. Hiding yourself as an image's uploader, or hiding your page, names nobody whatever the style says. One of `Uploader`, `None`. |
| `picture` | `enum` | required | How the card shows its picture: `Large` under the words, `Small` beside them (square), `Alone` (Discord shows only the picture; elsewhere the large card), `None`. An image marked NSFW or shielded shows none whatever the style says. One of `Large`, `Small`, `Alone`, `None`. |
| `cropToCard` | `boolean` | required | With a large picture: cropped to 1.91 : 1, the shape X, Facebook, LinkedIn and WhatsApp draw, round its busiest part. |
| `colour` | `enum` | required | The colour of Discord's bar, the only platform that shows one: `Hematite` (the accent's ice steel), `Picture` (the picture's own, made light enough to read on Discord's grey) or `Custom` (`colourHex`). One of `Hematite`, `Picture`, `Custom`. |
| `colourHex` | `string \| null` | required | Your own colour: `#` and six hex digits. Needed with `Custom`; kept otherwise, so choosing `Custom` again finds it. |
| `showTime` | `boolean` | required | When it was uploaded, under the card in each reader's own time (Discord). |
| `motion` | `boolean` | required | An animated GIF or WebP moves in the card; off, it's its first frame. |
| `title` | `string \| null` |  | Its own title, a template (concept 11 §3: `{title\|"A screenshot"}`), at most 300 characters and one line; null or left out says the built-in's. From Silver. |
| `description` | `string \| null` |  | Its own description, a template, at most 600 characters, from Silver; `""` leaves it out of the card (every plan); null or left out says the built-in's. |
| `site` | `enum` |  | The site line over the title: `Hematite`, `Domain` (the domain your links go to, while it works) or `Custom` (`siteText`). Anything but `Hematite` from Silver. One of `Hematite`, `Domain`, `Custom`. |
| `siteText` | `string \| null` |  | Its own site name with `site` `Custom`, a template, at most 32 characters and one line, saying no service, brand or authority. Kept while another site line is chosen. |
| `name` | `string` | required | Its name, at most 32 characters, unique among your styles. |
| `use` | `boolean` |  | Make it the style your links follow. Default `false`. |

### Response

Returns an [EmbedStyle](https://hematite.gg/docs/developers/models/embed-style).

Error `403`.

Error `404`: No such style of yours.

Error `409`.

Error `422`.

```bash
curl -X POST 'https://api.hematite.gg/v1/users/1/embed-styles' \
  -H "Authorization: $HEMATITE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"basedOn":"hematite","author":"Uploader","picture":"Large","cropToCard":false,"colour":"Hematite","colourHex":"string","showTime":false,"motion":false,"name":"Ranked"}'
```

Example `data`:

```json
{
  "id": 1,
  "key": "hematite",
  "name": "Ranked",
  "about": "string",
  "basedOn": "hematite",
  "version": 0,
  "author": "Uploader",
  "picture": "Large",
  "cropToCard": false,
  "colour": "Hematite",
  "colourHex": "string",
  "showTime": false,
  "motion": false,
  "title": "Clutch on Ascent",
  "description": "1v4 on the last round",
  "site": "Hematite",
  "siteText": "string"
}
```

## Change one of your saved link preview styles in place, its name too: every link that follows it says the new card. Your own words and site line need a plan that gives them; a plan without keeps them as they are.

`PATCH /users/:userId/embed-styles/:styleId`

Needs a session token. Rate limit: 30 a minute, per address. Not open to apps or API keys: a link preview's style is written in Settings → Embeds, which previews it.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |
| `styleId` | `number` | required |  |

### Body

| Field | Type | Required | Notes |
|---|---|---|---|
| `basedOn` | `enum` | required | The built-in it starts from, whose words the card says where it has none of its own. One of `hematite`, `minimal`, `detailed`, `gamer`, `photo-mode`, `quiet`. |
| `author` | `enum` | required | Who the card names over its title, in Discord through oEmbed: `Uploader` (the uploader, or a folder's owner) or `None`. Hiding yourself as an image's uploader, or hiding your page, names nobody whatever the style says. One of `Uploader`, `None`. |
| `picture` | `enum` | required | How the card shows its picture: `Large` under the words, `Small` beside them (square), `Alone` (Discord shows only the picture; elsewhere the large card), `None`. An image marked NSFW or shielded shows none whatever the style says. One of `Large`, `Small`, `Alone`, `None`. |
| `cropToCard` | `boolean` | required | With a large picture: cropped to 1.91 : 1, the shape X, Facebook, LinkedIn and WhatsApp draw, round its busiest part. |
| `colour` | `enum` | required | The colour of Discord's bar, the only platform that shows one: `Hematite` (the accent's ice steel), `Picture` (the picture's own, made light enough to read on Discord's grey) or `Custom` (`colourHex`). One of `Hematite`, `Picture`, `Custom`. |
| `colourHex` | `string \| null` | required | Your own colour: `#` and six hex digits. Needed with `Custom`; kept otherwise, so choosing `Custom` again finds it. |
| `showTime` | `boolean` | required | When it was uploaded, under the card in each reader's own time (Discord). |
| `motion` | `boolean` | required | An animated GIF or WebP moves in the card; off, it's its first frame. |
| `title` | `string \| null` |  | Its own title, a template (concept 11 §3: `{title\|"A screenshot"}`), at most 300 characters and one line; null or left out says the built-in's. From Silver. |
| `description` | `string \| null` |  | Its own description, a template, at most 600 characters, from Silver; `""` leaves it out of the card (every plan); null or left out says the built-in's. |
| `site` | `enum` |  | The site line over the title: `Hematite`, `Domain` (the domain your links go to, while it works) or `Custom` (`siteText`). Anything but `Hematite` from Silver. One of `Hematite`, `Domain`, `Custom`. |
| `siteText` | `string \| null` |  | Its own site name with `site` `Custom`, a template, at most 32 characters and one line, saying no service, brand or authority. Kept while another site line is chosen. |
| `name` | `string` | required | Its name, at most 32 characters, unique among your styles. |

### Response

Returns an [EmbedStyle](https://hematite.gg/docs/developers/models/embed-style).

Error `403`.

Error `404`: No such style of yours.

Error `409`.

Error `422`.

```bash
curl -X PATCH 'https://api.hematite.gg/v1/users/1/embed-styles/1' \
  -H "Authorization: $HEMATITE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"basedOn":"hematite","author":"Uploader","picture":"Large","cropToCard":false,"colour":"Hematite","colourHex":"string","showTime":false,"motion":false,"name":"Ranked"}'
```

Example `data`:

```json
{
  "id": 1,
  "key": "hematite",
  "name": "Ranked",
  "about": "string",
  "basedOn": "hematite",
  "version": 0,
  "author": "Uploader",
  "picture": "Large",
  "cropToCard": false,
  "colour": "Hematite",
  "colourHex": "string",
  "showTime": false,
  "motion": false,
  "title": "Clutch on Ascent",
  "description": "1v4 on the last round",
  "site": "Hematite",
  "siteText": "string"
}
```

## Delete one of your saved link preview styles, on any plan. If your links follow it, they go back to hematite's default.

`DELETE /users/:userId/embed-styles/:styleId`

Needs a session token. Rate limit: 30 a minute, per address. Not open to apps or API keys: a link preview's style is written in Settings → Embeds, which previews it.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |
| `styleId` | `number` | required |  |

### Response

Returns an `object` with these fields:

| Field | Type | Present | Notes |
|---|---|---|---|
| `deleted` | `true` |  | Must be `true`. |

```bash
curl -X DELETE 'https://api.hematite.gg/v1/users/1/embed-styles/1' \
  -H "Authorization: $HEMATITE_TOKEN"
```

Example `data`:

```json
{
  "deleted": true
}
```

## Get a user's folders

`GET /users/:userId/folders`

Needs a session token. Rate limit: 120 a minute, per address. An app's token or an API key needs the `folders:read` scope.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Response

Returns a list of [Folders](https://hematite.gg/docs/developers/models/folder).

```bash
curl 'https://api.hematite.gg/v1/users/1/folders' \
  -H "Authorization: $HEMATITE_TOKEN"
```

Example `data`:

```json
[
  {
    "id": 1,
    "userId": 1,
    "createdAt": "2026-11-10T18:24:00.000Z",
    "updatedAt": "2026-11-10T18:24:00.000Z",
    "contentType": "Image",
    "name": "Ranked",
    "description": "1v4 on the last round",
    "visibility": "Unlisted",
    "color": "#c4d4e0",
    "previewId": 1,
    "downloads": 0,
    "privateLockedAt": "2026-11-10T18:24:00.000Z",
    "offlineAt": "2026-11-10T18:24:00.000Z",
    "preview": {
      "key": "images/a1b2c3d4e5f6.png"
    },
    "shareId": 1,
    "shareCode": "x7Kp2QmA",
    "contentCount": 1,
    "size": 2457600,
    "contentCountForOthers": 0,
    "sizeForOthers": 0,
    "viewCount": 0,
    "likeCount": 0,
    "commentCount": 0
  }
]
```

## Get all images for a user

`GET /users/:userId/images`

Needs a session token. Rate limit: 120 a minute, per address. An app's token or an API key needs the `images:read` scope.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Query

| Field | Type | Required | Notes |
|---|---|---|---|
| `limit` | `number` |  | Default `100`. At least 1. |
| `offset` | `number` |  | Default `0`. At least 0. |
| `partial` | `boolean` |  | Default `false`. |
| `search` | `string` |  |  |

### Response

Returns a list, each an [Image](https://hematite.gg/docs/developers/models/image) or a [PartialImage](https://hematite.gg/docs/developers/models/partial-image).

```bash
curl 'https://api.hematite.gg/v1/users/1/images' \
  -H "Authorization: $HEMATITE_TOKEN"
```

Example `data`:

```json
[
  {
    "id": 1,
    "userId": 1,
    "createdAt": "2026-11-10T18:24:00.000Z",
    "updatedAt": "2026-11-10T18:24:00.000Z",
    "title": "Clutch on Ascent",
    "description": "1v4 on the last round",
    "visibility": "Unlisted",
    "folderId": 1,
    "views": 0,
    "downloads": 0,
    "favorite": false,
    "application": "VALORANT",
    "filename": "a1b2c3d4e5f6.png",
    "size": 2457600,
    "width": 1920,
    "height": 1080,
    "nsfw": false,
    "storageId": 1,
    "autoDeleteAt": null,
    "hideUser": false,
    "shield": false,
    "nsfwLockedAt": "2026-11-10T18:24:00.000Z",
    "privateLockedAt": "2026-11-10T18:24:00.000Z",
    "offlineAt": "2026-11-10T18:24:00.000Z",
    "storage": {
      "key": "images/a1b2c3d4e5f6.png"
    },
    "shareId": 1,
    "shareCode": "x7Kp2QmA",
    "likeCount": 0,
    "commentCount": 0,
    "meta": {
      "id": 1,
      "blurHash": "string",
      "dominantColor": "string",
      "palette": null,
      "hasAlpha": false,
      "animated": false,
      "orientation": 0
    },
    "treatment": "string",
    "burn": {
      "secondsPerView": 0,
      "viewsEach": 0,
      "viewsInAll": 0,
      "then": "Blur",
      "viewsUsed": 0,
      "burnedAt": "string"
    }
  }
]
```

## Get a user's discovery images: their public uploads, as their page shows them. Anyone but the user gets none of a hidden page, and never an image that hides who uploaded it. With `withoutShowcase`, the shots the showcase draws are left out, as the page lists the uploads under it.

`GET /users/:userId/images/discovery`

Needs no token. Rate limit: 120 a minute, per address. An app's token or an API key needs the `images:read` scope.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Query

| Field | Type | Required | Notes |
|---|---|---|---|
| `withoutShowcase` | `boolean` |  | Leave out the shots the user's showcase draws for you (`GET /users/:userId/showcase`), as their page lists its uploads under it: for you, every pin of yours that shows; for anyone else's, their pins once at least three show. Default `false`. |

### Response

Returns a list of [Images](https://hematite.gg/docs/developers/models/image).

```bash
curl 'https://api.hematite.gg/v1/users/1/images/discovery'
```

Example `data`:

```json
[
  {
    "id": 1,
    "userId": 1,
    "createdAt": "2026-11-10T18:24:00.000Z",
    "updatedAt": "2026-11-10T18:24:00.000Z",
    "title": "Clutch on Ascent",
    "description": "1v4 on the last round",
    "visibility": "Unlisted",
    "folderId": 1,
    "views": 0,
    "downloads": 0,
    "favorite": false,
    "application": "VALORANT",
    "filename": "a1b2c3d4e5f6.png",
    "size": 2457600,
    "width": 1920,
    "height": 1080,
    "nsfw": false,
    "storageId": 1,
    "autoDeleteAt": null,
    "hideUser": false,
    "shield": false,
    "nsfwLockedAt": "2026-11-10T18:24:00.000Z",
    "privateLockedAt": "2026-11-10T18:24:00.000Z",
    "offlineAt": "2026-11-10T18:24:00.000Z",
    "storage": {
      "key": "images/a1b2c3d4e5f6.png"
    },
    "shareId": 1,
    "shareCode": "x7Kp2QmA",
    "likeCount": 0,
    "commentCount": 0,
    "meta": {
      "id": 1,
      "blurHash": "string",
      "dominantColor": "string",
      "palette": null,
      "hasAlpha": false,
      "animated": false,
      "orientation": 0
    },
    "treatment": "string",
    "burn": {
      "secondsPerView": 0,
      "viewsEach": 0,
      "viewsInAll": 0,
      "then": "Blur",
      "viewsUsed": 0,
      "burnedAt": "string"
    }
  }
]
```

## Get a user's image-ids that exceed the storage limit

`GET /users/:userId/images/over-quota`

Needs a session token. Rate limit: 120 a minute, per address. An app's token or an API key needs the `images:read` scope.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Response

Returns a list, each item a `number`.

```bash
curl 'https://api.hematite.gg/v1/users/1/images/over-quota' \
  -H "Authorization: $HEMATITE_TOKEN"
```

Example `data`:

```json
[
  0
]
```

## Search for a user's images

`POST /users/:userId/images/search`

Needs a session token. Rate limit: 120 a minute, per address. An app's token or an API key needs the `images:read` scope.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Body

| Field | Type | Required | Notes |
|---|---|---|---|
| `limit` | `integer` |  | Default `100`. More than 0. |
| `offset` | `integer` |  | Default `0`. At least 0. |
| `query` | `object` |  |  |
| `query.fields` | `enum[]` | required |  |
| `query.value` | `string` | required |  |
| `order` | `object` |  |  |
| `order.field` | `enum` | required | One of `id`, `createdAt`, `views`, `downloads`, `size`. |
| `order.direction` | `enum` | required | One of `asc`, `desc`. |
| `filter` | `object[]` |  |  |
| `filter.field` | `enum` | required | One of `id`, `createdAt`, `views`, `downloads`, `visibility`, `folderId`, `title`, `description`, `size`, `hideUser`, `autoDeleteAt`, `favorite`, `nsfw`. |
| `filter.operator` | `enum` | required | One of `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `contains`, `notContains`, `startsWith`, `endsWith`. |
| `filter.value` | `string` | required |  |
| `partial` | `boolean` |  | Default `false`. |

### Response

Returns an `object` with these fields:

| Field | Type | Present | Notes |
|---|---|---|---|
| `results` | ([`Image`](https://hematite.gg/docs/developers/models/image) or [`PartialImage`](https://hematite.gg/docs/developers/models/partial-image))[] |  |  |
| `total` | `integer` |  |  |

```bash
curl -X POST 'https://api.hematite.gg/v1/users/1/images/search' \
  -H "Authorization: $HEMATITE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"limit":100}'
```

Example `data`:

```json
{
  "results": [
    {
      "id": 1,
      "userId": 1,
      "createdAt": "2026-11-10T18:24:00.000Z",
      "updatedAt": "2026-11-10T18:24:00.000Z",
      "title": "Clutch on Ascent",
      "description": "1v4 on the last round",
      "visibility": "Unlisted",
      "folderId": 1,
      "views": 0,
      "downloads": 0,
      "favorite": false,
      "application": "VALORANT",
      "filename": "a1b2c3d4e5f6.png",
      "size": 2457600,
      "width": 1920,
      "height": 1080,
      "nsfw": false,
      "storageId": 1,
      "autoDeleteAt": null,
      "hideUser": false,
      "shield": false,
      "nsfwLockedAt": "2026-11-10T18:24:00.000Z",
      "privateLockedAt": "2026-11-10T18:24:00.000Z",
      "offlineAt": "2026-11-10T18:24:00.000Z",
      "storage": {
        "key": "images/a1b2c3d4e5f6.png"
      },
      "shareId": 1,
      "shareCode": "x7Kp2QmA",
      "likeCount": 0,
      "commentCount": 0,
      "meta": {
        "id": 1,
        "blurHash": "string",
        "dominantColor": "string",
        "palette": null,
        "hasAlpha": false,
        "animated": false,
        "orientation": 0
      },
      "treatment": "string",
      "burn": {
        "secondsPerView": 0,
        "viewsEach": 0,
        "viewsInAll": 0,
        "then": "Blur",
        "viewsUsed": 0,
        "burnedAt": "string"
      }
    }
  ],
  "total": 0
}
```

## Your personal API keys that work, newest first, each with the child keys cut from it. Never a token: a key's is shown once, when it's made. Only your own, signed in to hematite.

`GET /users/:userId/keys`

Needs a session token. Rate limit: 120 a minute, per address. Not open to apps or API keys: API keys are made, listed and turned off by their user, signed in to hematite.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Response

Returns a list of [ApiKeys](https://hematite.gg/docs/developers/models/api-key), each plus this field:

| Field | Type | Present | Notes |
|---|---|---|---|
| `children` | [`ApiKey`](https://hematite.gg/docs/developers/models/api-key)[] |  | The child keys cut from it that still work, newest first. |

```bash
curl 'https://api.hematite.gg/v1/users/1/keys' \
  -H "Authorization: $HEMATITE_TOKEN"
```

Example `data`:

```json
[
  {
    "publicId": "m0plGGtn67kMZy6D",
    "note": "ShareX",
    "scopes": [
      "images:read"
    ],
    "constraints": {
      "ips": [
        "203.0.113.7"
      ],
      "perMinute": 0,
      "folderId": 1,
      "visibility": "Unlisted"
    },
    "usesLeft": 0,
    "parent": "string",
    "createdAt": "2026-11-10T18:24:00.000Z",
    "usedAt": "2026-11-10T18:24:00.000Z",
    "expiresAt": "2026-11-10T18:24:00.000Z",
    "children": [
      {
        "publicId": "m0plGGtn67kMZy6D",
        "note": "ShareX",
        "scopes": [
          "images:read"
        ],
        "constraints": {
          "ips": [
            "203.0.113.7"
          ],
          "perMinute": 0,
          "folderId": 1,
          "visibility": "Unlisted"
        },
        "usesLeft": 0,
        "parent": "string",
        "createdAt": "2026-11-10T18:24:00.000Z",
        "usedAt": "2026-11-10T18:24:00.000Z",
        "expiresAt": "2026-11-10T18:24:00.000Z"
      }
    ]
  }
]
```

## Get a user's likes

`GET /users/:userId/likes`

Needs a session token. Rate limit: 120 a minute, per address. An app's token or an API key needs the `likes:read` scope.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Response

Returns a list of [Likes](https://hematite.gg/docs/developers/models/like).

```bash
curl 'https://api.hematite.gg/v1/users/1/likes' \
  -H "Authorization: $HEMATITE_TOKEN"
```

Example `data`:

```json
[
  {
    "id": 1,
    "userId": 1,
    "createdAt": "2026-11-10T18:24:00.000Z",
    "referenceType": "Image",
    "referenceId": 1
  }
]
```

## Get a user's notifications

`GET /users/:userId/notifications`

Needs a session token. Rate limit: 120 a minute, per address. An app's token or an API key needs the `notifications:read` scope.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Response

Returns a list of [Notifications](https://hematite.gg/docs/developers/models/notification).

```bash
curl 'https://api.hematite.gg/v1/users/1/notifications' \
  -H "Authorization: $HEMATITE_TOKEN"
```

Example `data`:

```json
[
  {
    "id": 1,
    "userId": 1,
    "createdAt": "2026-11-10T18:24:00.000Z",
    "updatedAt": "2026-11-10T18:24:00.000Z",
    "type": "Neutral",
    "title": "Clutch on Ascent",
    "message": "OK",
    "status": "Unread",
    "metadata": null
  }
]
```

## Mark all your notifications read, in one request. Returns the ones it read, as they now are; one that arrives meanwhile stays new. Only your own.

`POST /users/:userId/notifications/read`

Needs a session token. Rate limit: 30 a minute, per address. An app's token or an API key needs the `notifications:write` scope.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Response

Returns a list of [Notifications](https://hematite.gg/docs/developers/models/notification).

```bash
curl -X POST 'https://api.hematite.gg/v1/users/1/notifications/read' \
  -H "Authorization: $HEMATITE_TOKEN"
```

Example `data`:

```json
[
  {
    "id": 1,
    "userId": 1,
    "createdAt": "2026-11-10T18:24:00.000Z",
    "updatedAt": "2026-11-10T18:24:00.000Z",
    "type": "Neutral",
    "title": "Clutch on Ascent",
    "message": "OK",
    "status": "Unread",
    "metadata": null
  }
]
```

## Get a user's sessions: the devices signed in and the upload tokens. Tokens aren't part of it: a token is shown once, when its session is created. Apps' tokens are the connected apps (`/users/:userId/connected-apps`).

`GET /users/:userId/sessions`

Needs a session token. Rate limit: 120 a minute, per address. Not open to apps or API keys: signing in, sessions and upload tokens are the account's own.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Response

Returns a list of [Sessions](https://hematite.gg/docs/developers/models/session), each plus this field:

| Field | Type | Present | Notes |
|---|---|---|---|
| `current` | `boolean` |  | Whether this is the session the request was made with. |

```bash
curl 'https://api.hematite.gg/v1/users/1/sessions' \
  -H "Authorization: $HEMATITE_TOKEN"
```

Example `data`:

```json
[
  {
    "id": 1,
    "userId": 1,
    "type": "Upload",
    "publicId": "m0plGGtn67kMZy6D",
    "createdAt": "2026-11-10T18:24:00.000Z",
    "usedAt": "2026-11-10T18:24:00.000Z",
    "expiresAt": "2027-11-10T18:24:00.000Z",
    "ip": "203.0.113.7",
    "device": "Mozilla/5.0",
    "note": "ShareX",
    "current": false
  }
]
```

## Get a user's showcase: the shots pinned at the top of their page, in their order. The user gets every pin, those that don't show to anyone else too. Anyone else gets only the pins whose image is Public, showing who uploaded it (not `hideUser`) and not marked NSFW, and none at all when fewer than 3 are, or when the user hides their page.

`GET /users/:userId/showcase`

Needs no token. Rate limit: 120 a minute, per address. An app's token or an API key needs the `images:read` scope.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Response

Returns a list of [Images](https://hematite.gg/docs/developers/models/image).

```bash
curl 'https://api.hematite.gg/v1/users/1/showcase'
```

Example `data`:

```json
[
  {
    "id": 1,
    "userId": 1,
    "createdAt": "2026-11-10T18:24:00.000Z",
    "updatedAt": "2026-11-10T18:24:00.000Z",
    "title": "Clutch on Ascent",
    "description": "1v4 on the last round",
    "visibility": "Unlisted",
    "folderId": 1,
    "views": 0,
    "downloads": 0,
    "favorite": false,
    "application": "VALORANT",
    "filename": "a1b2c3d4e5f6.png",
    "size": 2457600,
    "width": 1920,
    "height": 1080,
    "nsfw": false,
    "storageId": 1,
    "autoDeleteAt": null,
    "hideUser": false,
    "shield": false,
    "nsfwLockedAt": "2026-11-10T18:24:00.000Z",
    "privateLockedAt": "2026-11-10T18:24:00.000Z",
    "offlineAt": "2026-11-10T18:24:00.000Z",
    "storage": {
      "key": "images/a1b2c3d4e5f6.png"
    },
    "shareId": 1,
    "shareCode": "x7Kp2QmA",
    "likeCount": 0,
    "commentCount": 0,
    "meta": {
      "id": 1,
      "blurHash": "string",
      "dominantColor": "string",
      "palette": null,
      "hasAlpha": false,
      "animated": false,
      "orientation": 0
    },
    "treatment": "string",
    "burn": {
      "secondsPerView": 0,
      "viewsEach": 0,
      "viewsInAll": 0,
      "then": "Blur",
      "viewsUsed": 0,
      "burnedAt": "string"
    }
  }
]
```

## Pin shots to your showcase, in this order, replacing what was pinned. Each must be one of your own images, Public, showing who uploaded it (not `hideUser`) and not marked NSFW; if one isn't, nothing changes. Others see the showcase once at least 3 of them show. Returns every pin, as you see it.

`PUT /users/:userId/showcase`

Needs a session token. Rate limit: 30 a minute, per address. An app's token or an API key needs the `users:write` scope.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Body

| Field | Type | Required | Notes |
|---|---|---|---|
| `imageIds` | `integer[]` | required | Ids of your own images, 6 at most, in the order they show. An empty list unpins them all. At most 6 items. No repeats. |

### Response

Returns a list of [Images](https://hematite.gg/docs/developers/models/image).

Error `403`: Only your own showcase can be set.

Error `404`: There's no user with this id.

Error `422`.

```bash
curl -X PUT 'https://api.hematite.gg/v1/users/1/showcase' \
  -H "Authorization: $HEMATITE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"imageIds":[1]}'
```

Example `data`:

```json
[
  {
    "id": 1,
    "userId": 1,
    "createdAt": "2026-11-10T18:24:00.000Z",
    "updatedAt": "2026-11-10T18:24:00.000Z",
    "title": "Clutch on Ascent",
    "description": "1v4 on the last round",
    "visibility": "Unlisted",
    "folderId": 1,
    "views": 0,
    "downloads": 0,
    "favorite": false,
    "application": "VALORANT",
    "filename": "a1b2c3d4e5f6.png",
    "size": 2457600,
    "width": 1920,
    "height": 1080,
    "nsfw": false,
    "storageId": 1,
    "autoDeleteAt": null,
    "hideUser": false,
    "shield": false,
    "nsfwLockedAt": "2026-11-10T18:24:00.000Z",
    "privateLockedAt": "2026-11-10T18:24:00.000Z",
    "offlineAt": "2026-11-10T18:24:00.000Z",
    "storage": {
      "key": "images/a1b2c3d4e5f6.png"
    },
    "shareId": 1,
    "shareCode": "x7Kp2QmA",
    "likeCount": 0,
    "commentCount": 0,
    "meta": {
      "id": 1,
      "blurHash": "string",
      "dominantColor": "string",
      "palette": null,
      "hasAlpha": false,
      "animated": false,
      "orientation": 0
    },
    "treatment": "string",
    "burn": {
      "secondsPerView": 0,
      "viewsEach": 0,
      "viewsInAll": 0,
      "then": "Blur",
      "viewsUsed": 0,
      "burnedAt": "string"
    }
  }
]
```

## Get your standing (Settings → Standing): one of `Good`, `Warned`, `AtRisk`, `Suspended`; how many strikes count now and when the first of them ends; a suspension's end; the decisions about your things and your account, newest first, with each statement of reasons as it was sent; and your images locked Private or NSFW by a decision. A strike counts 90 days, 180 for harassment, hate, scams and impersonation. Only your own, a suspended account's too; apps can't read it.

`GET /users/:userId/standing`

Needs a session token. Rate limit: 120 a minute, per address. Not open to apps or API keys: an account's standing is between its owner and hematite, read on hematite.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Response

Returns a [Standing](https://hematite.gg/docs/developers/models/standing).

```bash
curl 'https://api.hematite.gg/v1/users/1/standing' \
  -H "Authorization: $HEMATITE_TOKEN"
```

Example `data`:

```json
{
  "state": "Good",
  "activeStrikes": 0,
  "suspendedUntil": "2026-11-10T18:24:00.000Z",
  "soonest": {
    "givenAt": "2026-11-10T18:24:00.000Z",
    "endsAt": "2026-11-10T18:24:00.000Z"
  },
  "nameLocked": false,
  "stylesLocked": false,
  "decisions": [
    {
      "id": 1,
      "ref": "string",
      "kind": "NoBreach",
      "with": [
        "NoBreach"
      ],
      "targetType": "Image",
      "targetId": "string",
      "parts": [
        "name"
      ],
      "ground": "Law",
      "groundRef": "string",
      "strike": {
        "endsAt": "2026-11-10T18:24:00.000Z",
        "counting": false
      },
      "until": "2026-11-10T18:24:00.000Z",
      "statement": "string",
      "createdAt": "2026-11-10T18:24:00.000Z",
      "image": {
        "id": 1,
        "key": "images/a1b2c3d4e5f6.png",
        "nsfw": false
      }
    }
  ],
  "restricted": [
    {
      "imageId": 1,
      "title": "Clutch on Ascent",
      "lock": "Private",
      "ref": "string"
    }
  ]
}
```

## Get where a user's storage goes: by kind and visibility, the last 30 days' uploads, and what could be cleared

`GET /users/:userId/storage`

Needs a session token. Rate limit: 120 a minute, per address. An app's token or an API key needs the `users:read` scope.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Response

Returns an `object` with these fields:

| Field | Type | Present | Notes |
|---|---|---|---|
| `imageCount` | `integer` |  |  |
| `bytes` | `number` |  |  |
| `byKind` | `object[]` |  |  |
| `byKind.kind` | `enum` |  | One of `PNG`, `JPEG`, `WebP`, `GIF`, `Other`. |
| `byKind.count` | `integer` |  |  |
| `byKind.bytes` | `number` |  |  |
| `byVisibility` | `object[]` |  |  |
| `byVisibility.visibility` | `enum` |  | One of `Unlisted`, `Public`, `Private`. |
| `byVisibility.count` | `integer` |  |  |
| `byVisibility.bytes` | `number` |  |  |
| `days` | `object[]` |  |  |
| `days.date` | `string` |  |  |
| `days.count` | `integer` |  |  |
| `days.bytes` | `number` |  |  |
| `neverViewed` | `object` |  |  |
| `neverViewed.count` | `integer` |  |  |
| `neverViewed.bytes` | `number` |  |  |
| `olderThanYear` | `object` |  |  |
| `olderThanYear.count` | `integer` |  |  |
| `olderThanYear.bytes` | `number` |  |  |
| `overQuota` | `object` |  |  |
| `overQuota.count` | `integer` |  |  |
| `overQuota.bytes` | `number` |  |  |

```bash
curl 'https://api.hematite.gg/v1/users/1/storage' \
  -H "Authorization: $HEMATITE_TOKEN"
```

Example `data`:

```json
{
  "imageCount": 1,
  "bytes": 0,
  "byKind": [
    {
      "kind": "PNG",
      "count": 0,
      "bytes": 0
    }
  ],
  "byVisibility": [
    {
      "visibility": "Unlisted",
      "count": 0,
      "bytes": 0
    }
  ],
  "days": [
    {
      "date": "string",
      "count": 0,
      "bytes": 0
    }
  ],
  "neverViewed": {
    "count": 0,
    "bytes": 0
  },
  "olderThanYear": {
    "count": 0,
    "bytes": 0
  },
  "overQuota": {
    "count": 0,
    "bytes": 0
  }
}
```

## Your two-step sign-in: whether it's on, the authenticator app and the passkeys with when each was added and last used, how many recovery codes are left, and until when this sign-in's step-up holds.

`GET /users/:userId/two-factor`

Needs a session token. Rate limit: 120 a minute, per address. Not open to apps or API keys: signing in, sessions and upload tokens are the account's own.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Response

Returns an `object` with these fields:

| Field | Type | Present | Notes |
|---|---|---|---|
| `enabled` | `boolean` |  | On while the account has an authenticator app or a passkey. |
| `totp` | `object \| null` |  | The authenticator app, once a code from it confirmed it. |
| `totp.createdAt` | `date-time` |  |  |
| `totp.lastUsedAt` | `date-time \| null` |  |  |
| `passkeys` | `object[]` |  |  |
| `passkeys.id` | `integer` |  |  |
| `passkeys.name` | `string` |  | What its owner called it ("MacBook"). |
| `passkeys.createdAt` | `date-time` |  |  |
| `passkeys.lastUsedAt` | `date-time \| null` |  |  |
| `recoveryCodes` | `object \| null` |  | How many of the recovery codes are left; null while two-step sign-in is off. |
| `recoveryCodes.left` | `integer` |  |  |
| `recoveryCodes.total` | `integer` |  |  |
| `recoveryCodes.createdAt` | `date-time` |  |  |
| `methods` | `enum[]` |  |  |
| `stepUpUntil` | `date-time \| null` |  | Until when this sign-in's step-up holds (`POST /auth/reauth`); null when it has none: changes here ask for one first. |
| `suggested` | `boolean` |  | While it's off: whether Settings → Security suggests it, for an account with a custom domain, an app or a paid plan. |

```bash
curl 'https://api.hematite.gg/v1/users/1/two-factor' \
  -H "Authorization: $HEMATITE_TOKEN"
```

Example `data`:

```json
{
  "enabled": false,
  "totp": {
    "createdAt": "2026-11-10T18:24:00.000Z",
    "lastUsedAt": "2026-11-10T18:24:00.000Z"
  },
  "passkeys": [
    {
      "id": 1,
      "name": "Ranked",
      "createdAt": "2026-11-10T18:24:00.000Z",
      "lastUsedAt": "2026-11-10T18:24:00.000Z"
    }
  ],
  "recoveryCodes": {
    "left": 0,
    "total": 0,
    "createdAt": "2026-11-10T18:24:00.000Z"
  },
  "methods": [
    "passkey"
  ],
  "stepUpUntil": "2026-11-10T18:24:00.000Z",
  "suggested": false
}
```

## Adds a passkey: the browser's answer to the options from `POST /users/:userId/two-factor/passkeys/options`, and its name. The first method also turns two-step sign-in on and answers its ten recovery codes, shown only now. Needs a fresh step-up.

`POST /users/:userId/two-factor/passkeys`

Needs a session token. Rate limit: 10 a minute, per address. Not open to apps or API keys: signing in, sessions and upload tokens are the account's own.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Body

| Field | Type | Required | Notes |
|---|---|---|---|
| `name` | `string` | required | What to call it, so you know which device it is ("MacBook"). 1 to 64 characters. |
| `response` | `object` | required | What the browser's `navigator.credentials.create()` answered, as JSON (WebAuthn's `RegistrationResponseJSON`; `startRegistration()` of `@simplewebauthn/browser` gives it). |
| `response.id` | `string` | required | 1 to 1024 characters. Matches ^[A-Za-z0-9_-]*$. |
| `response.rawId` | `string` | required | 1 to 1024 characters. Matches ^[A-Za-z0-9_-]*$. |
| `response.type` | `"public-key"` | required |  |
| `response.authenticatorAttachment` | `enum` |  | One of `platform`, `cross-platform`. |
| `response.clientExtensionResults` | `map of any` |  |  |
| `response.response` | `object` | required |  |
| `response.response.clientDataJSON` | `string` | required | At most 16384 characters. Matches ^[A-Za-z0-9_-]*$. |
| `response.response.attestationObject` | `string` | required | At most 16384 characters. Matches ^[A-Za-z0-9_-]*$. |
| `response.response.authenticatorData` | `string` |  | At most 16384 characters. Matches ^[A-Za-z0-9_-]*$. |
| `response.response.transports` | `string[]` |  | At most 8 items. |
| `response.response.publicKeyAlgorithm` | `integer` |  |  |
| `response.response.publicKey` | `string` |  | At most 16384 characters. Matches ^[A-Za-z0-9_-]*$. |

### Response

Returns an `object` with these fields:

| Field | Type | Present | Notes |
|---|---|---|---|
| `passkey` | `object` |  |  |
| `passkey.id` | `integer` |  |  |
| `passkey.name` | `string` |  | What its owner called it ("MacBook"). |
| `passkey.createdAt` | `date-time` |  |  |
| `passkey.lastUsedAt` | `date-time \| null` |  |  |
| `recoveryCodes` | `string[] \| null` |  | The ten recovery codes when this turned two-step sign-in on, shown only now; null when it was on already. |

```bash
curl -X POST 'https://api.hematite.gg/v1/users/1/two-factor/passkeys' \
  -H "Authorization: $HEMATITE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Ranked","response":{"id":"string","rawId":"string","type":"public-key","authenticatorAttachment":"platform","clientExtensionResults":{"clientExtensionResultsKey":null},"response":{"clientDataJSON":"string","attestationObject":"string","authenticatorData":"string","transports":["string"],"publicKeyAlgorithm":0,"publicKey":"string"}}}'
```

Example `data`:

```json
{
  "passkey": {
    "id": 1,
    "name": "Ranked",
    "createdAt": "2026-11-10T18:24:00.000Z",
    "lastUsedAt": "2026-11-10T18:24:00.000Z"
  },
  "recoveryCodes": [
    "string"
  ]
}
```

## Renames a passkey.

`PATCH /users/:userId/two-factor/passkeys/:passkeyId`

Needs a session token. Rate limit: 10 a minute, per address. Not open to apps or API keys: signing in, sessions and upload tokens are the account's own.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |
| `passkeyId` | `number` | required |  |

### Body

| Field | Type | Required | Notes |
|---|---|---|---|
| `name` | `string` | required | What to call it, so you know which device it is ("MacBook"). 1 to 64 characters. |

### Response

Returns an `object` with these fields:

| Field | Type | Present | Notes |
|---|---|---|---|
| `id` | `integer` |  |  |
| `name` | `string` |  | What its owner called it ("MacBook"). |
| `createdAt` | `date-time` |  |  |
| `lastUsedAt` | `date-time \| null` |  |  |

```bash
curl -X PATCH 'https://api.hematite.gg/v1/users/1/two-factor/passkeys/1' \
  -H "Authorization: $HEMATITE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Ranked"}'
```

Example `data`:

```json
{
  "id": 1,
  "name": "Ranked",
  "createdAt": "2026-11-10T18:24:00.000Z",
  "lastUsedAt": "2026-11-10T18:24:00.000Z"
}
```

## Removes a passkey. Needs a fresh step-up; when it's the last method, two-step sign-in turns off with it and the recovery codes stop, which takes the password too.

`DELETE /users/:userId/two-factor/passkeys/:passkeyId`

Needs a session token. Rate limit: 10 a minute, per address. Not open to apps or API keys: signing in, sessions and upload tokens are the account's own.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |
| `passkeyId` | `number` | required |  |

### Body

| Field | Type | Required | Notes |
|---|---|---|---|
| `password` | `string` |  | Your password: needed when this turns two-step sign-in off. At most 128 characters. |

### Response

Returns an `object` with these fields:

| Field | Type | Present | Notes |
|---|---|---|---|
| `enabled` | `boolean` |  | Whether two-step sign-in is still on. |

```bash
curl -X DELETE 'https://api.hematite.gg/v1/users/1/two-factor/passkeys/1' \
  -H "Authorization: $HEMATITE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"password":"••••••••"}'
```

Example `data`:

```json
{
  "enabled": false
}
```

## WebAuthn's options for adding a passkey: hand them to the browser (`startRegistration({ optionsJSON })` of `@simplewebauthn/browser`) and send its answer to `POST /users/:userId/two-factor/passkeys` within five minutes. Needs a fresh step-up.

`POST /users/:userId/two-factor/passkeys/options`

Needs a session token. Rate limit: 10 a minute, per address. Not open to apps or API keys: signing in, sessions and upload tokens are the account's own.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Response

Returns an `object` with these fields:

| Field | Type | Present | Notes |
|---|---|---|---|
| `rp` | `object` |  |  |
| `rp.name` | `string` |  |  |
| `rp.id` | `string` | optional |  |
| `user` | `object` |  |  |
| `user.id` | `string` |  |  |
| `user.name` | `string` |  |  |
| `user.displayName` | `string` |  |  |
| `challenge` | `string` |  |  |
| `pubKeyCredParams` | `object[]` |  |  |
| `pubKeyCredParams.alg` | `number` |  |  |
| `pubKeyCredParams.type` | `"public-key"` |  |  |
| `timeout` | `number` | optional |  |
| `excludeCredentials` | `object[]` | optional |  |
| `excludeCredentials.id` | `string` |  |  |
| `excludeCredentials.type` | `"public-key"` |  |  |
| `excludeCredentials.transports` | `enum[]` | optional |  |
| `authenticatorSelection` | `object` | optional |  |
| `authenticatorSelection.authenticatorAttachment` | `enum` | optional | One of `platform`, `cross-platform`. |
| `authenticatorSelection.requireResidentKey` | `boolean` | optional |  |
| `authenticatorSelection.residentKey` | `enum` | optional | One of `discouraged`, `preferred`, `required`. |
| `authenticatorSelection.userVerification` | `enum` | optional | One of `required`, `preferred`, `discouraged`. |
| `attestation` | `enum` | optional | One of `direct`, `enterprise`, `indirect`, `none`. |

```bash
curl -X POST 'https://api.hematite.gg/v1/users/1/two-factor/passkeys/options' \
  -H "Authorization: $HEMATITE_TOKEN"
```

Example `data`:

```json
{
  "rp": {
    "name": "Ranked",
    "id": "string"
  },
  "user": {
    "id": "string",
    "name": "Ranked",
    "displayName": "Ranked"
  },
  "challenge": "string",
  "pubKeyCredParams": [
    {
      "alg": 0,
      "type": "public-key"
    }
  ],
  "timeout": 0,
  "excludeCredentials": [
    {
      "id": "string",
      "type": "public-key",
      "transports": [
        "ble"
      ]
    }
  ],
  "authenticatorSelection": {
    "authenticatorAttachment": "platform",
    "requireResidentKey": false,
    "residentKey": "discouraged",
    "userVerification": "required"
  },
  "attestation": "direct"
}
```

## A new set of ten recovery codes, shown only now; the old ones stop at once. Needs two-step sign-in on and a fresh step-up.

`POST /users/:userId/two-factor/recovery-codes`

Needs a session token. Rate limit: 5 an hour, per address. Not open to apps or API keys: signing in, sessions and upload tokens are the account's own.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Response

Returns an `object` with these fields:

| Field | Type | Present | Notes |
|---|---|---|---|
| `recoveryCodes` | `string[]` |  | The ten new codes, shown only now. |

```bash
curl -X POST 'https://api.hematite.gg/v1/users/1/two-factor/recovery-codes' \
  -H "Authorization: $HEMATITE_TOKEN"
```

Example `data`:

```json
{
  "recoveryCodes": [
    "string"
  ]
}
```

## Starts adding an authenticator app: a new secret, as text and as the `otpauth://` address its QR code carries. It's on once a code from the app confirms it (`POST /users/:userId/two-factor/totp/confirm`); until then it signs nobody in, and asking again makes a new one. Needs a fresh step-up (`POST /auth/reauth`).

`POST /users/:userId/two-factor/totp`

Needs a session token. Rate limit: 5 a minute, per address. Not open to apps or API keys: signing in, sessions and upload tokens are the account's own.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Response

Returns an `object` with these fields:

| Field | Type | Present | Notes |
|---|---|---|---|
| `secret` | `string` |  | The secret in base32, for an app on the same phone: typed in, or pasted. |
| `otpauthUrl` | `string` |  | The `otpauth://totp/…` address, for a QR code an app scans. |

```bash
curl -X POST 'https://api.hematite.gg/v1/users/1/two-factor/totp' \
  -H "Authorization: $HEMATITE_TOKEN"
```

Example `data`:

```json
{
  "secret": "string",
  "otpauthUrl": "https://cdn.hematite.gg/images/a1b2c3d4e5f6.png"
}
```

## Removes the authenticator app. Needs a fresh step-up; when it's the last method, two-step sign-in turns off with it and the recovery codes stop, which takes the password too.

`DELETE /users/:userId/two-factor/totp`

Needs a session token. Rate limit: 5 a minute, per address. Not open to apps or API keys: signing in, sessions and upload tokens are the account's own.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Body

| Field | Type | Required | Notes |
|---|---|---|---|
| `password` | `string` |  | Your password: needed when this turns two-step sign-in off. At most 128 characters. |

### Response

Returns an `object` with these fields:

| Field | Type | Present | Notes |
|---|---|---|---|
| `enabled` | `boolean` |  | Whether two-step sign-in is still on. |

```bash
curl -X DELETE 'https://api.hematite.gg/v1/users/1/two-factor/totp' \
  -H "Authorization: $HEMATITE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"password":"••••••••"}'
```

Example `data`:

```json
{
  "enabled": false
}
```

## Turns the authenticator app on with a code from it. The first method also turns two-step sign-in on and answers its ten recovery codes, shown only now. Needs a fresh step-up.

`POST /users/:userId/two-factor/totp/confirm`

Needs a session token. Rate limit: 5 a minute, per address. Not open to apps or API keys: signing in, sessions and upload tokens are the account's own.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Body

| Field | Type | Required | Notes |
|---|---|---|---|
| `code` | `string` | required | The six digits the app shows now. At most 16 characters. |

### Response

Returns an `object` with these fields:

| Field | Type | Present | Notes |
|---|---|---|---|
| `recoveryCodes` | `string[] \| null` |  | The ten recovery codes when this turned two-step sign-in on, shown only now; null when it was on already. |

```bash
curl -X POST 'https://api.hematite.gg/v1/users/1/two-factor/totp/confirm' \
  -H "Authorization: $HEMATITE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"code":"x7Kp2QmA"}'
```

Example `data`:

```json
{
  "recoveryCodes": [
    "string"
  ]
}
```

## Get a user's upload settings

`GET /users/:userId/upload-settings`

Needs a session token. Rate limit: 120 a minute, per address. An app's token or an API key needs the `users:read` scope.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Response

Returns a [UserUploadSettings](https://hematite.gg/docs/developers/models/user-upload-settings).

```bash
curl 'https://api.hematite.gg/v1/users/1/upload-settings' \
  -H "Authorization: $HEMATITE_TOKEN"
```

Example `data`:

```json
{
  "id": 1,
  "shareCodeMode": "Alphanumeric",
  "shareCodeLength": 8,
  "compressionQuality": 85,
  "visibility": "Unlisted",
  "watermarkMode": "None",
  "watermark": {
    "text": "string",
    "position": "top-left",
    "size": "small",
    "opacity": 0,
    "tone": "light"
  },
  "randomizeFilenames": false,
  "autoDeleteAfter": null,
  "shareUrlType": "Domain",
  "domainSubdomain": "string",
  "domainPath": "string",
  "embedStyleId": 1,
  "updatedAt": "2026-11-10T18:24:00.000Z",
  "embedStyle": {
    "id": 1,
    "key": "hematite",
    "name": "Ranked",
    "about": "string",
    "basedOn": "hematite",
    "version": 0,
    "author": "Uploader",
    "picture": "Large",
    "cropToCard": false,
    "colour": "Hematite",
    "colourHex": "string",
    "showTime": false,
    "motion": false,
    "title": "Clutch on Ascent",
    "description": "1v4 on the last round",
    "site": "Hematite",
    "siteText": "string"
  }
}
```

## Update a user's upload settings

`PATCH /users/:userId/upload-settings`

Needs a session token. Rate limit: 120 a minute, per address. An app's token or an API key needs the `users:write` scope. Apps can't send: `embedStyle`, `embedStyleId`.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Body

Send at least one field.

| Field | Type | Required | Notes |
|---|---|---|---|
| `shareCodeMode` | `enum` |  | One of `Alphanumeric`, `Letters`, `Lowercase`, `Numbers`, `Hexadecimal`, `Unambiguous`, `Emojis`, `Memorable`. |
| `shareCodeLength` | `number` |  | 1 to 32. |
| `compressionQuality` | `number` |  | 1 to 100. |
| `visibility` | `enum` |  | One of `Unlisted`, `Public`, `Private`. |
| `watermarkMode` | `enum` |  | One of `None`, `Minimal`, `Medium`, `Full`. |
| `randomizeFilenames` | `boolean` |  |  |
| `autoDeleteAfter` | `integer \| null` |  | How many minutes after its upload a new image deletes itself, or null to keep it. Maximum is 5259600 (10 years). Applies to every upload that doesn't set its own autoDeleteAt. |
| `shareUrlType` | `enum` |  | Where a new upload's link goes: its share page on the user's domain (`Domain`), or the file itself on the cdn (`PermanentCDN`), with the user's watermark when they have one. One of `Domain`, `PermanentCDN`. |
| `domainSubdomain` | `string` |  | The subdomain your links use on a domain that takes one: a DNS label (letters, digits and inner `-`, up to 63), not one hematite keeps (hosts such as `www` and `api`, staff, payment and sign-in words, brands, offensive words). Matches ^(?!-)[a-z0-9-]{1,63}(?<!-)$. |
| `domainPath` | `string` |  | Matches ^[A-Za-z0-9\-._~%!$&'()*+,;=:@]*$. |
| `watermark` | `object \| null` |  | The custom watermark, drawn while `watermarkMode` is `Medium`; null forgets it (and can't go with `Medium`). |
| `watermark.text` | `string` | required | One line of at most 32 characters: letters (Latin scripts, Vietnamese), digits and common signs. Kept composed (NFC) and without spaces at its ends. 1 to 64 characters. |
| `watermark.position` | `enum` | required | Where it sits: a place of a 3 × 3 grid over the picture. One of `top-left`, `top`, `top-right`, `left`, `center`, `right`, `bottom-left`, `bottom`, `bottom-right`. |
| `watermark.size` | `enum` | required | How large, against the picture fitted into a 16:9 frame: its height, or its width × 9/16 when it's wider. One of `small`, `medium`, `large`. |
| `watermark.opacity` | `integer` | required | How opaque, in percent. 20 to 100. |
| `watermark.tone` | `enum` | required | Light text with a dark shadow, or dark text with a light one. One of `light`, `dark`. |
| `embedStyle` | `object` |  | The style your links' previews follow: a built-in as it is, or with your own choices and (from Silver) your own words and site line. Your choices are kept as a style of your own; the built-in's again, and its own style is what your links follow. |
| `embedStyle.basedOn` | `enum` | required | The built-in it starts from, whose words the card says where it has none of its own. One of `hematite`, `minimal`, `detailed`, `gamer`, `photo-mode`, `quiet`. |
| `embedStyle.author` | `enum` | required | Who the card names over its title, in Discord through oEmbed: `Uploader` (the uploader, or a folder's owner) or `None`. Hiding yourself as an image's uploader, or hiding your page, names nobody whatever the style says. One of `Uploader`, `None`. |
| `embedStyle.picture` | `enum` | required | How the card shows its picture: `Large` under the words, `Small` beside them (square), `Alone` (Discord shows only the picture; elsewhere the large card), `None`. An image marked NSFW or shielded shows none whatever the style says. One of `Large`, `Small`, `Alone`, `None`. |
| `embedStyle.cropToCard` | `boolean` | required | With a large picture: cropped to 1.91 : 1, the shape X, Facebook, LinkedIn and WhatsApp draw, round its busiest part. |
| `embedStyle.colour` | `enum` | required | The colour of Discord's bar, the only platform that shows one: `Hematite` (the accent's ice steel), `Picture` (the picture's own, made light enough to read on Discord's grey) or `Custom` (`colourHex`). One of `Hematite`, `Picture`, `Custom`. |
| `embedStyle.colourHex` | `string \| null` | required | Your own colour: `#` and six hex digits. Needed with `Custom`; kept otherwise, so choosing `Custom` again finds it. |
| `embedStyle.showTime` | `boolean` | required | When it was uploaded, under the card in each reader's own time (Discord). |
| `embedStyle.motion` | `boolean` | required | An animated GIF or WebP moves in the card; off, it's its first frame. |
| `embedStyle.title` | `string \| null` |  | Its own title, a template (concept 11 §3: `{title\|"A screenshot"}`), at most 300 characters and one line; null or left out says the built-in's. From Silver. |
| `embedStyle.description` | `string \| null` |  | Its own description, a template, at most 600 characters, from Silver; `""` leaves it out of the card (every plan); null or left out says the built-in's. |
| `embedStyle.site` | `enum` |  | The site line over the title: `Hematite`, `Domain` (the domain your links go to, while it works) or `Custom` (`siteText`). Anything but `Hematite` from Silver. One of `Hematite`, `Domain`, `Custom`. |
| `embedStyle.siteText` | `string \| null` |  | Its own site name with `site` `Custom`, a template, at most 32 characters and one line, saying no service, brand or authority. Kept while another site line is chosen. |
| `embedStyleId` | `integer` |  | The style your links follow, as it is: a built-in's id or one of your own styles' (`GET /users/:userId/embed-styles`). `embedStyle` sets it with your own choices instead; send one of the two. |

### Response

Returns a [UserUploadSettings](https://hematite.gg/docs/developers/models/user-upload-settings).

Error `400`: A custom watermark needs its text.

Error `403`.

Error `404`: No such style of yours.

Error `409`.

Error `422`.

```bash
curl -X PATCH 'https://api.hematite.gg/v1/users/1/upload-settings' \
  -H "Authorization: $HEMATITE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"shareCodeMode":"Alphanumeric"}'
```

Example `data`:

```json
{
  "id": 1,
  "shareCodeMode": "Alphanumeric",
  "shareCodeLength": 8,
  "compressionQuality": 85,
  "visibility": "Unlisted",
  "watermarkMode": "None",
  "watermark": {
    "text": "string",
    "position": "top-left",
    "size": "small",
    "opacity": 0,
    "tone": "light"
  },
  "randomizeFilenames": false,
  "autoDeleteAfter": null,
  "shareUrlType": "Domain",
  "domainSubdomain": "string",
  "domainPath": "string",
  "embedStyleId": 1,
  "updatedAt": "2026-11-10T18:24:00.000Z",
  "embedStyle": {
    "id": 1,
    "key": "hematite",
    "name": "Ranked",
    "about": "string",
    "basedOn": "hematite",
    "version": 0,
    "author": "Uploader",
    "picture": "Large",
    "cropToCard": false,
    "colour": "Hematite",
    "colourHex": "string",
    "showTime": false,
    "motion": false,
    "title": "Clutch on Ascent",
    "description": "1v4 on the last round",
    "site": "Hematite",
    "siteText": "string"
  }
}
```

## Get your username history: each change from an old username to a new one, and when. Anyone else's is an empty list; their current username is on the user.

`GET /users/:userId/usernames`

Needs a session token. Rate limit: 120 a minute, per address. An app's token or an API key needs the `users:read` scope.

### Path parameters

| Field | Type | Required | Notes |
|---|---|---|---|
| `userId` | `any` | required | The user's id. |

### Response

Returns a list of [Usernames](https://hematite.gg/docs/developers/models/username).

```bash
curl 'https://api.hematite.gg/v1/users/1/usernames' \
  -H "Authorization: $HEMATITE_TOKEN"
```

Example `data`:

```json
[
  {
    "id": 1,
    "userId": 1,
    "oldUsername": "stella",
    "newUsername": "nova",
    "createdAt": "2026-11-10T18:24:00.000Z"
  }
]
```

## Get the signed-in user

`GET /users/@me`

Needs a session token. Rate limit: 120 a minute, per address. An app's token or an API key needs the `users:read` scope.

### Response

Returns a [User](https://hematite.gg/docs/developers/models/user).

```bash
curl 'https://api.hematite.gg/v1/users/@me' \
  -H "Authorization: $HEMATITE_TOKEN"
```

Example `data`:

```json
{
  "id": 1,
  "username": "nova",
  "email": "nova@example.com",
  "emailConfirmedAt": "2026-11-10T18:24:00.000Z",
  "createdAt": "2026-11-10T18:24:00.000Z",
  "updatedAt": "2026-11-10T18:24:00.000Z",
  "permissionGroupId": 1,
  "subscriptionGroupId": 1,
  "stripeSubscriptionId": "string",
  "domainId": 1,
  "avatarId": 1,
  "stripeCustomerId": "string",
  "inviteId": 1,
  "timeZone": "string",
  "avatar": {
    "key": "images/a1b2c3d4e5f6.png"
  },
  "badgeIds": [
    1
  ],
  "storageUsed": 2457600,
  "storageLimit": 1073741824,
  "imageCount": 1,
  "folderCount": 0,
  "publicImageCount": 0,
  "publicFolderCount": 0,
  "profile": {
    "bio": "Screenshots from ranked nights",
    "hideProfile": false,
    "activityVisibility": "All"
  }
}
```

## Get many users by IDs

`GET /users/bulk`

Needs a session token. Rate limit: 120 a minute, per address. An app's token or an API key needs the `users:read` scope.

### Query

| Field | Type | Required | Notes |
|---|---|---|---|
| `ids` | `number[]` | required | Ids of users. If any has no user, the request is refused. 1 to 20 items. No repeats. |
| `partial` | `boolean` |  | Default `false`. |

### Response

Returns a list, each a [User](https://hematite.gg/docs/developers/models/user), a [HiddenUser](https://hematite.gg/docs/developers/models/hidden-user) or a [PartialUser](https://hematite.gg/docs/developers/models/partial-user).

```bash
curl 'https://api.hematite.gg/v1/users/bulk?ids=1' \
  -H "Authorization: $HEMATITE_TOKEN"
```

Example `data`:

```json
[
  {
    "id": 1,
    "username": "nova",
    "email": "nova@example.com",
    "emailConfirmedAt": "2026-11-10T18:24:00.000Z",
    "createdAt": "2026-11-10T18:24:00.000Z",
    "updatedAt": "2026-11-10T18:24:00.000Z",
    "permissionGroupId": 1,
    "subscriptionGroupId": 1,
    "stripeSubscriptionId": "string",
    "domainId": 1,
    "avatarId": 1,
    "stripeCustomerId": "string",
    "inviteId": 1,
    "timeZone": "string",
    "avatar": {
      "key": "images/a1b2c3d4e5f6.png"
    },
    "badgeIds": [
      1
    ],
    "storageUsed": 2457600,
    "storageLimit": 1073741824,
    "imageCount": 1,
    "folderCount": 0,
    "publicImageCount": 0,
    "publicFolderCount": 0,
    "profile": {
      "bio": "Screenshots from ranked nights",
      "hideProfile": false,
      "activityVisibility": "All"
    }
  }
]
```

## Check if a username is available

`POST /users/check-username`

Needs no token. Rate limit: 120 a minute, per address. An app's token or an API key needs the `users:read` scope.

### Body

| Field | Type | Required | Notes |
|---|---|---|---|
| `username` | `string` | required | The username to check. 3 to 64 characters. Matches ^[a-zA-Z0-9_]+$. |

### Response

Returns an `object` with these fields:

| Field | Type | Present | Notes |
|---|---|---|---|
| `available` | `boolean` |  | Whether the username is available. |
| `reason` | `enum \| null` |  | Why it isn't, or null when it is: `taken`, someone has it; `held`, its last owner gave it up less than 30 days ago and only they may take it back (they're told it's available); `kept`, hematite keeps it (its own pages, hosts and staff, payment and sign-in words, brands, offensive words), compared as it reads: case, look-alike letters, digits for letters and separators folded. One of `taken`, `held`, `kept`. |

```bash
curl -X POST 'https://api.hematite.gg/v1/users/check-username' \
  -H "Content-Type: application/json" \
  -d '{"username":"nova"}'
```

Example `data`:

```json
{
  "available": false,
  "reason": "taken"
}
```

## Search for users

`POST /users/search`

Needs a session token. Rate limit: 120 a minute, per address. An app's token or an API key needs the `users:read` scope. Apps can't filter by: `email`.

### Body

| Field | Type | Required | Notes |
|---|---|---|---|
| `limit` | `integer` |  | Default `100`. More than 0. |
| `offset` | `integer` |  | Default `0`. At least 0. |
| `query` | `object` |  |  |
| `query.fields` | `enum[]` | required |  |
| `query.value` | `string` | required |  |
| `order` | `object` |  |  |
| `order.field` | `enum` | required | One of `id`, `createdAt`, `username`, `badges`. |
| `order.direction` | `enum` | required | One of `asc`, `desc`. |
| `filter` | `object[]` |  |  |
| `filter.field` | `enum` | required | One of `id`, `createdAt`, `username`, `bio`, `badges`, `hideProfile`. |
| `filter.operator` | `enum` | required | One of `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `contains`, `notContains`, `startsWith`, `endsWith`. |
| `filter.value` | `string` | required |  |
| `partial` | `boolean` |  | Default `false`. |

### Response

Returns an `object` with these fields:

| Field | Type | Present | Notes |
|---|---|---|---|
| `results` | ([`User`](https://hematite.gg/docs/developers/models/user), [`HiddenUser`](https://hematite.gg/docs/developers/models/hidden-user) or [`PartialUser`](https://hematite.gg/docs/developers/models/partial-user))[] |  |  |
| `total` | `integer` |  |  |

```bash
curl -X POST 'https://api.hematite.gg/v1/users/search' \
  -H "Authorization: $HEMATITE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"limit":100}'
```

Example `data`:

```json
{
  "results": [
    {
      "id": 1,
      "username": "nova",
      "email": "nova@example.com",
      "emailConfirmedAt": "2026-11-10T18:24:00.000Z",
      "createdAt": "2026-11-10T18:24:00.000Z",
      "updatedAt": "2026-11-10T18:24:00.000Z",
      "permissionGroupId": 1,
      "subscriptionGroupId": 1,
      "stripeSubscriptionId": "string",
      "domainId": 1,
      "avatarId": 1,
      "stripeCustomerId": "string",
      "inviteId": 1,
      "timeZone": "string",
      "avatar": {
        "key": "images/a1b2c3d4e5f6.png"
      },
      "badgeIds": [
        1
      ],
      "storageUsed": 2457600,
      "storageLimit": 1073741824,
      "imageCount": 1,
      "folderCount": 0,
      "publicImageCount": 0,
      "publicFolderCount": 0,
      "profile": {
        "bio": "Screenshots from ranked nights",
        "hideProfile": false,
        "activityVisibility": "All"
      }
    }
  ],
  "total": 0
}
```
