# Image model

An uploaded image, with where its file is stored, its share code, and its like and comment counts.

## Fields

| Field | Type | Present | Notes |
|---|---|---|---|
| `id` | `integer` |  |  |
| `userId` | `integer` |  |  |
| `createdAt` | `date-time` |  |  |
| `updatedAt` | `date-time` |  |  |
| `title` | `string` |  |  |
| `description` | `string` |  |  |
| `visibility` | `enum` |  | One of `Unlisted`, `Public`, `Private`. |
| `folderId` | `integer \| null` |  |  |
| `views` | `integer` |  |  |
| `downloads` | `integer` |  |  |
| `favorite` | `boolean` |  |  |
| `application` | `string \| null` |  |  |
| `filename` | `string` |  |  |
| `size` | `number` |  |  |
| `width` | `integer` |  |  |
| `height` | `integer` |  |  |
| `nsfw` | `boolean` |  |  |
| `storageId` | `integer` |  |  |
| `autoDeleteAt` | `date-time \| null` |  |  |
| `hideUser` | `boolean` |  |  |
| `shield` | `boolean` |  |  |
| `nsfwLockedAt` | `date-time \| null` |  |  |
| `privateLockedAt` | `date-time \| null` |  |  |
| `offlineAt` | `date-time \| null` |  |  |
| `storage` | `object` |  |  |
| `storage.key` | `string` |  |  |
| `shareId` | `number` |  |  |
| `shareCode` | `string` |  |  |
| `likeCount` | `number` |  |  |
| `commentCount` | `number` |  |  |
| `meta` | `object \| null` | optional |  |
| `meta.id` | `number` |  |  |
| `meta.blurHash` | `string \| null` |  |  |
| `meta.dominantColor` | `string \| null` |  | The colour the picture has most of: `#` and six hex digits, lowercase. Null until it's worked out, just after the upload, or when it can't be. |
| `meta.palette` | `any \| null` |  |  |
| `meta.hasAlpha` | `boolean \| null` |  |  |
| `meta.animated` | `boolean \| null` |  |  |
| `meta.orientation` | `number \| null` |  |  |
| `treatment` | `string \| null` |  | How the picture is served where others see it: its owner's watermark, as a token for the cdn's `t` parameter (`image.url()` in the sdk adds it). Null when nothing is drawn on it. Without it the cdn serves the picture as it's stored. |
| `burn` | `object \| null` |  | Burn's limits, on a shielded image (`shield`); null without them. |
| `burn.secondsPerView` | `number \| null` |  | The seconds each view shows the picture; null for no limit. |
| `burn.viewsEach` | `number \| null` |  | The views each person gets (signed in by account, a guest by browser); null for no limit. |
| `burn.viewsInAll` | `number \| null` |  | The views it has in all, by anyone but its owner; null for no limit. |
| `burn.then` | `enum` |  | What happens once the views in all are used: Blur (burned for everyone but its owner), Private, or Delete (gone for everyone but its owner). One of `Blur`, `Private`, `Delete`. |
| `burn.viewsUsed` | `number` | optional | The views in all used so far. Only its owner gets it. |
| `burn.burnedAt` | `string \| null` | optional | When its last view in all was given; null until then. Only its owner gets it. |

## Returned by

The endpoints whose `data` holds an Image as it is, and where.

- [`GET /folders/:folderId/content`](https://hematite.gg/docs/developers/reference/folders#get-folders-folderid-content), in `data[]`
- [`GET /images/:imageId`](https://hematite.gg/docs/developers/reference/images#get-images-imageid), in `data`
- [`PATCH /images/:imageId`](https://hematite.gg/docs/developers/reference/images#patch-images-imageid), in `data`
- [`POST /images/:imageId/regenerate-share-identifiers`](https://hematite.gg/docs/developers/reference/images#post-images-imageid-regenerate-share-identifiers), in `data`
- [`PATCH /images/bulk`](https://hematite.gg/docs/developers/reference/images#patch-images-bulk), in `data[]`
- [`GET /users/:userId/images`](https://hematite.gg/docs/developers/reference/users#get-users-userid-images), in `data[]`
- [`GET /users/:userId/images/discovery`](https://hematite.gg/docs/developers/reference/users#get-users-userid-images-discovery), in `data[]`
- [`POST /users/:userId/images/search`](https://hematite.gg/docs/developers/reference/users#post-users-userid-images-search), in `data.results[]`
- [`GET /users/:userId/showcase`](https://hematite.gg/docs/developers/reference/users#get-users-userid-showcase), in `data[]`
- [`PUT /users/:userId/showcase`](https://hematite.gg/docs/developers/reference/users#put-users-userid-showcase), in `data[]`

## Extended by

The endpoints that return an Image with fields of their own, and the fields they add.

- [`POST /images`](https://hematite.gg/docs/developers/reference/images#post-images) adds `shareUrl`, `deleteUrl`

## Inside other models

- [`Share`](https://hematite.gg/docs/developers/models/share), as `reference`

## Example

```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"
  }
}
```
