Hoppa till innehållet

Mediabibliotek

A channel's media library: the uploaded images and the editorial metadata around them. Files are uploaded as multipart/form-data and addressed by their id — unlike the rest of this API, because a file has no other stable, unique name; two uploads may legitimately be called hero.jpg. The url in the response is what goes into a page section or an article's featuredImageUrl; the file itself is served by the CDN and needs no API key.

5 anrop GET POST PATCH DELETE Bas-URL https://api.fluit.cloud/preview

Autentisering, felkoder, rate limits, idempotens och paginering gäller alla anrop och står samlade under Kom igång.

GET /channels/{channelCode}/media

List a channel's media library

Returns the images uploaded to the channel, newest first. Each entry carries the url the file is served on — that is what goes into a page section or an article's featured image — and the id used to address the record on this API.

Visa hela beskrivningen

Delta sync: ?modifiedSince= (ISO 8601 UTC datetime) returns records created or changed at or after that instant, and is the intended way to run an incremental sync. A change anywhere inside the record counts: editing a line moves the parent's modifiedDate too, so no change can hide below the resource level. Deletions are not visible here: a deleted record is really gone, so it simply stops appearing, which is indistinguishable from "unchanged". Poll GET /preview/deletions?deletedSince= alongside this endpoint to learn what was removed.

Sökvägsparametrar

Fält Typ Beskrivning
channelCode Krävs string Code of the channel whose media library to list.

Frågeparametrar

Fält Typ Beskrivning
folder enum Restricts to one folder: Hero, Banner, Sections or Content. Hero Banner Sections Content Documents
search string Matches file name, title and alt text, case-insensitively and on partial words.
modifiedSince string(date-time) Returns only records created or changed at or after this instant (ISO 8601 UTC datetime). A change anywhere inside the record counts, including on its lines.
page integer Page to return, 1-based. Default 1.
pageSize integer Number of records per page. Default 50, max 200.

Svar

200 PagedResult_PublicMediaAssetResponse

Paginerat svar: raderna nedan ligger i items[], omgivna av totalCount, page, pageSize, totalPages, hasPreviousPage och hasNextPage. Paginerad

Fält Typ Beskrivning
altText string · nullable Alt text for accessibility, or null if the editor has not written one.
caption string · nullable Caption, or null.
channelCode Krävs string · nullable The channel the file belongs to.
contentType Krävs string · nullable MIME type, e.g. `image/webp`.
createdDate Krävs string(date-time) When the file was uploaded (UTC).
fileName Krävs string · nullable The original file name it was uploaded under.
fileSize Krävs integer File size in bytes.
folder Krävs enum Where in the storefront a media file belongs. Filters the library, and decides the folder a <em>new</em> upload is stored under. Hero Banner Sections Content Documents
height integer · nullable Image height in pixels, or null when the dimensions were not read.
id Krävs string(uuid) The file's identifier in the library. Its address on this API.
links Links Hypermedia links for a public API resource. Exposed as a computed `links` property on the public response DTOs so that create and read responses carry the same self-reference — the canonical URL is derived from the business key already present on the DTO and can never drift from the route it points at.
modifiedDate string(date-time) · nullable When its metadata was last changed (UTC), or null if never changed.
title string · nullable Display name in the library, or null to fall back to the file name.
url Krävs string · nullable The public URL the file is served on. This is what a page section references.
width integer · nullable Image width in pixels, or null when the dimensions were not read.
400 ProblemDetails folder got a value outside its list.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
404 ProblemDetails No channel with that code.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl "https://api.fluit.cloud/preview/channels/{channelCode}/media"
Svar 200
{
  "hasNextPage": true,
  "hasPreviousPage": true,
  "items": [
    {
      "altText": "string",
      "caption": "string",
      "channelCode": "STD",
      "contentType": "image/jpeg",
      "createdDate": "2026-06-11T09:24:13.418",
      "fileName": "widget-a-front.jpg",
      "fileSize": 42,
      "folder": "Hero",
      "height": 42,
      "id": "0f8b2c1e-4d3a-4b7e-9f10-2a6c5d8e1b44",
      "links": {
        "self": "string"
      },
      "modifiedDate": "2026-06-11T09:24:13.418",
      "title": "string",
      "url": "https://cdn.fluit.cloud/assets/widget-a-front.jpg",
      "width": 42
    }
  ],
  "page": 1,
  "pageSize": 50,
  "totalCount": 137,
  "totalPages": 3
}

Bas-URL https://api.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

POST /channels/{channelCode}/media

Upload a file to the media library

Uploads a file as multipart/form-data. The field name is 'file'; everything else is a query parameter. Supported types: PNG, JPEG, GIF, WebP and SVG (max 10 MB), MP4 and WebM (max 50 MB), and PDF (max 20 MB).

Visa hela beskrivningen

The size limit is per type: a 10 MB image is nearly always the camera original by mistake, while a 40 MB product video is ordinary. folder decides which part of the storefront the file is filed under and defaults to Content; it only affects filing and filtering, not what the file can be used for. The response is the same representation as GET on the file: its url goes into a page section or an article's featuredImageUrl, its id addresses the record here. The file itself is served by the CDN and needs no API key. This POST takes no Idempotency-Key — a multipart body cannot be hashed the way a JSON one can — so a retry after a network failure may create a second copy; list the folder and compare, or delete the duplicate. Known error codes: ChannelMediaAsset.EmptyFile, ChannelMediaAsset.FileTooLarge, ChannelMediaAsset.UnsupportedType. **Not idempotent.** A file upload carries no Idempotency-Key: the body cannot be buffered and hashed the way a JSON request can. Retrying after a network failure may therefore create a second copy — list the folder and compare before retrying, or delete the duplicate afterwards.

media:write

Sökvägsparametrar

Fält Typ Beskrivning
channelCode Krävs string Code of the channel to upload into.

Frågeparametrar

Fält Typ Beskrivning
folder string Where the file belongs: Hero, Banner, Sections or Content. Defaults to Content.
title string Display name in the library. Defaults to the file name.
altText string Alt text for accessibility. Strongly recommended.
caption string Caption shown under the image.

Body

Fält Typ
file Krävs string(binary)

Svar

201 PublicMediaAssetResponse
  • Location — URL of the newly created resource.
Fält Typ Beskrivning
altText string · nullable Alt text for accessibility, or null if the editor has not written one.
caption string · nullable Caption, or null.
channelCode Krävs string · nullable The channel the file belongs to.
contentType Krävs string · nullable MIME type, e.g. `image/webp`.
createdDate Krävs string(date-time) When the file was uploaded (UTC).
fileName Krävs string · nullable The original file name it was uploaded under.
fileSize Krävs integer File size in bytes.
folder Krävs enum Where in the storefront a media file belongs. Filters the library, and decides the folder a <em>new</em> upload is stored under. Hero Banner Sections Content Documents
height integer · nullable Image height in pixels, or null when the dimensions were not read.
id Krävs string(uuid) The file's identifier in the library. Its address on this API.
links Links Hypermedia links for a public API resource. Exposed as a computed `links` property on the public response DTOs so that create and read responses carry the same self-reference — the canonical URL is derived from the business key already present on the DTO and can never drift from the route it points at.
modifiedDate string(date-time) · nullable When its metadata was last changed (UTC), or null if never changed.
title string · nullable Display name in the library, or null to fall back to the file name.
url Krävs string · nullable The public URL the file is served on. This is what a page section references.
width integer · nullable Image width in pixels, or null when the dimensions were not read.
400 ProblemDetails The file is empty, larger than the limit for its type, not one of the supported types, has no file name, folder got a value outside its list, or title, altText or caption is longer than allowed.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
404 ProblemDetails No channel with that code.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl -X POST "https://api.fluit.cloud/preview/channels/{channelCode}/media" \
  -H "Content-Type: application/json" \
  -d @body.json
Svar 201
{
  "altText": "string",
  "caption": "string",
  "channelCode": "STD",
  "contentType": "image/jpeg",
  "createdDate": "2026-06-11T09:24:13.418",
  "fileName": "widget-a-front.jpg",
  "fileSize": 42,
  "folder": "Hero",
  "height": 42,
  "id": "0f8b2c1e-4d3a-4b7e-9f10-2a6c5d8e1b44",
  "links": {
    "self": "string"
  },
  "modifiedDate": "2026-06-11T09:24:13.418",
  "title": "string",
  "url": "https://cdn.fluit.cloud/assets/widget-a-front.jpg",
  "width": 42
}

Bas-URL https://api.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

GET /channels/{channelCode}/media/{assetId}

Read one media file

Returns the library record for one file: the url it is served on plus its editorial metadata. This endpoint returns JSON, not the file itself — the bytes are fetched from url, which is served by the CDN and needs no API key. Responses carry a weak ETag; pass it back in If-None-Match to get 304 Not Modified while the record is unchanged.

media:read Stödjer ETag

Sökvägsparametrar

Fält Typ Beskrivning
channelCode Krävs string Code of the channel the file belongs to.
assetId Krävs string(uuid) The file's id, as returned by the upload and by the listing.

Svar

200 PublicMediaAssetResponse
  • ETag — Weak validator for this representation. Pass it back in If-None-Match to get 304 Not Modified while the record is unchanged.
Fält Typ Beskrivning
altText string · nullable Alt text for accessibility, or null if the editor has not written one.
caption string · nullable Caption, or null.
channelCode Krävs string · nullable The channel the file belongs to.
contentType Krävs string · nullable MIME type, e.g. `image/webp`.
createdDate Krävs string(date-time) When the file was uploaded (UTC).
fileName Krävs string · nullable The original file name it was uploaded under.
fileSize Krävs integer File size in bytes.
folder Krävs enum Where in the storefront a media file belongs. Filters the library, and decides the folder a <em>new</em> upload is stored under. Hero Banner Sections Content Documents
height integer · nullable Image height in pixels, or null when the dimensions were not read.
id Krävs string(uuid) The file's identifier in the library. Its address on this API.
links Links Hypermedia links for a public API resource. Exposed as a computed `links` property on the public response DTOs so that create and read responses carry the same self-reference — the canonical URL is derived from the business key already present on the DTO and can never drift from the route it points at.
modifiedDate string(date-time) · nullable When its metadata was last changed (UTC), or null if never changed.
title string · nullable Display name in the library, or null to fall back to the file name.
url Krävs string · nullable The public URL the file is served on. This is what a page section references.
width integer · nullable Image width in pixels, or null when the dimensions were not read.
304 Tom body.
  • ETag — Weak validator for this representation. Pass it back in If-None-Match to get 304 Not Modified while the record is unchanged.
404 ProblemDetails No channel with that code, or no file with that id in the channel.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl "https://api.fluit.cloud/preview/channels/{channelCode}/media/{assetId}"
Svar 200
{
  "altText": "string",
  "caption": "string",
  "channelCode": "STD",
  "contentType": "image/jpeg",
  "createdDate": "2026-06-11T09:24:13.418",
  "fileName": "widget-a-front.jpg",
  "fileSize": 42,
  "folder": "Hero",
  "height": 42,
  "id": "0f8b2c1e-4d3a-4b7e-9f10-2a6c5d8e1b44",
  "links": {
    "self": "string"
  },
  "modifiedDate": "2026-06-11T09:24:13.418",
  "title": "string",
  "url": "https://cdn.fluit.cloud/assets/widget-a-front.jpg",
  "width": 42
}

Bas-URL https://api.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

PATCH /channels/{channelCode}/media/{assetId}

Update a media file's metadata

Partially updates one file's editorial metadata. Only provided fields are updated (JSON Merge Patch semantics). Omitted fields are left unchanged. Pass null to clear title, altText or caption; folder cannot be null.

Visa hela beskrivningen

Unknown fields are rejected with 400, naming the field and listing the ones this endpoint accepts. The file itself cannot be replaced here — uploading a new file gives it a new url, so replacing one is an upload plus updating whatever referenced the old. Changing folder re-files the asset in the library but does not move the stored file: the url is unchanged, so links already pointing at it keep working. The folder a file was uploaded into therefore stays visible in its url.

media:write

Sökvägsparametrar

Fält Typ Beskrivning
channelCode Krävs string Code of the channel the file belongs to.
assetId Krävs string(uuid) The file's id.

Body krävs

Fält Typ Beskrivning
altText string · nullable Alt text for accessibility. Pass `null` to clear.
caption string · nullable Caption. Pass `null` to clear.
folder enum Where in the storefront a media file belongs. Filters the library, and decides the folder a <em>new</em> upload is stored under. Hero Banner Sections Content Documents
title string · nullable Display name in the library. Pass `null` to fall back to the file name.

Svar

204 Tom body.
400 ProblemDetails The body is not a JSON object, contains a field this endpoint does not have, a field present in it failed validation, or folder was sent as null or with a value outside its list.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
404 ProblemDetails No channel with that code, or no file with that id in the channel.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl -X PATCH "https://api.fluit.cloud/preview/channels/{channelCode}/media/{assetId}" \
  -H "Content-Type: application/json" \
  -d @body.json
Svar 400
{
  "detail": "string",
  "instance": "string",
  "status": 42,
  "title": "string",
  "type": "string"
}

Bas-URL https://api.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

DELETE /channels/{channelCode}/media/{assetId}

Delete a media file

Removes the library record and the stored file. Nothing checks whether a page still references the url — a section pointing at a deleted file keeps its broken link, so look the file up in the pages that use it first.

Visa hela beskrivningen

The deletion leaves a tombstone under GET /preview/deletions with resource 'media', so a client syncing with ?modifiedSince= sees it disappear.

media:write

Sökvägsparametrar

Fält Typ Beskrivning
channelCode Krävs string Code of the channel the file belongs to.
assetId Krävs string(uuid) The file's id.

Svar

204 Tom body.
404 ProblemDetails No channel with that code, or no file with that id in the channel.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl -X DELETE "https://api.fluit.cloud/preview/channels/{channelCode}/media/{assetId}"
Svar 404
{
  "detail": "string",
  "instance": "string",
  "status": 42,
  "title": "string",
  "type": "string"
}

Bas-URL https://api.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

Scheman

Objekten som gruppens anrop refererar till. Fälttabellerna ovan går ett steg djupt och länkar hit i stället för att upprepa samma schema på varje endpoint.