# Asset Admin

**Summary:** Endpoints for Asset Admin

- Role: [Developers](https://www.subrite.no/developers)
- Source: https://www.subrite.no/developers/asset-admin
- Updated: 2026-10-13
- Markdown index: https://www.subrite.no/developers/llms.txt

<a id="get-api-v1-asset-admin-folders"></a>
## List folders with counts and tenant-wide usage totals

`GET /api/v1/asset-admin/folders`

**Authentication:** Bearer token (JWT)

### Responses

#### 200

Content type: `application/json` · `FolderListResponseDto`

| Name | Type | Description |
| --- | --- | --- |
| `folders` (Required) | `array of AssetFolderResponseDto` |   |
| `folders[].id` (Required when parent is present) | `number` |   |
| `folders[].name` (Required when parent is present) | `string` |   |
| `folders[].slug` (Required when parent is present) | `string` |   |
| `folders[].fileCount` (Required when parent is present) | `number` | Number of ready files in this folder. |
| `folders[].createdAt` (Required when parent is present) | `string (date-time)` |   |
| `totalFileCount` (Required) | `number` | Total ready files across the tenant, including root-level files. |
| `totalSizeBytes` (Required) | `number` | Total bytes used across the tenant (SUM of ready file sizes). |
| `cdnDomain` (Required) | `string` | Public CDN domain assets are served from (for display). |
| `cdnBasePath` (Required) | `string` | Tenant-scoped public URL prefix (https://{domain}/{tenantId}). A file URL is this + /{folderSlug}/{fileName}; used for the live path preview in the UI. |

#### 401

unauthorized

### Example request

```bash
curl https://api.subrite.no/api/v1/asset-admin/folders \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
{
  "folders": [
    {}
  ],
  "totalFileCount": 0,
  "totalSizeBytes": 0,
  "cdnDomain": "string",
  "cdnBasePath": "string"
}
```

<a id="post-api-v1-asset-admin-folders"></a>
## Create a folder

`POST /api/v1/asset-admin/folders`

**Authentication:** Bearer token (JWT)

### Request body

Content type: `application/json` · Required · `CreateAssetFolderDto`

| Name | Type | Description |
| --- | --- | --- |
| `name` (Required) | `string` | Folder display name. · `maxLength`: `64` |

**Example request body**

`application/json`

```json
{
  "name": "string"
}
```

### Responses

#### 200

Content type: `application/json` · `AssetFolderResponseDto`

| Name | Type | Description |
| --- | --- | --- |
| `id` (Required) | `number` |   |
| `name` (Required) | `string` |   |
| `slug` (Required) | `string` |   |
| `fileCount` (Required) | `number` | Number of ready files in this folder. |
| `createdAt` (Required) | `string (date-time)` |   |

#### 201

Content type: `application/json` · `AssetFolderResponseDto`

Same fields as [Create a folder (200)](https://www.subrite.no/developers/asset-admin?md=true#post-api-v1-asset-admin-folders).

#### 400

Content type: `application/json` · `ErrorResponse`

assetFolderNameInvalid

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` | Allowed values: `"assetFolderNameInvalid"` |
| `message` | `string` |   |
| `errors` (Required) | `array of FieldError` |   |
| `errors[].field` (Required when parent is present) | `string` |   |
| `errors[].fieldValue` (Required when parent is present) | `string` |   |
| `errors[].identifier` (Required when parent is present) | `string` |   |
| `errors[].identifierValue` (Required when parent is present) | `string` |   |
| `errors[].messageCode` (Required when parent is present) | `string` |   |
| `errors[].message` | `string` |   |
| `errors[].errorType` (Required when parent is present) | `string` |   |

**Example response**

`application/json`

```json
{
  "messageCode": "assetFolderNameInvalid",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 401

unauthorized

#### 409

Content type: `application/json` · `ErrorResponse`

assetFolderNameConflict, assetFolderLimitReached, assetFolderDeleteInProgress

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` | Allowed values: `"assetFolderNameConflict"`, `"assetFolderLimitReached"`, `"assetFolderDeleteInProgress"` |
| `message` | `string` |   |
| `errors` (Required) | `array of FieldError` |   |
| `errors[].field` (Required when parent is present) | `string` |   |
| `errors[].fieldValue` (Required when parent is present) | `string` |   |
| `errors[].identifier` (Required when parent is present) | `string` |   |
| `errors[].identifierValue` (Required when parent is present) | `string` |   |
| `errors[].messageCode` (Required when parent is present) | `string` |   |
| `errors[].message` | `string` |   |
| `errors[].errorType` (Required when parent is present) | `string` |   |

**Example response**

`application/json`

```json
{
  "messageCode": "assetFolderNameConflict",
  "message": "string",
  "errors": [
    {}
  ]
}
```

### Example request

```bash
curl https://api.subrite.no/api/v1/asset-admin/folders \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "string"
}'
```

### Example response

200 · `application/json`

```json
{
  "id": 0,
  "name": "string",
  "slug": "string",
  "fileCount": 0,
  "createdAt": "2019-08-24T14:15:22Z"
}
```

<a id="delete-api-v1-asset-admin-folders-id"></a>
## Delete a folder and every file it contains (hard delete)

`DELETE /api/v1/asset-admin/folders/{id}`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (Required) | path | `number` |   |

### Responses

#### 200

Content type: `application/json` · `DeleteResultDto`

| Name | Type | Description |
| --- | --- | --- |
| `success` (Required) | `boolean` | Always true when the delete completed; failures are thrown instead. |
| `id` (Required) | `number` | Id of the deleted folder/asset. |

#### 401

unauthorized

#### 404

Content type: `application/json` · `ErrorResponse`

assetFolderNotFound

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` | Allowed values: `"assetFolderNotFound"` |
| `message` | `string` |   |
| `errors` (Required) | `array of FieldError` |   |
| `errors[].field` (Required when parent is present) | `string` |   |
| `errors[].fieldValue` (Required when parent is present) | `string` |   |
| `errors[].identifier` (Required when parent is present) | `string` |   |
| `errors[].identifierValue` (Required when parent is present) | `string` |   |
| `errors[].messageCode` (Required when parent is present) | `string` |   |
| `errors[].message` | `string` |   |
| `errors[].errorType` (Required when parent is present) | `string` |   |

**Example response**

`application/json`

```json
{
  "messageCode": "assetFolderNotFound",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 409

Content type: `application/json` · `ErrorResponse`

assetFolderRenameInProgress

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` | Allowed values: `"assetFolderRenameInProgress"` |
| `message` | `string` |   |
| `errors` (Required) | `array of FieldError` |   |
| `errors[].field` (Required when parent is present) | `string` |   |
| `errors[].fieldValue` (Required when parent is present) | `string` |   |
| `errors[].identifier` (Required when parent is present) | `string` |   |
| `errors[].identifierValue` (Required when parent is present) | `string` |   |
| `errors[].messageCode` (Required when parent is present) | `string` |   |
| `errors[].message` | `string` |   |
| `errors[].errorType` (Required when parent is present) | `string` |   |

**Example response**

`application/json`

```json
{
  "messageCode": "assetFolderRenameInProgress",
  "message": "string",
  "errors": [
    {}
  ]
}
```

### Example request

```bash
curl 'https://api.subrite.no/api/v1/asset-admin/folders/{id}' \
  --request DELETE \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
{
  "success": true,
  "id": 0
}
```

<a id="patch-api-v1-asset-admin-folders-id"></a>
## Rename a folder (re-slugs it and moves child objects; their URLs change)

`PATCH /api/v1/asset-admin/folders/{id}`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (Required) | path | `number` |   |

### Request body

Content type: `application/json` · Required · `UpdateAssetFolderDto`

| Name | Type | Description |
| --- | --- | --- |
| `name` (Required) | `string` | New folder display name. · `maxLength`: `64` |

**Example request body**

`application/json`

```json
{
  "name": "string"
}
```

### Responses

#### 200

Content type: `application/json` · `AssetFolderResponseDto`

Same fields as [Create a folder (200)](https://www.subrite.no/developers/asset-admin?md=true#post-api-v1-asset-admin-folders).

#### 400

Content type: `application/json` · `ErrorResponse`

assetFolderNameInvalid

Same fields as [Create a folder (400)](https://www.subrite.no/developers/asset-admin?md=true#post-api-v1-asset-admin-folders).

**Example response**

`application/json`

```json
{
  "messageCode": "assetFolderNameInvalid",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 401

unauthorized

#### 404

Content type: `application/json` · `ErrorResponse`

assetFolderNotFound

Same fields as [Delete a folder and every file it contains (hard delete) (404)](https://www.subrite.no/developers/asset-admin?md=true#delete-api-v1-asset-admin-folders-id).

**Example response**

`application/json`

```json
{
  "messageCode": "assetFolderNotFound",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 409

Content type: `application/json` · `ErrorResponse`

assetFolderNameConflict, assetFolderDeleteInProgress, assetFolderRenameInProgress

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` | Allowed values: `"assetFolderNameConflict"`, `"assetFolderDeleteInProgress"`, `"assetFolderRenameInProgress"` |
| `message` | `string` |   |
| `errors` (Required) | `array of FieldError` |   |
| `errors[].field` (Required when parent is present) | `string` |   |
| `errors[].fieldValue` (Required when parent is present) | `string` |   |
| `errors[].identifier` (Required when parent is present) | `string` |   |
| `errors[].identifierValue` (Required when parent is present) | `string` |   |
| `errors[].messageCode` (Required when parent is present) | `string` |   |
| `errors[].message` | `string` |   |
| `errors[].errorType` (Required when parent is present) | `string` |   |

**Example response**

`application/json`

```json
{
  "messageCode": "assetFolderNameConflict",
  "message": "string",
  "errors": [
    {}
  ]
}
```

### Example request

```bash
curl 'https://api.subrite.no/api/v1/asset-admin/folders/{id}' \
  --request PATCH \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "string"
}'
```

### Example response

200 · `application/json`

```json
{
  "id": 0,
  "name": "string",
  "slug": "string",
  "fileCount": 0,
  "createdAt": "2019-08-24T14:15:22Z"
}
```

<a id="get-api-v1-asset-admin-assets"></a>
## List/search/sort assets (paginated, spans the whole tenant set)

`GET /api/v1/asset-admin/assets`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `page` | query | `number` | Default: `1` · `minimum`: `1` |
| `take` | query | `number` | Default: `24` · `minimum`: `1`, `maximum`: `50` |
| `folderId` | query | `number` | Folder to list. Omit for "All files"; pass 0 or "root" for root-level files. · `minimum`: `0` |
| `kinds` | query | `array of AssetKind` | Restrict the list to these kinds. Accepts a repeated param or a comma-separated value. · Allowed values: `"image"`, `"svg"`, `"pdf"`, `"video"`, `"audio"`, `"font"`, `"doc"` |
| `search` | query | `string` | Case-insensitive search on the display name or URL-safe name. |
| `sort` | query | `string` | Allowed values: `"name"`, `"type"`, `"size"`, `"uploaded"` · Default: `"uploaded"` |
| `order` | query | `string` | Allowed values: `"asc"`, `"desc"` · Default: `"desc"` |

### Responses

#### 200

Content type: `application/json` · `AssetResponseDtoPaginated`

| Name | Type | Description |
| --- | --- | --- |
| `items` (Required) | `array of AssetResponseDto` |   |
| `items[].id` (Required when parent is present) | `number` |   |
| `items[].folderId` (Required when parent is present) | `number` | Can be null |
| `items[].title` (Required when parent is present) | `string` | Human display name (shown in the UI). |
| `items[].name` (Required when parent is present) | `string` | URL-safe file name — the last segment of the public path. |
| `items[].url` (Required when parent is present) | `string` | Public CDN URL, derived from tenant + folder slug + name. |
| `items[].kind` (Required when parent is present) | `string` | Allowed values: `"image"`, `"svg"`, `"pdf"`, `"video"`, `"audio"`, `"font"`, `"doc"` |
| `items[].mimeType` (Required when parent is present) | `string` |   |
| `items[].sizeBytes` (Required when parent is present) | `number` | File size in bytes. |
| `items[].width` (Required when parent is present) | `number` | Can be null |
| `items[].height` (Required when parent is present) | `number` | Can be null |
| `items[].altText` (Required when parent is present) | `string` | Can be null |
| `items[].createdAt` (Required when parent is present) | `string (date-time)` |   |
| `meta` (Required) | `PageMeta` |   |
| `meta.page` (Required) | `number` |   |
| `meta.take` (Required) | `number` |   |
| `meta.count` (Required) | `number` |   |
| `meta.pageCount` (Required) | `number` |   |
| `meta.hasPreviousPage` (Required) | `boolean` |   |
| `meta.hasNextPage` (Required) | `boolean` |   |

#### 400

Content type: `application/json` · `ErrorResponse`

badRequest

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` | Allowed values: `"badRequest"` |
| `message` | `string` |   |
| `errors` (Required) | `array of FieldError` |   |
| `errors[].field` (Required when parent is present) | `string` |   |
| `errors[].fieldValue` (Required when parent is present) | `string` |   |
| `errors[].identifier` (Required when parent is present) | `string` |   |
| `errors[].identifierValue` (Required when parent is present) | `string` |   |
| `errors[].messageCode` (Required when parent is present) | `string` |   |
| `errors[].message` | `string` |   |
| `errors[].errorType` (Required when parent is present) | `string` |   |

**Example response**

`application/json`

```json
{
  "messageCode": "badRequest",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 401

unauthorized

### Example request

```bash
curl https://api.subrite.no/api/v1/asset-admin/assets \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
{
  "items": [
    {}
  ],
  "meta": {
    "page": 0,
    "take": 0,
    "count": 0,
    "pageCount": 0,
    "hasPreviousPage": true,
    "hasNextPage": true
  }
}
```

<a id="post-api-v1-asset-admin-assets"></a>
## Upload one or more files

`POST /api/v1/asset-admin/assets`

**Authentication:** Bearer token (JWT)

### Request body

Content type: `multipart/form-data` · Required · `UploadAssetsDto`

| Name | Type | Description |
| --- | --- | --- |
| `folderId` | `number` | Destination folder id. Omit (or leave empty) to upload to the root. · `minimum`: `0` |

### Responses

#### 200

Content type: `application/json` · `UploadResultDto`

| Name | Type | Description |
| --- | --- | --- |
| `results` (Required) | `array of UploadResultItemDto` |   |
| `results[].fileName` (Required when parent is present) | `string` | Original filename from the request. |
| `results[].success` (Required when parent is present) | `boolean` |   |
| `results[].asset` (Required when parent is present) | `AssetResponseDto` | Can be null |
| `results[].asset.id` (Required when parent is present) | `number` |   |
| `results[].asset.folderId` (Required when parent is present) | `number` | Can be null |
| `results[].asset.title` (Required when parent is present) | `string` | Human display name (shown in the UI). |
| `results[].asset.name` (Required when parent is present) | `string` | URL-safe file name — the last segment of the public path. |
| `results[].asset.url` (Required when parent is present) | `string` | Public CDN URL, derived from tenant + folder slug + name. |
| `results[].asset.kind` (Required when parent is present) | `string` | Allowed values: `"image"`, `"svg"`, `"pdf"`, `"video"`, `"audio"`, `"font"`, `"doc"` |
| `results[].asset.mimeType` (Required when parent is present) | `string` |   |
| `results[].asset.sizeBytes` (Required when parent is present) | `number` | File size in bytes. |
| `results[].asset.width` (Required when parent is present) | `number` | Can be null |
| `results[].asset.height` (Required when parent is present) | `number` | Can be null |
| `results[].asset.altText` (Required when parent is present) | `string` | Can be null |
| `results[].asset.createdAt` (Required when parent is present) | `string (date-time)` |   |
| `results[].error` (Required when parent is present) | `string` | Error message when success is false. · Can be null |

#### 401

unauthorized

#### 404

Content type: `application/json` · `ErrorResponse`

assetFolderNotFound

Same fields as [Delete a folder and every file it contains (hard delete) (404)](https://www.subrite.no/developers/asset-admin?md=true#delete-api-v1-asset-admin-folders-id).

**Example response**

`application/json`

```json
{
  "messageCode": "assetFolderNotFound",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 409

Content type: `application/json` · `ErrorResponse`

assetFolderRenameInProgress

Same fields as [Delete a folder and every file it contains (hard delete) (409)](https://www.subrite.no/developers/asset-admin?md=true#delete-api-v1-asset-admin-folders-id).

**Example response**

`application/json`

```json
{
  "messageCode": "assetFolderRenameInProgress",
  "message": "string",
  "errors": [
    {}
  ]
}
```

### Example request

```bash
curl https://api.subrite.no/api/v1/asset-admin/assets \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --form 'folderId=0'
```

### Example response

200 · `application/json`

```json
{
  "results": [
    {}
  ]
}
```

<a id="get-api-v1-asset-admin-assets-id"></a>
## Get a single asset (preview modal data)

`GET /api/v1/asset-admin/assets/{id}`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (Required) | path | `number` |   |

### Responses

#### 200

Content type: `application/json` · `AssetResponseDto`

| Name | Type | Description |
| --- | --- | --- |
| `id` (Required) | `number` |   |
| `folderId` (Required) | `number` | Can be null |
| `title` (Required) | `string` | Human display name (shown in the UI). |
| `name` (Required) | `string` | URL-safe file name — the last segment of the public path. |
| `url` (Required) | `string` | Public CDN URL, derived from tenant + folder slug + name. |
| `kind` (Required) | `string` | Allowed values: `"image"`, `"svg"`, `"pdf"`, `"video"`, `"audio"`, `"font"`, `"doc"` |
| `mimeType` (Required) | `string` |   |
| `sizeBytes` (Required) | `number` | File size in bytes. |
| `width` (Required) | `number` | Can be null |
| `height` (Required) | `number` | Can be null |
| `altText` (Required) | `string` | Can be null |
| `createdAt` (Required) | `string (date-time)` |   |

#### 401

unauthorized

#### 404

Content type: `application/json` · `ErrorResponse`

assetFileNotFound

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` | Allowed values: `"assetFileNotFound"` |
| `message` | `string` |   |
| `errors` (Required) | `array of FieldError` |   |
| `errors[].field` (Required when parent is present) | `string` |   |
| `errors[].fieldValue` (Required when parent is present) | `string` |   |
| `errors[].identifier` (Required when parent is present) | `string` |   |
| `errors[].identifierValue` (Required when parent is present) | `string` |   |
| `errors[].messageCode` (Required when parent is present) | `string` |   |
| `errors[].message` | `string` |   |
| `errors[].errorType` (Required when parent is present) | `string` |   |

**Example response**

`application/json`

```json
{
  "messageCode": "assetFileNotFound",
  "message": "string",
  "errors": [
    {}
  ]
}
```

### Example request

```bash
curl 'https://api.subrite.no/api/v1/asset-admin/assets/{id}' \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
{
  "id": 0,
  "folderId": 0,
  "title": "string",
  "name": "string",
  "url": "string",
  "kind": "image",
  "mimeType": "string",
  "sizeBytes": 0,
  "width": 0,
  "height": 0,
  "altText": "string",
  "createdAt": "2019-08-24T14:15:22Z"
}
```

<a id="delete-api-v1-asset-admin-assets-id"></a>
## Delete an asset (hard delete — the R2 object and the row are both removed)

`DELETE /api/v1/asset-admin/assets/{id}`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (Required) | path | `number` |   |

### Responses

#### 200

Content type: `application/json` · `DeleteResultDto`

Same fields as [Delete a folder and every file it contains (hard delete) (200)](https://www.subrite.no/developers/asset-admin?md=true#delete-api-v1-asset-admin-folders-id).

#### 401

unauthorized

#### 404

Content type: `application/json` · `ErrorResponse`

assetFileNotFound

Same fields as [Get a single asset (preview modal data) (404)](https://www.subrite.no/developers/asset-admin?md=true#get-api-v1-asset-admin-assets-id).

**Example response**

`application/json`

```json
{
  "messageCode": "assetFileNotFound",
  "message": "string",
  "errors": [
    {}
  ]
}
```

### Example request

```bash
curl 'https://api.subrite.no/api/v1/asset-admin/assets/{id}' \
  --request DELETE \
  --header 'Authorization: Bearer <token>'
```

### Example response

200 · `application/json`

```json
{
  "success": true,
  "id": 0
}
```

<a id="patch-api-v1-asset-admin-assets-id"></a>
## Rename (rewrites the object key/URL), move, or edit title/altText of an asset

`PATCH /api/v1/asset-admin/assets/{id}`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (Required) | path | `number` |   |

### Request body

Content type: `application/json` · Required · `UpdateAssetDto`

| Name | Type | Description |
| --- | --- | --- |
| `title` | `string` | New display title (incl. extension). The URL-safe file name is re-derived from it, so the public path changes to match. · `maxLength`: `255` |
| `folderId` | `number` | Destination folder id, or null to move to the root. Omit to leave the folder unchanged. · `minimum`: `0` · Can be null |
| `altText` | `string` | Image alt text (accessibility/SEO). · `maxLength`: `500` |

**Example request body**

`application/json`

```json
{
  "title": "string",
  "folderId": 0,
  "altText": "string"
}
```

### Responses

#### 200

Content type: `application/json` · `AssetResponseDto`

Same fields as [Get a single asset (preview modal data) (200)](https://www.subrite.no/developers/asset-admin?md=true#get-api-v1-asset-admin-assets-id).

#### 401

unauthorized

#### 404

Content type: `application/json` · `ErrorResponse`

assetFileNotFound, assetFolderNotFound

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` | Allowed values: `"assetFileNotFound"`, `"assetFolderNotFound"` |
| `message` | `string` |   |
| `errors` (Required) | `array of FieldError` |   |
| `errors[].field` (Required when parent is present) | `string` |   |
| `errors[].fieldValue` (Required when parent is present) | `string` |   |
| `errors[].identifier` (Required when parent is present) | `string` |   |
| `errors[].identifierValue` (Required when parent is present) | `string` |   |
| `errors[].messageCode` (Required when parent is present) | `string` |   |
| `errors[].message` | `string` |   |
| `errors[].errorType` (Required when parent is present) | `string` |   |

**Example response**

`application/json`

```json
{
  "messageCode": "assetFileNotFound",
  "message": "string",
  "errors": [
    {}
  ]
}
```

#### 409

Content type: `application/json` · `ErrorResponse`

assetFileNameConflict, assetFolderRenameInProgress

| Name | Type | Description |
| --- | --- | --- |
| `messageCode` (Required) | `string` | Allowed values: `"assetFileNameConflict"`, `"assetFolderRenameInProgress"` |
| `message` | `string` |   |
| `errors` (Required) | `array of FieldError` |   |
| `errors[].field` (Required when parent is present) | `string` |   |
| `errors[].fieldValue` (Required when parent is present) | `string` |   |
| `errors[].identifier` (Required when parent is present) | `string` |   |
| `errors[].identifierValue` (Required when parent is present) | `string` |   |
| `errors[].messageCode` (Required when parent is present) | `string` |   |
| `errors[].message` | `string` |   |
| `errors[].errorType` (Required when parent is present) | `string` |   |

**Example response**

`application/json`

```json
{
  "messageCode": "assetFileNameConflict",
  "message": "string",
  "errors": [
    {}
  ]
}
```

### Example request

```bash
curl 'https://api.subrite.no/api/v1/asset-admin/assets/{id}' \
  --request PATCH \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "title": "string",
  "folderId": 0,
  "altText": "string"
}'
```

### Example response

200 · `application/json`

```json
{
  "id": 0,
  "folderId": 0,
  "title": "string",
  "name": "string",
  "url": "string",
  "kind": "image",
  "mimeType": "string",
  "sizeBytes": 0,
  "width": 0,
  "height": 0,
  "altText": "string",
  "createdAt": "2019-08-24T14:15:22Z"
}
```

<a id="get-api-v1-asset-admin-assets-id-download"></a>
## Download an asset — streams the R2 object with Content-Disposition: attachment

`GET /api/v1/asset-admin/assets/{id}/download`

**Authentication:** Bearer token (JWT)

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (Required) | path | `number` |   |

### Responses

#### 200

The file bytes, sent as an attachment.

#### 401

unauthorized

#### 404

Content type: `application/json` · `ErrorResponse`

assetFileNotFound

Same fields as [Get a single asset (preview modal data) (404)](https://www.subrite.no/developers/asset-admin?md=true#get-api-v1-asset-admin-assets-id).

**Example response**

`application/json`

```json
{
  "messageCode": "assetFileNotFound",
  "message": "string",
  "errors": [
    {}
  ]
}
```

### Example request

```bash
curl 'https://api.subrite.no/api/v1/asset-admin/assets/{id}/download' \
  --header 'Authorization: Bearer <token>'
```
