{"openapi":"3.1.0","info":{"title":"Videas Public API","description":"The Videas API for third-party integrators.\n\nIt reads your organization's library and writes to it, it publishes what the\nlibrary holds on the organization's channels, and it reads what their audience\nwatched:\n\n- **the library** — `GET /v1/assets` lists its assets and `GET /v1/workspaces`\n  the workspaces they are in, each counted under the same filters by its\n  `…/count`, and `GET /v1/assets/{asset_id}` reads one asset with what a listing\n  leaves out, such as its tags and its custom fields. Every asset is in exactly\n  one workspace, the one its `workspace_id` names, and a workspace files its\n  assets in folders (« Finding an asset »);\n- **its collections** — `GET /v1/collections`, the lists of assets it plays one\n  after the other, such as playlists, and what each one plays (« Collections »);\n- **adding to it** — `POST /v1/uploads`, a file you send or one we fetch from a\n  link (« Adding a file »), and `POST /v1/assets`, a video hosted on YouTube,\n  Vimeo or Dailymotion (« Adding a video hosted elsewhere »), each in a folder if\n  you name one, and `POST /v1/folders`, a folder (« Filing in folders »);\n- **editing an asset** — its words, the folder it is in, its tags, its values of\n  the organization's own fields, which `GET /v1/custom-fields` lists, and its\n  picture (« Editing an asset », « An asset's picture »);\n- **the channels** — `GET /v1/channels`, the categories each one files its\n  videos in, `GET /v1/categories`, and what they publish, `GET /v1/publications`,\n  which you create and change (« Publishing on a channel »);\n- **embedding** — `POST /v1/assets/{asset_id}/embed` and\n  `POST /v1/collections/{collection_id}/embed`, the code that plays an asset or a\n  collection in a web page (« Embedding »);\n- **what was watched** — `GET /v1/analytics/sessions`, who watched which asset,\n  when, how much and which stretches of it (« Analytics »);\n- **connecting an integration** — `POST /v1/connect/exchange`, where your server\n  collects the key a person of the organization approved for it, and\n  `DELETE /v1/api-keys/current`, where a key gives itself back (« Connecting an\n  integration »).\n\nMore resources land under `/v1` without changing what is already there.\n\n## Authentication\n\nSend an API key belonging to your organization as\n`Authorization: Bearer <key>`. An owner or an administrator creates one in the\nVideas console, choosing what it may do, and the raw value is shown once — or\napproves an integration that asks for one, which then collects it itself\n(« Connecting an integration »). A key\nmay carry any of these, and each opens what it says and nothing else:\n\n- `assets.library.read` — read the library: its assets, its collections, its\n  workspaces and their folders, and its custom fields;\n- `assets.library.upload` — add files to it with `POST /v1/uploads`, follow or\n  give up the uploads it opened, and make folders with `POST /v1/folders`;\n- `assets.library.edit` — change an asset already there: its words, the folder\n  it is in, its tags, its custom fields and its picture;\n- `assets.third_party_video.import` — with `assets.library.upload` beside it,\n  add a video hosted elsewhere with `POST /v1/assets`;\n- `websites.catalogue.read` — read the channels, their categories and what they\n  publish;\n- `websites.catalogue.publish` — publish assets on the channels, and change what\n  they publish;\n- `analytics.sessions.read` — read the playback sessions: who watched which\n  asset, when and how much;\n- `assets.library.embed` — get the embed that plays an asset or a collection in\n  a web page, publishing it when it has none yet.\n\n**None implies another**: a key made to publish cannot edit an asset, and one\nmade to edit cannot read the library. A write answers what it wrote whether or\nnot the key may also read it.\n\n**Three of them depend on what the organization uses.** The channels' two open\nnothing for an organization that does not publish channels: every channel\nendpoint answers it `403`, as it would a key without them. And\n`assets.third_party_video.import` opens nothing until Videas turns on videos\nhosted elsewhere for the organization: until then `POST /v1/assets` answers\n`404`. A key may carry either beforehand, and works with no change once the\norganization has the feature.\n\nA key authenticates the **organization**, not a person: it keeps working when\nthe person who created it leaves, and everything it can reach is scoped to that\none organization. **A key belongs on a server**: `/v1` sends no CORS headers,\nso no web page can call it — a page sends a file with the token of one upload\ninstead, as « Adding a file » says.\n\n## Lists and parameters\n\nLists are paged with `limit`, `after` and `order`: send the page's `next` back\nas `after` until it is `null`. A page carries no total and there is no offset;\na list that can be counted has a `…/count` beside it, which takes the list's\nfilters and nothing else.\n\nA parameter that takes several values takes them as **one key, separated by\ncommas** — `?type=video,audio`, which is OpenAPI's `style: form` with\n`explode: false`. A key given twice is refused with a `400`, and so is a key the\nendpoint does not list: a misspelt filter is an error, never a filter ignored.\n**A list of words is the exception**, since a word may itself hold a comma:\n`tag` is given once per word — `?tag=shared&tag=platform:heliaq`, which is\n`style: form` with `explode: true` — and an endpoint lists such a key so.\n\n## What may change\n\n**Without a new version**: a new endpoint, a new optional query parameter, a new\nfield in a response, and a new value in a list of values such as an asset's\n`type` or `status`, or an error's `code`. Read an unknown field or value as\nsomething your code does not know yet, not as an error. **Only with one**:\nremoving or renaming anything, changing a type or a unit, or refusing a request\nthat used to be accepted — that is a new version, `/v2`.\n\n## Errors\n\nErrors always have the same shape, whatever the status, so one handler on your\nside can read all of them: `code`, `message`, and a `request_id` to quote when\nyou ask us about one. Branch on `code`, never on `message`, which is written for\na human and may change at any time. A code keeps its meaning for good and the\nlist may grow: read a code you do not know by the HTTP status it came with.\n\nEvery body is JSON but a picture's, which is the picture itself (« Editing an\nasset »), and a JSON body not sent as `application/json` is a `415`. A body\nnaming a field the request does not list, or a field of the wrong type, is a\n`422`; a value the request's rules refuse is a `400`, whose message names the\nfield. An identifier in a body naming nothing your key can reach — a workspace,\na channel, an asset, a custom field — is a `404`, whether it names nothing at\nall or something of another organization's.\n\nAny request may be refused with a `429` (`rate_limited`) when a key, or its\norganization, sends more than this API accepts: wait the number of seconds\n`Retry-After` gives, then send it again. A `500`, `503` or `504` is a failure on\nour side: retry after a growing delay — « Retrying », below, says which requests\nare safe to send again as they are, and what to look for before sending the\nothers.\n\n## Finding an asset\n\n`GET /v1/assets` narrows by any of these, and `GET /v1/assets/count` counts\nunder the same ones:\n\n- **`type`** and **`status`**, one value or several: `?status=ready` lists only\n  the assets that play;\n- **`workspace_id`**, the assets of one workspace;\n- **`parent`**, where they are filed: a folder's `id`, the assets directly in\n  that folder, or `root`, the ones in no folder. A folder is in one workspace:\n  `GET /v1/workspaces/{workspace_id}/folders` lists them flat, each with the\n  `parent_id` of the folder it sits in — `null` at the root —, so the tree is\n  rebuilt from one walk, and every asset says in its own `parent_id` which\n  folder it is directly in;\n- **`search`**, words looked for in the asset's name, its description and the\n  other words it holds, as the library's search box in Videas finds them: every\n  word must be found, case and accents do not count, a word also finds the longer\n  ones it begins, a `\"quoted phrase\"` is found as written and a `-word` leaves\n  out the assets holding it. The assets come in the list's usual order, not by\n  how well they match;\n- **`external_ref`**, your own reference, as « Retrying » uses it.\n\n## Filing in folders\n\nA workspace files its assets in folders: `GET /v1/workspaces/{workspace_id}/folders`\nlists them flat, each with the `parent_id` of the folder it sits in — `null` at\nthe root —, and `GET /v1/folders/{folder_id}` reads one. A folder is in one\nworkspace, and an asset is filed only in a folder of its own workspace:\n\n- **`POST /v1/folders` makes one** in `workspace_id`'s tree, directly under the\n  folder `parent_id` names or at the root without one, with\n  `assets.library.upload`. Two folders may have the same name, so a request sent\n  twice makes two (« Retrying »).\n- **`parent_id` on `POST /v1/uploads` and `POST /v1/assets` files what they\n  create** directly in that folder; without it, the asset lands at the\n  workspace's root.\n- **`parent_id` on `PATCH /v1/assets/{asset_id}` moves an asset** to another\n  folder of its workspace, or to its root with `null`, with\n  `assets.library.edit`. Sending the `parent_id` the asset already reads with,\n  `null` included, moves nothing. An asset never changes workspace here.\n\nA `parent_id` naming anything that workspace's folder listing does not answer —\na folder of another workspace, one deleted, an asset — is a `404`, and nothing\nis created or moved. A folder hidden in Videas is in no listing either: what it\nholds reads `parent_id` `null`, as at the root.\n\n**A folder shared by a link shares what is filed in it**, at the moment the link\nis opened: an asset moved or added into such a folder is visible to whoever\nholds the link, and one moved out of it no longer is.\n\n## Collections\n\nA collection is a list of the library's assets played one after the other — a\nplaylist. `GET /v1/assets` does not list collections; `GET /v1/collections`\ndoes, with what describes each one: its `name`, its `description` as the\norganization wrote it — Markdown, not rendered —, its `workspace_id`, how many\nentries it holds and how long they last, and its picture's `thumbnail_url`,\nwhich follows the collection as an asset's follows the asset.\n`GET /v1/collections/{collection_id}` adds its tags.\n\n**`tag` narrows the list** to the collections filed under any of the words\ngiven, one `tag` per word: `?tag=shared&tag=platform:heliaq` lists those filed\nunder either. A word is matched as `PUT /v1/assets/{asset_id}/tags` matches one\n— case, accents and punctuation do not count — and only a tag the collection's\nread answers counts. `GET /v1/collections/count` counts under the same words.\n\n**`GET /v1/collections/{collection_id}/items` is what the collection plays**:\neach item is an asset as `GET /v1/assets` answers it, with its `position`, where\nit comes when the collection is played, from `0`. The items come in the order of\ntheir assets' `created_at`, like every list here, so that a walk never skips or\nrepeats one: **sort them by `position` to play them**. An entry whose asset the\nlibrary does not show — one hidden from it, say — is not an item, and the\npositions count only the items listed, so `item_count` may be larger than what\nthe items answer. **A collection set to play in a random order is answered in\nthe order the organization arranged it in**, the same on every read, so a copy\nof its positions holds from one read to the next; its player still shuffles it\neach time it plays. A collection Videas fills by rules answers what its rules\nselect when it is read, in a new order on every read if it is set to a random\none, and its `item_count` is `0`.\n\n## Analytics\n\nWhat is under `/v1/analytics/` is measured rather than stored: it is read from\nour analytics store, it changes while somebody watches, and it is the same\npopulation whichever endpoint answers. **That population is your organization's\nplayback sessions that played**: a page that opened a player nobody pressed play\non is not one, a session stays whatever became of its asset — deleted, hidden,\nmoved —, and bots are left out. Every endpoint of the namespace takes the same\nfilters, `asset_id` and `viewer_id`, and nothing else narrows what it counts, so\ntwo of them never disagree about what they are over.\n\n**`GET /v1/analytics/sessions` lists the sessions**, one sitting of one viewer on\none asset each: when it started, how long it was played in `watch_time_ms`, how\nfar it got in `completion_percentage`, the asset's duration as it was then, and\n`watched`, the stretches of the asset that were watched, in milliseconds — each\non one of a hundred equal steps of the duration, so a stretch covers a little more\nthan was watched. Add up the stretches of a viewer's sessions on an asset to know\nhow much of it they have seen. **A list is a snapshot**: a session still playing\nhas more watch time on the next read, so read again a session you need final, and\none whose viewer presses play reaches the list about a minute later.\n`GET /v1/analytics/sessions/count` counts under the same filters.\n\n**`viewer_id` is what your embed code says it is**: send `viewer_id=<uuid>` in\nthe player's address and it is that viewer's sessions you read back — derive a\nuuid from an identifier of yours that is not one, a UUIDv5 of it for example.\nWithout one, it identifies one browser on one device, and nobody in particular.\nNothing checks the identifier a page sends, so treat it as what the page claimed.\n`asset_id` may name an asset `GET /v1/assets/{asset_id}` no longer answers.\n\n## Adding a file\n\n`POST /v1/uploads` creates the asset at once — `uploading`, in the workspace you\nnamed, in the folder `parent_id` names or else at its root, its id in\n`asset_id` — and its file comes from one of two sources. Send **exactly one** of\n`size_bytes` or `source_url`:\n\n- **`size_bytes`: you send the file**, and `size_bytes` is its exact size, at\n  least one byte: an empty file is refused, since there is nothing in it to store\n  or to play. The answer carries `upload_url` and `upload_token`. Send the file to `upload_url` with the token in\n  `X-Upload-Token`: whole with one `PUT` when it is at most `max_put_bytes` —\n  `Content-Length` its exact size, any `Content-Type` — or with tus 1.0 core,\n  in chunks of at most `max_put_bytes` and, but for the last, of at least 5 MiB.\n  `upload_url` is opaque: use it exactly as given, and never build one. The\n  request that completes the file answers `X-Checksum-Sha256`, the SHA-256 of\n  what was stored. A `PUT` that breaks off records nothing and is sent again\n  whole; tus resumes from the offset a `HEAD` answers. A file not complete by the\n  upload's `expires_at` is given up on.\n- **`source_url`: we fetch the file from that link**, in the background. The\n  answer carries no address and no token: there is nothing to send.\n\n**From a browser.** Your server opens the upload with its key, then hands\n`upload_url` and `upload_token` — never the key — to the page, which sends the\nfile from any origin: one `PUT` with `fetch`, or a tus client. The token is\nanswered once, by the request that opened the upload, and admits its holder to\nthat one upload and to nothing else.\n\n**What a link must be.** `http` or `https` on the scheme's own port, 80 or 443,\nwith no user name or password in it, leading to the file itself: a YouTube, Vimeo\nor Dailymotion page is refused at once — « Adding a video hosted elsewhere » says\nhow to add one —, and a web page where the file should be fails `not_a_file`. At\nmost 10 GiB. We follow up to five redirects, never from `https` to `http`, and\nresume a broken download with a `Range` request where the server honours one.\nGive `sha256` and the file must match it. A presigned link to your bucket is the\nusual case, so a link is treated as a credential: sealed while the download\nneeds it, and never answered back whole — the upload's `source_url` is the link\nwithout its query. Sign it for longer than the download may take, retries\nincluded. An organization may have only so many links waiting or downloading at\nonce; past that, the request is a `429` with `Retry-After`.\n\n**Links are fetched from these addresses and from no others** — allow them in\nyour firewall or your bucket's policy:\n\n- IPv4: `193.104.118.42` and `193.104.118.43`;\n- IPv6: `2a12:3440:102::3:42` and `2a12:3440:102::3:43`.\n\nThey fetch every customer's links, so allow them beside the link's signature and\nnever instead of it: an object these addresses may read unsigned is one any of\nour customers may have us fetch into their library.\n\n**Following an upload.** Nothing notifies you yet: poll\n`GET /v1/uploads/{upload_id}` — its `status`, its `received_bytes`, and for a\nlink that failed its `failure` — or `GET /v1/assets/{asset_id}` with a key that\nreads the library. An upload is `pending`, then `receiving`, then `completed`; or\nit ends `cancelled` — `DELETE /v1/uploads/{upload_id}` gives it up —, `expired`,\nor for a link `failed`. `UploadStatus` says which source reaches which, and\n`UploadFailureCode` what each failure means and what to do about it. Once the\nupload is `completed`, the asset goes on to `processing`, then `ready`; an upload\nthat ends any other way leaves its asset `error`.\n\n## Adding a video hosted elsewhere\n\n`POST /v1/assets` creates an asset that plays a video from its provider's site —\nYouTube, Vimeo or Dailymotion —, named in `third_party_url` by the address of its\npage or the one its share button gives. Nothing else is taken there: not an embed\ncode, not another site, and not a link to a file, which `POST /v1/uploads` adds.\nThe key needs `assets.third_party_video.import` beside `assets.library.upload`,\nand the organization must have videos hosted elsewhere turned on\n(« Authentication »).\n\n**The provider is asked about the video while your request waits.** Its answer\nnames the asset unless you send `name`, describes it unless you send\n`description`, and says whether the video may be played outside its site: a\nprivate, deleted or non-embeddable video is refused with a `400`. A provider that\ndoes not answer in time, or answers with a failure of its own, is a `502`\n(`upstream_error`): send the request again in a moment. Either way nothing is\ncreated. **The provider's poster becomes the asset's picture when it arrives in\ntime**; otherwise the asset is created without one, and\n`PUT /v1/assets/{asset_id}/thumbnail` gives it one.\n\nThe asset is `ready` at once — there is no file to receive or process —, in\n`workspace_id`, in the folder `parent_id` names or else at its root. The answer\nis a `201` with its `Location` and the asset as `GET /v1/assets/{asset_id}`\nanswers it, its `third_party` saying which video it plays; `third_party.video_id`,\non every page of `GET /v1/assets`, is what to\nmatch your own records on.\n\n## Editing an asset\n\nFour requests change an asset already in the library, each with\n`assets.library.edit`:\n\n- **`PATCH /v1/assets/{asset_id}`, its words and its folder** — `name`,\n  `description`, `excerpt`, `copyright`, `language`, `external_ref`,\n  `seo_title`, `seo_description`, and `parent_id`, the folder of its workspace it\n  moves to (« Filing in folders »). A field you leave out stays as it is, a value\n  replaces it, and `null` empties it — but for `name`, which is never empty, and\n  `parent_id`, whose `null` is the workspace's root.\n- **`PUT /v1/assets/{asset_id}/tags`, the words it is filed under**, sent as\n  words rather than ids: `{\"tags\": [\"Carbon fibre\", \"Recycling\"]}`. Case,\n  accents and punctuation do not count, so `carbon-fibre` names the same tag. A\n  word is looked for among the tags of the asset's workspace, then among the\n  organization's; one that matches neither becomes a new tag of the\n  organization, as you wrote it. **The list replaces the asset's tags, except\n  those Videas attaches itself**, which stay whatever you send; an empty list\n  takes yours off. A workspace may file its assets only under the tags it\n  already has: there, a word that matches none is refused with a `400`.\n- **`PATCH /v1/assets/{asset_id}/custom-fields`, its values of the\n  organization's own fields.** `GET /v1/custom-fields` lists the fields, each\n  with its `type` and where it applies. A value is written by its field's `id`,\n  in the shape the field's `type` gives it — `CustomFieldValue` — and `null`\n  empties it, but for a `required` field. A `choice` field's values are its\n  options' ids, and `GET /v1/custom-fields/{field_id}/choices` lists them apart,\n  since a field may offer thousands. The fields you name take the values you\n  send and the others keep theirs; a request any of whose values is refused\n  writes nothing.\n- **`PUT /v1/assets/{asset_id}/thumbnail`, its picture.** The body is the\n  picture itself, not JSON — a JPEG, a PNG or a WebP of at most 10 MiB, with a\n  `Content-Type` naming which.\n\n**Each answers the whole asset**, as `GET /v1/assets/{asset_id}` answers it, so\none shape is read whatever was written. **A request that changes nothing writes\nnothing**: sending what the asset already holds — its words, its folder, its\ntags, its values, its picture — leaves it as it was, `updated_at` included. An\nasset's `updated_at` moves with its words and its picture, never with its\nfolder, its tags or its custom fields. The last request to arrive wins: nothing\nchecks what the asset held when you last read it.\n\nA change a key makes to an asset's name, description, excerpt, copyright or\nlanguage, to its tags or to its custom fields is recorded in the asset's history\nin Videas under the key's name, so the people who look after the library see\nwhich integration made it.\n\n**An asset the organization has validated in its shared pool is read-only\nhere**: each of these requests is refused with a `403`, whatever the key\ncarries, since only that pool's moderators can change it, and they do so from\nVideas.\n\n## An asset's picture\n\n`thumbnail_url`, on every asset a listing or a read answers, is the address of\nthe picture the asset is shown with — the one the organization chose, else the\none Videas picked —, and `null` while there is none. **It is stable and\nanonymous**: it needs no key, goes as it is in a web page's `<img>`, and goes on\nanswering the asset's picture when another one is chosen, so store the address\nrather than the bytes. It is on the domain your organization's Videas\napplication is served on, not on this API's.\n\nIt answers a JPEG at the picture's own size, at most 3840 pixels a side; with its\nlast segment changed it answers other formats and sizes — `thumbnail.webp`,\n`thumbnail.png`, or `{fit}-{width}x{height}.{ext}` for the picture fitted to a\nbox, which `thumbnail_url` itself describes. Its answers may be held for a few\nminutes, and carry an `ETag`. **It answers `404` once the asset is deleted or\nhidden, or no longer has a picture**: read the asset again then.\n\n## Publishing on a channel\n\nA channel is a public site where the organization publishes videos for an\naudience. `GET /v1/channels` lists the organization's channels, online or not:\n`name` is the one its audience reads, `url` its home page — `null` while no\ndomain of the channel is switched on. Reading them takes\n`websites.catalogue.read`, and so does every read below; the two writes take\n`websites.catalogue.publish`.\n\n**Categories** are each channel's tree, read here and arranged from Videas.\n`GET /v1/categories?channel_id=` lists them flat, in the order they were\ncreated: rebuild the tree from `parent_id` — `null` at the root — and sort the\ncategories sharing a parent by `position`, then by `name`. A category switched\noff is listed, and may be filed in; its page answers `404` until it is switched\non.\n\n**A publication is one asset on one channel**, at its own address, filed in\nthat channel's categories. `GET /v1/publications` lists them, narrowed by\n`channel_id`, `asset_id` and `status`: `?asset_id=` says where an asset is\npublished, and with `channel_id` beside it whether it is published there.\n\n- **`status`** is `draft`, `published` or `archived`. A publication scheduled\n  for later is `published` with a `published_at` still to come: the channel\n  shows it from that instant.\n- **`access` says who it is for**, read in five words — `public`,\n  `authenticated`, `restricted`, `paid` and `on_request` — and written in two:\n  `public`, anybody the channel lets in, and `authenticated`, anybody who signed\n  in to the channel or gave its password. The other three stand for a right or\n  an offer set from Videas: a request may neither set one (`400`) nor move a\n  publication off one (`409`). Left out of a creation, the channel decides — on a\n  channel whose visitors open an account themselves and whose site is otherwise\n  open, a new publication asks for that account; on any other, it is open to\n  everyone the channel lets in. **Created `authenticated`, sent so or given so by\n  the channel, a publication is shown locked**: the visitors it is not for still\n  see it in the channel's listings when it is listed, and at its page, and\n  playing it asks them to sign in. A `PATCH` moving a publication's level leaves\n  that as it was. It is the publication's own level: on a channel that asks\n  every visitor to sign in, a `public` publication is still behind that sign-in.\n- **`slug`** is the handle its `url` is built on. Left out of a creation, it is\n  made from the asset's own handle, else its name, followed by `-2`, `-3` and on\n  where the address is taken; sent, it is taken as it is — a `400` when the\n  channel's own site answers that address, a `409` when another publication or a\n  page of the channel holds it. **A new slug leaves the old address answering**,\n  sending visitors to the new one.\n- **`category_ids`** are the categories it is filed in, and\n  `primary_category_id` its main one, which must be among them. **It is a set**:\n  read, its order says only that the main category comes first, the others\n  following in the order `GET /v1/categories` lists them; sent, the order is\n  ignored. Sent, the list replaces the set: a category it stays in keeps the\n  place and the featuring given to it there in Videas, and one it enters puts it\n  last.\n\n`POST /v1/publications` publishes an asset on a channel. The asset must be\n`ready` — a `409` until it is — and is published at most once on a channel, so a\nsecond request for the same pair is a `409` too. It is created a `draft` unless\n`status` says `published`. `PATCH /v1/publications/{publication_id}` changes\none: what you send is written and what you leave out stays, and its channel and\nits asset never change. Both answer the whole publication; a `PATCH` that\nchanges nothing writes nothing, `updated_at` included, and the last request to\narrive wins. **Nothing deletes a publication**: `archived` takes it off the\nchannel and keeps it, and a new `slug` frees its address.\n\nWhile the organization's channels are still being moved to Videas, every write\non them is refused with a `409`: they are changed from the platform they are\nmoving from until the move is complete. Reading them answers as usual.\n\n## Embedding\n\nA web page plays an asset or a collection through its **embed** — its default one,\nwhich the organization manages in Videas.\n`POST /v1/assets/{asset_id}/embed` — or `POST /v1/collections/{collection_id}/embed`\n— answers it, and creates it when there is none yet: a `201` when it was just\ncreated, public and active, a `200` when it already existed. Its `id` is what the\nloader script takes:\n\n```html\n<script src=\"{script_url}\" data-embed=\"{id}\" async></script>\n```\n\nor put `embed_url` in an `iframe`. **The `id` is stable**: store it with your\npage rather than asking for every view. The organization keeps control of its\nembed from Videas — it may restrict it to some domains, put it behind a\ncredential or switch it off —, and the answer says so in `access` and `active`\nwithout making a second one. A list of sites the organization set for all its\nembeds applies as well, and `access` does not report it. The answer names what\nthe embed plays in `asset_id`, or in `collection_id` for a collection, the\nother being `null`. The key needs `assets.library.embed`.\n\n## Connecting an integration\n\nAn integration installed on a customer's site — a WordPress plugin, say — gets\nits key without anybody copying one: it sends a person of the organization to\nVideas, who approves it, and its server collects the key.\n\n1. **Open the connection** by sending that person's browser to\n   `https://app.videas.com/api/app/connect`, with `client_name`, the name the\n   approval page shows; `redirect_uri`, where the browser comes back — `https`,\n   or `http` on `localhost` or `127.0.0.1` only, with no user name, password or\n   fragment; `scope`, the permissions asked for, separated by spaces; `state`, a\n   value of yours given back unchanged; and `code_challenge`, the unpadded\n   base64url SHA-256 of a random verifier your server keeps to itself (PKCE's\n   `S256`, the only method there is). A request outside these rules is refused\n   there and never sent back to you.\n2. **The person decides.** They sign in if they need to, read which site asks\n   for what — the site's address first — and approve, confirming who they are\n   with their password and second factor, or refuse. The browser comes back to `redirect_uri` with `code` and `state`, or\n   with `error=access_denied` and `state`. The request waits ten minutes for a\n   decision.\n3. **Collect the key**, from your server, within sixty seconds of the approval:\n   `POST /v1/connect/exchange` with `{\"code\": …, \"code_verifier\": …}` and no\n   key. The answer carries the key in `api_key`, shown this once, what it may do\n   in `permissions` — what the person approved, which may be less than you asked\n   for —, and the organization it belongs to, `organization_id` and\n   `organization_name`. **A code is collected once, and an answer that reads it\n   ends it**, whatever that answer says: the `200`; a `400` refusing the code,\n   the verifier, or the permissions it was approved for — an unknown code, one\n   already collected, lapsed or refused, or a verifier that is not the one,\n   without saying which —; and a `404`, connecting integrations having been\n   switched off for the organization the code was approved for. After either\n   refusal, start again from the first step. **An answer given before the code is read\n   leaves it as it was**: a `429`, too many connections from your server's\n   address, and a `400`, `413`, `415` or `422` refusing the request itself — a\n   query parameter, or a body that is not that JSON object —, whose `message`\n   says what is wrong. A `500`, `503` or `504` leaves it as it was too, unless\n   the key was made and only its answer was lost (« Retrying »).\n4. **Disconnect** with `DELETE /v1/api-keys/current`, the key as the request's\n   only credential: a `204`, and the key is refused from its next request. Any\n   key may give itself back, whether a connection or a person made it. Forget\n   your copy whatever the answer.\n\nThe key a connection collects is an ordinary key: it lasts until it is revoked,\nand the organization sees it in the Videas console under the integration's name\nand the site's address, and may revoke it there like any other.\n\n## Retrying\n\nA `GET` is always safe to send again, and so are `PATCH` and `PUT`: each says\nwhat the resource should hold, so sent twice the second finds it holding that\nalready and writes nothing. `DELETE /v1/uploads/{upload_id}` is safe too: an\nupload already given up on is answered `204` again. So is\n`DELETE /v1/api-keys/current`, whose second answer is a `401`: the key no longer\nworks, which is what was asked. A `POST` creates something,\nso after a timeout or a `5xx`, look for what the first one may have created\nbefore sending it again:\n\n- **`POST /v1/uploads` and `POST /v1/assets` are not idempotent**: sent twice,\n  either creates two assets. Set `external_ref` on every one, and look it up\n  with `GET /v1/assets?external_ref=` — which takes `assets.library.read` —\n  before sending it again. An asset `POST /v1/assets` created is complete when\n  it is found, `ready` from the moment it exists. A link given to\n  `POST /v1/uploads` is already being fetched when its asset is found: do not\n  send it again. A file you were sending cannot be resumed — its token was in\n  the answer you lost — so open a new upload: the first asset ends `error` when\n  its upload expires, and an `error` asset with no file is such an abandoned\n  attempt.\n- **`POST /v1/folders` is not idempotent**: sent twice, it makes two folders,\n  and two may have the same name. Look for the folder in\n  `GET /v1/workspaces/{workspace_id}/folders` before sending it again.\n- **`POST /v1/publications` publishes an asset once on a channel**: sent again,\n  it is refused with a `409`, and\n  `GET /v1/publications?channel_id=…&asset_id=…` finds the publication the\n  first one made.\n- **`POST /v1/assets/{asset_id}/embed` and its collection's twin are\n  idempotent**: sent again, either answers the embed the first one created.\n- **`POST /v1/connect/exchange` may be sent again after a `429` or a `5xx`**,\n  with the same code and verifier, while the sixty seconds after the approval\n  last: a `429` never reads the code, and a `5xx` leaves it to collect unless the\n  first attempt made the key and only its answer was lost — the second is then\n  a `400`, and that key goes to nobody: the organization may revoke it in the\n  console. After any other answer, open a new connection.","contact":{"name":"Videas Team"},"license":{"name":"proprietary","identifier":"proprietary"},"version":"1.0.0"},"servers":[{"url":"https://api.videas.com","description":"Production"},{"url":"http://api.videas.localhost","description":"Local development"}],"paths":{"/v1/analytics/sessions":{"get":{"tags":["analytics"],"summary":"List the organization's playback sessions.","description":"Every sitting of a viewer on an asset of the organization that played — a page opened and never\nplayed is not a session here —, oldest first, or newest first with `order=desc`, whatever\nbecame of its asset since. Page with `next`: send it back as `after` until it is `null`.\n`asset_id` and `viewer_id` narrow the list, and `GET /v1/analytics/sessions/count` counts it\nunder the same filters. **A page is a snapshot**: a session still playing has more watch time\non the next read, and one whose viewer pressed play after a walk went past its `started_at` is\nnot met by that walk. Sessions played through the embedded player reach this list within about\na minute; bots are left out.","operationId":"analytics_sessions_list","parameters":[{"name":"asset_id","in":"query","description":"Only the sessions on these assets, as one `asset_id` whose values are separated by commas:\n`?asset_id=…,…`. **An asset deleted since is still named here**, and answers its sessions:\nthey outlive it. An asset of another organization, or a uuid that names nothing, matches\nnothing. At most 100. Absent, every asset.","required":false,"schema":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100},"style":"form","explode":false},{"name":"viewer_id","in":"query","description":"Only the sessions of these viewers, as one `viewer_id` whose values are separated by\ncommas: `?viewer_id=…,…` — the identifier a session's own `viewer_id` carries. A viewer of\nanother organization's matches nothing here. At most 100. Absent, every viewer.","required":false,"schema":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100},"style":"form","explode":false},{"name":"limit","in":"query","description":"How many items to return, at most. A value above the operation's maximum, or below 1, is\nbrought into range rather than refused.","required":false,"schema":{"type":"integer","format":"int64"},"example":50},{"name":"after","in":"query","description":"The `next` of a previous page. Absent, the list starts from its beginning.","required":false,"schema":{"type":"string"}},{"name":"order","in":"query","description":"`asc` (the default) or `desc`: the list in its order, or reversed. Unless the operation\nsays otherwise, its order is oldest first.","required":false,"schema":{"type":"string","description":"The direction a list is read in: `asc` from its first item, `desc` from its last.","enum":["asc","desc"]},"example":"asc"}],"responses":{"200":{"description":"One page of the organization's playback sessions, and the cursor of the next page — `null` on the last one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_PlaybackSession"}}}},"400":{"description":"An `asset_id` or a `viewer_id` entry that is not a uuid, an empty one, or more than 100 of either; a key given twice, or one this endpoint does not list; a `limit` that is not a whole number, an `order` other than `asc` or `desc`, or an `after` this endpoint did not issue.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `analytics.sessions.read`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/analytics/sessions/count":{"get":{"tags":["analytics"],"summary":"Count the organization's playback sessions.","description":"How many sessions `GET /v1/analytics/sessions` would list under the same `asset_id` and\n`viewer_id` — counted when asked, so a listing begun afterwards may meet sessions played since.","operationId":"analytics_sessions_count","parameters":[{"name":"asset_id","in":"query","description":"Only the sessions on these assets, as one `asset_id` whose values are separated by commas:\n`?asset_id=…,…`. **An asset deleted since is still named here**, and answers its sessions:\nthey outlive it. An asset of another organization, or a uuid that names nothing, matches\nnothing. At most 100. Absent, every asset.","required":false,"schema":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100},"style":"form","explode":false},{"name":"viewer_id","in":"query","description":"Only the sessions of these viewers, as one `viewer_id` whose values are separated by\ncommas: `?viewer_id=…,…` — the identifier a session's own `viewer_id` carries. A viewer of\nanother organization's matches nothing here. At most 100. Absent, every viewer.","required":false,"schema":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100},"style":"form","explode":false}],"responses":{"200":{"description":"How many sessions the listing would answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybackSessionCount"}}}},"400":{"description":"An `asset_id` or a `viewer_id` entry that is not a uuid, an empty one, or more than 100 of either; or a key given twice, or one this endpoint does not list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `analytics.sessions.read`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/api-keys/current":{"delete":{"tags":["integrations"],"summary":"Revoke the API key this request is authenticated with.","description":"Any live key may revoke itself, whatever it is allowed to do otherwise. The key stops working\nat once: the next request that presents it is refused with `401`, and it disappears from the\norganization's list of keys. Nothing else changes — other keys of the organization keep\nworking, and a new connection needs a new key.\n\nSend it when your integration disconnects, so that no live credential is left behind, and\nforget your copy of the key whatever the answer.","operationId":"api_keys_revoke","responses":{"204":{"description":"The key is revoked; the next request presenting it is refused"},"401":{"description":"No key, or one that is unknown, expired or already revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/assets":{"get":{"tags":["assets"],"summary":"List the organization's assets.","description":"Every asset of the organization's library that is visible and past its first upload, in every\nworkspace, oldest first — or newest first with `order=desc`. Folders and collections are not\nlisted: `GET /v1/collections` lists the collections. Each asset is in one workspace, its\n`workspace_id`. Page with `next`: send it back as `after` until it is `null`. `type`,\n`workspace_id`, `external_ref`, `search`, `status` and `parent` narrow the list, each filter\ngiven narrowing what the others leave, and `GET /v1/assets/count` counts it under the same\nfilters.","operationId":"assets_list","parameters":[{"name":"type","in":"query","description":"Only these types, as one `type` whose values are separated by commas:\n`?type=video,audio`. Absent, every type the listing answers.","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/AssetType"}},"style":"form","explode":false},{"name":"workspace_id","in":"query","description":"Only the assets of these workspaces, as one `workspace_id` whose values are separated by\ncommas: `?workspace_id=…,…`. An asset is in one workspace, the one its own `workspace_id`\nnames. A workspace of no concern to this organization matches nothing. Absent, every\nworkspace.","required":false,"schema":{"type":"array","items":{"type":"string","format":"uuid"}},"style":"form","explode":false},{"name":"external_ref","in":"query","description":"Only the assets whose `external_ref` is exactly this, the spaces around it aside — **one**\nvalue, since your own identifiers may contain commas; percent-encode it like any query\nvalue. Not unique, so it may match several assets, or none. What to look an asset up by\nafter an upload request that timed out or answered a `5xx`, before sending it again — with\nthe value you sent. Absent, every asset.","required":false,"schema":{"type":"string"}},{"name":"search","in":"query","description":"Only the assets whose text matches these words — the name, the description and the text\nextracted from the file, as the library's search box matches them. Every word must match,\ncase and accents aside, and a long word matches its beginning; `\"…\"` keeps a phrase\ntogether and `-word` excludes one. At most 200 characters, and at least one word. The\norder stays the listing's: the matches are not ranked. Absent, every asset.","required":false,"schema":{"type":"string","maxLength":200}},{"name":"status","in":"query","description":"Only the assets in these statuses, as one `status` whose values are separated by commas:\n`?status=ready,error`. Absent, every status.","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/AssetStatus"}},"style":"form","explode":false},{"name":"parent","in":"query","description":"Only the assets directly in this folder of their workspace — the `id` of one of\n`GET /v1/workspaces/{workspace_id}/folders`, not one of its subfolders — or, with `root`,\nthe ones in no folder. An identifier of no folder of this organization matches nothing.\nAbsent, wherever they are.","required":false,"schema":{"type":"string"},"example":"root"},{"name":"limit","in":"query","description":"How many items to return, at most. A value above the operation's maximum, or below 1, is\nbrought into range rather than refused.","required":false,"schema":{"type":"integer","format":"int64"},"example":50},{"name":"after","in":"query","description":"The `next` of a previous page. Absent, the list starts from its beginning.","required":false,"schema":{"type":"string"}},{"name":"order","in":"query","description":"`asc` (the default) or `desc`: the list in its order, or reversed. Unless the operation\nsays otherwise, its order is oldest first.","required":false,"schema":{"type":"string","description":"The direction a list is read in: `asc` from its first item, `desc` from its last.","enum":["asc","desc"]},"example":"asc"}],"responses":{"200":{"description":"One page of the organization's assets, and the cursor of the next page — `null` on the last one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_AssetSummary"}}}},"400":{"description":"A `type` or `status` entry that names no listed value, a `workspace_id` entry that is not a uuid, a blank `external_ref`, a `search` with no word or over 200 characters, a `parent` that is neither `root` nor a uuid, a key given twice or one this endpoint does not list, a `limit` that is not a whole number, an `order` other than `asc` or `desc`, or an `after` this endpoint did not issue.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `assets.library.read`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}},"post":{"tags":["assets"],"summary":"Create an asset from a video hosted on YouTube, Vimeo or Dailymotion.","description":"The asset plays the video from its provider's site, and is `ready` at once — there is no file\nto receive or process. **This is the one kind of asset created here**: a file is added with\n`POST /v1/uploads`. The provider is asked about the video before anything is created: its\ntitle names the asset unless `name` does, its description describes it unless `description`\ndoes, and its poster is copied as the asset's picture when it arrives in time — the asset is\ncreated without one otherwise. The new asset is in `workspace_id` — in the folder `parent_id`\nnames, else at its root —, and answered as `GET /v1/assets/{asset_id}` answers it, with\n`third_party` saying which video it plays.\n\nThe key needs both `assets.library.upload` and `assets.third_party_video.import`, and the\norganization must import videos hosted elsewhere, which is turned on per organization.\n\n**This request is not idempotent**: sent twice, it creates two assets. Set `external_ref` on\nevery one, and after a timeout or a `5xx` look it up with `GET /v1/assets?external_ref=` before\nsending it again.","operationId":"assets_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAssetRequest"}}},"required":true},"responses":{"201":{"description":"The asset, `ready`, as `GET /v1/assets/{asset_id}` answers it. `Location` is its address on this API.","headers":{"location":{"schema":{"type":"string"},"description":"`/v1/assets/{asset_id}`."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetView"}}}},"400":{"description":"A `third_party_url` that is not the address of a video on YouTube, Vimeo or Dailymotion — an embed code, another site, a link to a file — or a video its provider will not describe: private, deleted, or not allowed to be embedded; a blank `name` or `external_ref`; a `name` or an `external_ref` longer than 500 characters, an `excerpt` or a `copyright` longer than 1000, or a `description` longer than 50000; a `language` that is not a BCP 47 tag; or any query parameter — this endpoint takes none. The message names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry both `assets.library.upload` and `assets.third_party_video.import`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"The organization does not create assets from videos hosted elsewhere — ask Videas to turn it on —, no live workspace of this organization has this `workspace_id`, or no folder `GET /v1/workspaces/{workspace_id}/folders` lists has this `parent_id`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"The body is not sent as `application/json`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"The body is not this request: `workspace_id` or `third_party_url` missing, a field of the wrong type, or a field this body does not list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"502":{"description":"The provider could not be asked about the video: it did not answer in time, or answered with a failure of its own. Nothing was created; send the request again in a moment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/assets/count":{"get":{"tags":["assets"],"summary":"Count the organization's assets.","description":"How many assets `GET /v1/assets` would list under the same filters — `type`, `workspace_id`,\n`external_ref`, `search`, `status` and `parent` — counted when asked, so a listing begun\nafterwards may meet assets created or deleted since.","operationId":"assets_count","parameters":[{"name":"type","in":"query","description":"Only these types, as one `type` whose values are separated by commas:\n`?type=video,audio`. Absent, every type the listing answers.","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/AssetType"}},"style":"form","explode":false},{"name":"workspace_id","in":"query","description":"Only the assets of these workspaces, as one `workspace_id` whose values are separated by\ncommas: `?workspace_id=…,…`. An asset is in one workspace, the one its own `workspace_id`\nnames. A workspace of no concern to this organization matches nothing. Absent, every\nworkspace.","required":false,"schema":{"type":"array","items":{"type":"string","format":"uuid"}},"style":"form","explode":false},{"name":"external_ref","in":"query","description":"Only the assets whose `external_ref` is exactly this, the spaces around it aside — **one**\nvalue, since your own identifiers may contain commas; percent-encode it like any query\nvalue. Not unique, so it may match several assets, or none. What to look an asset up by\nafter an upload request that timed out or answered a `5xx`, before sending it again — with\nthe value you sent. Absent, every asset.","required":false,"schema":{"type":"string"}},{"name":"search","in":"query","description":"Only the assets whose text matches these words — the name, the description and the text\nextracted from the file, as the library's search box matches them. Every word must match,\ncase and accents aside, and a long word matches its beginning; `\"…\"` keeps a phrase\ntogether and `-word` excludes one. At most 200 characters, and at least one word. The\norder stays the listing's: the matches are not ranked. Absent, every asset.","required":false,"schema":{"type":"string","maxLength":200}},{"name":"status","in":"query","description":"Only the assets in these statuses, as one `status` whose values are separated by commas:\n`?status=ready,error`. Absent, every status.","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/AssetStatus"}},"style":"form","explode":false},{"name":"parent","in":"query","description":"Only the assets directly in this folder of their workspace — the `id` of one of\n`GET /v1/workspaces/{workspace_id}/folders`, not one of its subfolders — or, with `root`,\nthe ones in no folder. An identifier of no folder of this organization matches nothing.\nAbsent, wherever they are.","required":false,"schema":{"type":"string"},"example":"root"}],"responses":{"200":{"description":"How many assets the listing would answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetCount"}}}},"400":{"description":"A `type` or `status` entry that names no listed value, a `workspace_id` entry that is not a uuid, a blank `external_ref`, a `search` with no word or over 200 characters, a `parent` that is neither `root` nor a uuid, or a key given twice or one this endpoint does not list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `assets.library.read`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/assets/{asset_id}":{"get":{"tags":["assets"],"summary":"Read one asset of the organization.","description":"Everything `GET /v1/assets` answers about it, and its tags. An `id` the listing would not\nanswer — a folder, a collection, a hidden asset, one of another organization — is a `404`,\nlike an `id` that names nothing.","operationId":"asset_read","parameters":[{"name":"asset_id","in":"path","description":"The asset's `id`.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The asset.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetView"}}}},"400":{"description":"An `asset_id` that is not a uuid, or any query parameter: this endpoint takes none.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `assets.library.read`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"No asset the listing answers has this `id`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}},"patch":{"tags":["assets"],"summary":"Change an asset's words, or move it to another folder of its workspace.","description":"The fields you send are written, and the ones you leave out stay as they are; `null` empties a\nfield that may be empty, and moves the asset to its workspace's root on `parent_id`. The answer\nis the whole asset, as `GET /v1/assets/{asset_id}` answers it. Sending what the asset already\nholds changes nothing — not even its `updated_at`. The last request to arrive wins: nothing\nchecks what the asset held when you last read it.\n\nAn asset the organization has validated in its shared pool is refused: only that pool's\nmoderators can change it, from Videas.","operationId":"asset_update","parameters":[{"name":"asset_id","in":"path","description":"The asset's `id`.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAssetRequest"}}},"required":true},"responses":{"200":{"description":"The asset as it now is, as `GET /v1/assets/{asset_id}` answers it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetView"}}}},"400":{"description":"A `name` that is `null` or blank; a blank `external_ref`, `seo_title` or `seo_description` — send `null` to empty one; a `seo_title` longer than 255 characters, a `name` or an `external_ref` longer than 500, an `excerpt`, a `copyright` or a `seo_description` longer than 1000, or a `description` longer than 50000; a `language` that is not a BCP 47 tag; an `asset_id` that is not a uuid; or any query parameter — this endpoint takes none. The message names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `assets.library.edit`; or the asset is validated in the organization's shared pool, and only that pool's moderators can change it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"No asset `GET /v1/assets` lists has this `id`, or no folder `GET /v1/workspaces/{workspace_id}/folders` lists for the asset's workspace has this `parent_id`: nothing was changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"The body is not sent as `application/json`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"The body is not this request: a field of the wrong type, or a field this body does not list — among them the asset's `type`, `slug`, `is_visible`, `expires_at`, `license_type`, `advertising_enabled`, `thumbnail_asset_file_id` and `workspace_id`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/assets/{asset_id}/custom-fields":{"patch":{"tags":["assets"],"summary":"Set an asset's values of the organization's custom fields.","description":"**The fields you name take the values you send, and the others keep theirs.** Each field is\nnamed by its `id` and must apply to the asset — one of every workspace or of the asset's own,\nof every type of asset or of the asset's — and each value has the shape its field's `type`\ngives it, the shape the asset's `custom_fields` reads it back in. `null` empties a field, except\na `required` one. A value is held to the field's own rules — a text's length, a number's bounds,\nan option the field still offers — and a request any of whose values is refused writes nothing.\nA field of type `record`, `json` or `file` is not written here yet.\n\nThe answer is the whole asset, as `GET /v1/assets/{asset_id}` answers it; its `updated_at` does\nnot move. Sending the values the asset already holds changes nothing. The last request to arrive\nwins. An asset the organization has validated in its shared pool is refused: only that pool's\nmoderators can change it, from Videas.","operationId":"asset_custom_fields_update","parameters":[{"name":"asset_id","in":"path","description":"The asset's `id`.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAssetCustomFieldsRequest"}}},"required":true},"responses":{"200":{"description":"The asset as it now is, as `GET /v1/assets/{asset_id}` answers it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetView"}}}},"400":{"description":"More than 200 values, or a field named twice; a field that does not apply to this asset — confined to another workspace, or to other types of asset; a field of type `record`, `json` or `file`; a value not of its field's type or shape, past its field's rules or larger than 256 KiB; an option the field does not offer; `null` on a required field; an `asset_id` that is not a uuid; or any query parameter — this endpoint takes none. The message names the field, by its `slug` or its `id`. Nothing is written.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `assets.library.edit`; or the asset is validated in the organization's shared pool, and only that pool's moderators can change it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"No asset `GET /v1/assets` lists has this `id`, or no field `GET /v1/custom-fields` lists has one of the `field_id`s — the message names it. Nothing is written.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"The body is not sent as `application/json`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"The body is not this request: `values` missing or not a list, an entry without its `field_id` or its `value`, a `field_id` that is not a uuid, or a field this body does not list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/assets/{asset_id}/embed":{"post":{"tags":["assets"],"summary":"Get the asset's embed.","description":"The asset's default embed, created when it has none yet: public and active. Put its `id` in the\nloader's `data-embed`, or `embed_url` in an `iframe`. **Idempotent**: every call answers the\nsame embed until the organization deletes it or makes another one the default, so store the\n`id` and send this again only to check it. The organization keeps control of it from Videas:\nwhen it restricted the embed to some domains, put it behind a credential or switched it off, the\nembed is answered as it is — `access` and `active` say so.","operationId":"asset_embed_ensure","parameters":[{"name":"asset_id","in":"path","description":"The asset's `id`.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The asset already had a default embed; this is it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbedView"}}}},"201":{"description":"The asset had no default embed; this one was just created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbedView"}}}},"400":{"description":"An `asset_id` that is not a uuid, any query parameter — this endpoint takes none —, or an asset of a type no player renders.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `assets.library.embed`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"No such asset in the organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"The organization made another embed the default at the same moment. Send the request again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/assets/{asset_id}/tags":{"put":{"tags":["assets"],"summary":"Set the tags an asset is filed under.","description":"**The tags you send replace the asset's tags, except those this product attaches itself**,\nwhich stay whatever you send — the answer carries them beside yours. An empty list takes off\nevery tag you can set. A word naming one of the tags this product attaches itself changes\nnothing where the asset already carries it, and is refused where it does not: only this\nproduct puts those on.\n\nA word is matched to a tag by its letters and digits: case and accents do not count, and any\nrun of spaces or punctuation is one separator, so `Carbon fibre`, `carbon-fibre` and\n`CARBON FIBRE` are one tag. A word is looked for first among the tags of the asset's workspace,\nthen among the organization's own; one that matches neither becomes a new tag of the\norganization, named as you wrote it, and a tag that already exists keeps its own spelling.\n\nA workspace may file its assets only under the tags it already has: there, a word that matches\nno tag is refused, and nothing changes.\n\nThe answer is the whole asset, as `GET /v1/assets/{asset_id}` answers it, its tags ordered by\nname; its `updated_at` does not move. Sending the tags the asset already has changes nothing.\nThe last request to arrive wins.\nAn asset the organization has validated in its shared pool is refused: only that pool's\nmoderators can change it, from Videas.","operationId":"asset_tags_set","parameters":[{"name":"asset_id","in":"path","description":"The asset's `id`.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetAssetTagsRequest"}}},"required":true},"responses":{"200":{"description":"The asset as it now is, as `GET /v1/assets/{asset_id}` answers it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetView"}}}},"400":{"description":"More than 100 words; a blank word, or one longer than 100 characters, named by its position from 0; a word with no Latin letter or digit; a word naming a tag this product attaches itself, which the asset does not carry; a word that matches no tag while the asset's workspace files its assets only under the tags it already has — the message quotes the first ten such words and counts the rest; an `asset_id` that is not a uuid; or any query parameter — this endpoint takes none.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `assets.library.edit`; or the asset is validated in the organization's shared pool, and only that pool's moderators can change it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"No asset `GET /v1/assets` lists has this `id`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"A tag being created for one of these words was deleted at the same moment. Send the request again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"The body is not sent as `application/json`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"The body is not this request: `tags` missing or not a list of strings, or a field this body does not list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/assets/{asset_id}/thumbnail":{"put":{"tags":["assets"],"summary":"Choose an asset's picture, sending it.","description":"The body is the picture itself — a JPEG, a PNG or a WebP of at most 10 MiB — with a\n`Content-Type` naming which. It becomes the picture the asset is shown as, in Videas and on its\nchannels, and the one its `thumbnail_url` answers from now on. The answer is the whole asset, as\n`GET /v1/assets/{asset_id}` answers it.\n\nSending the picture the asset is already shown with changes nothing — not even its\n`updated_at`. The last request to arrive wins. An asset the organization has validated in its\nshared pool is refused: only that pool's moderators can change it, from Videas.","operationId":"asset_thumbnail_set","parameters":[{"name":"asset_id","in":"path","description":"The asset's `id`.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"description":"The picture, as the whole body: a JPEG, a PNG or a WebP of at most 10 MiB, its `Content-Type` naming which.","content":{"image/jpeg":{"schema":{"type":"string"}},"image/png":{"schema":{"type":"string"}},"image/webp":{"schema":{"type":"string"}}},"required":true},"responses":{"200":{"description":"The asset as it now is, as `GET /v1/assets/{asset_id}` answers it; its `thumbnail_url` answers the picture sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetView"}}}},"400":{"description":"Bytes that are not a JPEG, a PNG or a WebP picture, or not the one the `Content-Type` names; an `asset_id` that is not a uuid; or any query parameter — this endpoint takes none.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `assets.library.edit`; or the asset is validated in the organization's shared pool, and only that pool's moderators can change it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"No asset `GET /v1/assets` lists has this `id`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"413":{"description":"The picture is larger than 10 MiB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"The body is not sent as `image/jpeg`, `image/png` or `image/webp`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/categories":{"get":{"tags":["categories"],"summary":"List the categories of the organization's channels.","description":"Every category of every channel of the organization — or of the one `channel_id` names —\nincluding those switched off, as a flat list. **The list is in the order the categories were\ncreated**, oldest first or newest first with `order=desc`, which is not the order a channel\nshows them in: rebuild each channel's tree from `parent_id` (`null` at the root), and sort the\ncategories sharing a parent by `position`, then by `name`. Page with `next`: send it back as\n`after` until it is `null`.","operationId":"categories_list","parameters":[{"name":"channel_id","in":"query","description":"Only the categories of this channel — **one** channel's `id`. A channel of no concern to\nthis organization matches nothing. Absent, the categories of every channel.","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","description":"How many items to return, at most. A value above the operation's maximum, or below 1, is\nbrought into range rather than refused.","required":false,"schema":{"type":"integer","format":"int64"},"example":50},{"name":"after","in":"query","description":"The `next` of a previous page. Absent, the list starts from its beginning.","required":false,"schema":{"type":"string"}},{"name":"order","in":"query","description":"`asc` (the default) or `desc`: the list in its order, or reversed. Unless the operation\nsays otherwise, its order is oldest first.","required":false,"schema":{"type":"string","description":"The direction a list is read in: `asc` from its first item, `desc` from its last.","enum":["asc","desc"]},"example":"asc"}],"responses":{"200":{"description":"One page of the categories, and the cursor of the next page — `null` on the last one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_CategorySummary"}}}},"400":{"description":"A `channel_id` that is not one uuid, a key given twice or one this endpoint does not list, a `limit` that is not a whole number, an `order` other than `asc` or `desc`, or an `after` this endpoint did not issue.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `websites.catalogue.read` — or the organization does not publish channels, which takes that permission from every key it holds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/categories/count":{"get":{"tags":["categories"],"summary":"Count the categories of the organization's channels.","description":"How many categories `GET /v1/categories` would list under the same `channel_id` — counted when\nasked.","operationId":"categories_count","parameters":[{"name":"channel_id","in":"query","description":"Only the categories of this channel — **one** channel's `id`. A channel of no concern to\nthis organization matches nothing. Absent, the categories of every channel.","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"How many categories the listing would answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryCount"}}}},"400":{"description":"A `channel_id` that is not one uuid, or a key given twice or one this endpoint does not list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `websites.catalogue.read` — or the organization does not publish channels, which takes that permission from every key it holds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/channels":{"get":{"tags":["channels"],"summary":"List the organization's channels.","description":"Every channel of the organization, online or not, oldest first — or newest first with\n`order=desc`. Page with `next`: send it back as `after` until it is `null`. Each channel's\ncategories are listed by `GET /v1/categories?channel_id=`.","operationId":"channels_list","parameters":[{"name":"limit","in":"query","description":"How many items to return, at most. A value above the operation's maximum, or below 1, is\nbrought into range rather than refused.","required":false,"schema":{"type":"integer","format":"int64"},"example":50},{"name":"after","in":"query","description":"The `next` of a previous page. Absent, the list starts from its beginning.","required":false,"schema":{"type":"string"}},{"name":"order","in":"query","description":"`asc` (the default) or `desc`: the list in its order, or reversed. Unless the operation\nsays otherwise, its order is oldest first.","required":false,"schema":{"type":"string","description":"The direction a list is read in: `asc` from its first item, `desc` from its last.","enum":["asc","desc"]},"example":"asc"}],"responses":{"200":{"description":"One page of the organization's channels, and the cursor of the next page — `null` on the last one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_ChannelSummary"}}}},"400":{"description":"A key given twice or one this endpoint does not list, a `limit` that is not a whole number, an `order` other than `asc` or `desc`, or an `after` this endpoint did not issue.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `websites.catalogue.read` — or the organization does not publish channels, which takes that permission from every key it holds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/channels/count":{"get":{"tags":["channels"],"summary":"Count the organization's channels.","description":"How many channels `GET /v1/channels` would list — counted when asked.","operationId":"channels_count","parameters":[],"responses":{"200":{"description":"How many channels the listing would answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelCount"}}}},"400":{"description":"Any query parameter: this endpoint takes none.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `websites.catalogue.read` — or the organization does not publish channels, which takes that permission from every key it holds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/channels/{channel_id}":{"get":{"tags":["channels"],"summary":"Read one channel of the organization.","description":"Everything `GET /v1/channels` answers about it. An `id` the listing would not answer — a\ndeleted channel, one of another organization — is a `404`, like an `id` that names nothing.","operationId":"channel_read","parameters":[{"name":"channel_id","in":"path","description":"The channel's `id`.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The channel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelView"}}}},"400":{"description":"A `channel_id` that is not a uuid, or any query parameter: this endpoint takes none.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `websites.catalogue.read` — or the organization does not publish channels, which takes that permission from every key it holds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"No channel the listing answers has this `id`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/collections":{"get":{"tags":["collections"],"summary":"List the organization's collections.","description":"Every collection of the organization's library — a list of its assets played one after the\nother, such as a playlist — that is visible, in every workspace, oldest first, or newest first\nwith `order=desc`. Each is in one workspace, its `workspace_id`. Page with `next`: send it back\nas `after` until it is `null`. `tag` narrows the list to the collections filed under any of\nthe words given, and `GET /v1/collections/count` counts it under the same filter. A\ncollection's tags are on its read, and what it plays on\n`GET /v1/collections/{collection_id}/items`.","operationId":"collections_list","parameters":[{"name":"tag","in":"query","description":"Only the collections filed under at least one of these tags, **one `tag` per word**:\n`?tag=shared&tag=platform:heliaq`. A word is matched as `PUT /v1/assets/{asset_id}/tags`\nmatches one — case, accents and punctuation do not count, so `Platform HELIAQ` names the\nsame tag as `platform:heliaq` — and only a tag the collection's read answers counts. At\nmost 100 words, each at most 100 characters once the spaces around it are trimmed, never\nblank, and holding at least one Latin letter or digit. A word no tag carries matches\nnothing. Absent, every collection.","required":false,"schema":{"type":"array","items":{"type":"string"},"maxItems":100},"style":"form","explode":true},{"name":"limit","in":"query","description":"How many items to return, at most. A value above the operation's maximum, or below 1, is\nbrought into range rather than refused.","required":false,"schema":{"type":"integer","format":"int64"},"example":50},{"name":"after","in":"query","description":"The `next` of a previous page. Absent, the list starts from its beginning.","required":false,"schema":{"type":"string"}},{"name":"order","in":"query","description":"`asc` (the default) or `desc`: the list in its order, or reversed. Unless the operation\nsays otherwise, its order is oldest first.","required":false,"schema":{"type":"string","description":"The direction a list is read in: `asc` from its first item, `desc` from its last.","enum":["asc","desc"]},"example":"asc"}],"responses":{"200":{"description":"One page of the organization's collections, and the cursor of the next page — `null` on the last one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_CollectionSummary"}}}},"400":{"description":"More than 100 `tag`, a blank one, one longer than 100 characters or one with no letter or digit; a key given twice but `tag`, or one this endpoint does not list; a `limit` that is not a whole number, an `order` other than `asc` or `desc`, or an `after` this endpoint did not issue.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `assets.library.read`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/collections/count":{"get":{"tags":["collections"],"summary":"Count the organization's collections.","description":"How many collections `GET /v1/collections` would list under the same `tag` — counted when\nasked, so a listing begun afterwards may meet collections created or deleted since.","operationId":"collections_count","parameters":[{"name":"tag","in":"query","description":"Only the collections filed under at least one of these tags, **one `tag` per word**:\n`?tag=shared&tag=platform:heliaq`. A word is matched as `PUT /v1/assets/{asset_id}/tags`\nmatches one — case, accents and punctuation do not count, so `Platform HELIAQ` names the\nsame tag as `platform:heliaq` — and only a tag the collection's read answers counts. At\nmost 100 words, each at most 100 characters once the spaces around it are trimmed, never\nblank, and holding at least one Latin letter or digit. A word no tag carries matches\nnothing. Absent, every collection.","required":false,"schema":{"type":"array","items":{"type":"string"},"maxItems":100},"style":"form","explode":true}],"responses":{"200":{"description":"How many collections the listing would answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionCount"}}}},"400":{"description":"More than 100 `tag`, a blank one, one longer than 100 characters or one with no letter or digit; or a key given twice but `tag`, or one this endpoint does not list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `assets.library.read`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/collections/{collection_id}":{"get":{"tags":["collections"],"summary":"Read one collection of the organization.","description":"Everything `GET /v1/collections` answers about it, and its tags. An `id` the listing would not\nanswer — an asset that is not a collection, a hidden collection, one of another organization —\nis a `404`, like an `id` that names nothing.","operationId":"collection_read","parameters":[{"name":"collection_id","in":"path","description":"The collection's `id`.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The collection.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionView"}}}},"400":{"description":"A `collection_id` that is not a uuid, or any query parameter: this endpoint takes none.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `assets.library.read`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"No collection the listing answers has this `id`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/collections/{collection_id}/embed":{"post":{"tags":["collections"],"summary":"Get the collection's embed.","description":"The collection's default embed, which plays its items in order, created when it has none yet —\nthe same answer and the same rules as an asset's.","operationId":"collection_embed_ensure","parameters":[{"name":"collection_id","in":"path","description":"The collection's `id`.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The collection already had a default embed; this is it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbedView"}}}},"201":{"description":"The collection had no default embed; this one was just created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbedView"}}}},"400":{"description":"A `collection_id` that is not a uuid, or any query parameter: this endpoint takes none.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `assets.library.embed`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"No such collection in the organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"The organization made another embed the default at the same moment. Send the request again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/collections/{collection_id}/items":{"get":{"tags":["collections"],"summary":"List what a collection plays.","description":"Its items, each an asset as `GET /v1/assets` answers it and its `position`: where it comes when\nthe collection is played, from `0`. **Sort by `position` to play them**: the list itself is in\nthe order of its assets' `created_at`, then `id` — reversed with `order=desc` — like every list\nof this API, so that a walk of several pages never skips or repeats an item, even while the\ncollection changes. Page with `next`: send it back as `after` until it is `null`.\n\nAn entry whose asset `GET /v1/assets` would not answer, such as an asset hidden from the\nlibrary, is not listed, and the positions count only the items listed. A collection Videas\nfills by rules lists what its rules select when it is read.","operationId":"collection_items_list","parameters":[{"name":"collection_id","in":"path","description":"The collection's `id`.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","description":"How many items to return, at most. A value above the operation's maximum, or below 1, is\nbrought into range rather than refused.","required":false,"schema":{"type":"integer","format":"int64"},"example":50},{"name":"after","in":"query","description":"The `next` of a previous page. Absent, the list starts from its beginning.","required":false,"schema":{"type":"string"}},{"name":"order","in":"query","description":"`asc` (the default) or `desc`: the list in its order, or reversed. Unless the operation\nsays otherwise, its order is oldest first.","required":false,"schema":{"type":"string","description":"The direction a list is read in: `asc` from its first item, `desc` from its last.","enum":["asc","desc"]},"example":"asc"}],"responses":{"200":{"description":"One page of the collection's items, and the cursor of the next page — `null` on the last one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_CollectionItem"}}}},"400":{"description":"A `collection_id` that is not a uuid, a key given twice or one this endpoint does not list, a `limit` that is not a whole number, an `order` other than `asc` or `desc`, or an `after` this endpoint did not issue.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `assets.library.read`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"No collection `GET /v1/collections` lists has this `id`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/connect/exchange":{"post":{"tags":["integrations"],"summary":"Exchange the one-time code for the key.","description":"Call it from your integration's server, within sixty seconds of the approval, with the `code`\nthe approval appended to your redirect URI and the verifier whose `S256` challenge opened the\nhandshake. It takes no credential: the code and the verifier are what authorize it, and a\ncookie sent along is ignored.\n\nThe answer carries the key, which no other response will ever carry again: store it, and\npresent it as `Authorization: Bearer` from then on.\n\nA code is collected once, and an answer that reads it ends it, whatever that answer says:\nthe `200`, a `400` refusing the code, its verifier or the permissions it was approved for,\nand the `404`. After such a refusal, open a new handshake. An answer given before the code is\nread leaves it as it was, collectable within its sixty seconds: the `429`, and a `400`,\n`413`, `415` or `422` refusing the request itself — a body that is not this operation's JSON\nobject. So does a `5xx`, unless the key was made and only its answer was lost, in which case\nthe next attempt is a `400`.","operationId":"connect_exchange","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExchangeRequest"}}},"required":true},"responses":{"200":{"description":"The credential, handed over exactly once","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExchangeResponse"}}}},"400":{"description":"The code refused — unknown, already collected, more than sixty seconds after the approval, denied or lapsed, or presented with a verifier that is not the one, indistinguishable on purpose — or a permission it was approved for that a key may no longer carry. The code is ended: open a new handshake. A body that is not this operation's JSON object is a `400` too, which reads no code and leaves it as it was","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"The right code and the right verifier, for an organization whose integrations were turned off after the code was approved. The code is spent, and no new handshake for that organization can be approved until they are on again","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"Too many handshakes from this source address recently. The code is not read, and stays collectable within its sixty seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}},"security":[{}]}},"/v1/custom-fields":{"get":{"tags":["custom-fields"],"summary":"List the organization's custom fields.","description":"The fields the organization added to its library — what an asset may carry beside its name and\nits description — each with where it applies: to every workspace or to one, to every type of\nasset or to some. Oldest first, or newest first with `order=desc`. Page with `next`: send it\nback as `after` until it is `null`. An asset's values are read in its `custom_fields` and written\nwith `PATCH /v1/assets/{asset_id}/custom-fields`; a `choice` field's options are listed by\n`GET /v1/custom-fields/{field_id}/choices`.","operationId":"custom_fields_list","parameters":[{"name":"limit","in":"query","description":"How many items to return, at most. A value above the operation's maximum, or below 1, is\nbrought into range rather than refused.","required":false,"schema":{"type":"integer","format":"int64"},"example":50},{"name":"after","in":"query","description":"The `next` of a previous page. Absent, the list starts from its beginning.","required":false,"schema":{"type":"string"}},{"name":"order","in":"query","description":"`asc` (the default) or `desc`: the list in its order, or reversed. Unless the operation\nsays otherwise, its order is oldest first.","required":false,"schema":{"type":"string","description":"The direction a list is read in: `asc` from its first item, `desc` from its last.","enum":["asc","desc"]},"example":"asc"}],"responses":{"200":{"description":"One page of the organization's custom fields, and the cursor of the next page — `null` on the last one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_CustomFieldSummary"}}}},"400":{"description":"A key given twice or one this endpoint does not list, a `limit` that is not a whole number, an `order` other than `asc` or `desc`, or an `after` this endpoint did not issue.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `assets.library.read`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/custom-fields/count":{"get":{"tags":["custom-fields"],"summary":"Count the organization's custom fields.","description":"How many custom fields `GET /v1/custom-fields` would list — counted when asked.","operationId":"custom_fields_count","parameters":[],"responses":{"200":{"description":"How many custom fields the listing would answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomFieldCount"}}}},"400":{"description":"Any query parameter: this endpoint takes none.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `assets.library.read`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/custom-fields/{field_id}/choices":{"get":{"tags":["custom-fields"],"summary":"List the options of a `choice` field.","description":"The options a value of the field may hold, each an `id` and the `label` a person reads for it.\nA value of a `choice` field holds ids, and a write sends ids: read this list to find the `id`\nthat stands for an option you know by its label, and the label an asset's value stands for. A\nfield may offer thousands, which is why they are a list of their own rather than part of the\nfield. Oldest first, or newest first with `order=desc`, which is not the order a form shows\nthem in: sort them yourself if you show them. Page with `next`: send it back as `after` until it\nis `null`.\n\nAn option withdrawn from the field is not listed, and cannot be chosen any more; an asset that\nchose it before keeps it, reads it back by its `id`, and may be sent it again.","operationId":"custom_field_choices_list","parameters":[{"name":"field_id","in":"path","description":"The field's `id`: one of `GET /v1/custom-fields` of type `choice`.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","description":"How many items to return, at most. A value above the operation's maximum, or below 1, is\nbrought into range rather than refused.","required":false,"schema":{"type":"integer","format":"int64"},"example":50},{"name":"after","in":"query","description":"The `next` of a previous page. Absent, the list starts from its beginning.","required":false,"schema":{"type":"string"}},{"name":"order","in":"query","description":"`asc` (the default) or `desc`: the list in its order, or reversed. Unless the operation\nsays otherwise, its order is oldest first.","required":false,"schema":{"type":"string","description":"The direction a list is read in: `asc` from its first item, `desc` from its last.","enum":["asc","desc"]},"example":"asc"}],"responses":{"200":{"description":"One page of the field's options, and the cursor of the next page — `null` on the last one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_CustomFieldChoiceSummary"}}}},"400":{"description":"A `field_id` that is not a uuid, a key given twice or one this endpoint does not list, a `limit` that is not a whole number, an `order` other than `asc` or `desc`, or an `after` this endpoint did not issue.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `assets.library.read`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"No field of type `choice` that `GET /v1/custom-fields` lists has this `id`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/custom-fields/{field_id}/choices/count":{"get":{"tags":["custom-fields"],"summary":"Count the options of a `choice` field.","description":"How many options `GET /v1/custom-fields/{field_id}/choices` would list — counted when asked.","operationId":"custom_field_choices_count","parameters":[{"name":"field_id","in":"path","description":"The field's `id`: one of `GET /v1/custom-fields` of type `choice`.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"How many options the listing would answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomFieldChoiceCount"}}}},"400":{"description":"A `field_id` that is not a uuid, or any query parameter: this endpoint takes none.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `assets.library.read`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"No field of type `choice` that `GET /v1/custom-fields` lists has this `id`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/folders":{"post":{"tags":["workspaces"],"summary":"Make a folder.","description":"Creates the folder in `workspace_id`'s tree: directly under the folder `parent_id` names, or at\nthe workspace's root without one. **This request is not idempotent**: sent twice, it makes two\nfolders, and two folders may have the same name — after a timeout or a `5xx`, look for it in\n`GET /v1/workspaces/{workspace_id}/folders` before sending it again.","operationId":"folders_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFolderRequest"}}},"required":true},"responses":{"201":{"description":"The folder, as `GET /v1/folders/{folder_id}` answers it. `Location` is its address on this API.","headers":{"location":{"schema":{"type":"string"},"description":"`/v1/folders/{folder_id}`."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderView"}}}},"400":{"description":"A blank `name`, a `name` longer than 500 characters or a `description` longer than 50000; or any query parameter — this endpoint takes none. The message names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `assets.library.upload`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"No live workspace of this organization has this `workspace_id`, or no folder `GET /v1/workspaces/{workspace_id}/folders` lists has this `parent_id`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"The body is not sent as `application/json`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"The body is not this request: `workspace_id` or `name` missing, a field of the wrong type, or a field this body does not list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/folders/{folder_id}":{"get":{"tags":["workspaces"],"summary":"Get a folder.","description":"One folder of the organization, as its workspace's listing answers it.","operationId":"folder_read","parameters":[{"name":"folder_id","in":"path","description":"The folder's `id`.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The folder.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderView"}}}},"400":{"description":"A `folder_id` that is not a uuid, or any query parameter: this endpoint takes none.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `assets.library.read`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"No folder `GET /v1/workspaces/{workspace_id}/folders` lists has this `id`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/publications":{"get":{"tags":["publications"],"summary":"List what the organization's channels publish.","description":"Every publication of every channel of the organization — whatever its status — whose asset\n`GET /v1/assets` lists, oldest first, or newest first with `order=desc`. Page with `next`: send\nit back as `after` until it is `null`. `channel_id`, `asset_id` and `status` narrow the list,\nand `GET /v1/publications/count` counts it under the same filters; `?asset_id=` answers where an\nasset is published, and with `channel_id` beside it whether it is published there.","operationId":"publications_list","parameters":[{"name":"channel_id","in":"query","description":"Only the publications of this channel — **one** channel's `id`. A channel of no concern to\nthis organization matches nothing. Absent, every channel's.","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"asset_id","in":"query","description":"Only the publications of this asset — **one** asset's `id`: where it is published. An\nasset of no concern to this organization matches nothing. Absent, every asset's. With\n`channel_id`, the one publication of that asset on that channel, if there is one.","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"status","in":"query","description":"Only these statuses, as one `status` whose values are separated by commas:\n`?status=draft,published`. Absent, every status.","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/PublicationStatus"}},"style":"form","explode":false},{"name":"limit","in":"query","description":"How many items to return, at most. A value above the operation's maximum, or below 1, is\nbrought into range rather than refused.","required":false,"schema":{"type":"integer","format":"int64"},"example":50},{"name":"after","in":"query","description":"The `next` of a previous page. Absent, the list starts from its beginning.","required":false,"schema":{"type":"string"}},{"name":"order","in":"query","description":"`asc` (the default) or `desc`: the list in its order, or reversed. Unless the operation\nsays otherwise, its order is oldest first.","required":false,"schema":{"type":"string","description":"The direction a list is read in: `asc` from its first item, `desc` from its last.","enum":["asc","desc"]},"example":"asc"}],"responses":{"200":{"description":"One page of the publications, and the cursor of the next page — `null` on the last one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_PublicationSummary"}}}},"400":{"description":"A `channel_id` or an `asset_id` that is not one uuid, a `status` entry that names no status, a key given twice or one this endpoint does not list, a `limit` that is not a whole number, an `order` other than `asc` or `desc`, or an `after` this endpoint did not issue.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `websites.catalogue.read` — or the organization does not publish channels, which takes that permission from every key it holds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}},"post":{"tags":["publications"],"summary":"Publish an asset on one of the organization's channels.","description":"The asset must be `ready`; it is published at most once on a channel. **Who it is for** is\n`access`: `public` — anybody the channel lets in — or `authenticated` — anybody who signed in to\nthe channel or gave its password. **Absent, the channel decides**: on a channel whose visitors\nopen an account themselves and whose site is otherwise open, a new publication asks for that\naccount; on any other channel it is open to everyone the channel lets in. **Created\n`authenticated`, whether sent so or given so by the channel, it is shown locked**: it still\nshows itself to the visitors it is not for, and playing it asks them to sign in. Either way it\nis the publication's own level: a channel that asks every visitor to sign in still does.\n\nCreated as a `draft` unless `status` says `published`: the channel shows it from `published_at`\n— now, unless a date is sent; a date in the future schedules it. Filed in `category_ids`, last\nin each, with `primary_category_id` as its main category.\n\n**Sent twice, the second request is refused with a `409`**: an asset is published once on a\nchannel. After a timeout or a `5xx`, look for the first with\n`GET /v1/publications?channel_id=…&asset_id=…` before sending it again.","operationId":"publications_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePublicationRequest"}}},"required":true},"responses":{"201":{"description":"The publication, as `GET /v1/publications/{publication_id}` answers it. `Location` is its address on this API.","headers":{"location":{"schema":{"type":"string"},"description":"`/v1/publications/{publication_id}`."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicationView"}}}},"400":{"description":"A `status` of `archived`, or a `published_at` with a draft; a `slug` that is not lowercase words joined by hyphens, is longer than 255 characters, or is an address the channel's own site answers itself; an asset of a kind a channel does not publish; more than 100 `category_ids`, one that is not a category of the channel, or a `primary_category_id` that is not one of them; an `access` other than `public` or `authenticated` — `restricted`, `paid` and `on_request` are set from Videas; or any query parameter — this endpoint takes none. The message names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `websites.catalogue.publish` — or the organization does not publish channels, which takes that permission from every key it holds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"No channel `GET /v1/channels` lists has this `channel_id`, or no asset `GET /v1/assets` lists has this `asset_id`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"The channel already publishes this asset — `GET /v1/publications?channel_id=…&asset_id=…` answers its publication; the asset is not `ready` yet — send the request again once it is; the `slug` is taken by another publication or by a page of the channel (the message names the address); or the organization's channels are still being moved to Videas, and are changed from the platform they are moving from until the move is complete.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"The body is not sent as `application/json`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"The body is not this request: `channel_id` or `asset_id` missing, a field of the wrong type, a `status` that names no status, an `access` that names no level, or a field this body does not list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/publications/count":{"get":{"tags":["publications"],"summary":"Count what the organization's channels publish.","description":"How many publications `GET /v1/publications` would list under the same `channel_id`, `asset_id`\nand `status` — counted when asked.","operationId":"publications_count","parameters":[{"name":"channel_id","in":"query","description":"Only the publications of this channel — **one** channel's `id`. A channel of no concern to\nthis organization matches nothing. Absent, every channel's.","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"asset_id","in":"query","description":"Only the publications of this asset — **one** asset's `id`: where it is published. An\nasset of no concern to this organization matches nothing. Absent, every asset's. With\n`channel_id`, the one publication of that asset on that channel, if there is one.","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"status","in":"query","description":"Only these statuses, as one `status` whose values are separated by commas:\n`?status=draft,published`. Absent, every status.","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/PublicationStatus"}},"style":"form","explode":false}],"responses":{"200":{"description":"How many publications the listing would answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicationCount"}}}},"400":{"description":"A `channel_id` or an `asset_id` that is not one uuid, a `status` entry that names no status, or a key given twice or one this endpoint does not list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `websites.catalogue.read` — or the organization does not publish channels, which takes that permission from every key it holds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/publications/{publication_id}":{"get":{"tags":["publications"],"summary":"Read one publication of the organization.","description":"Everything `GET /v1/publications` answers about it. An `id` the listing would not answer — a\npublication of another organization, one whose asset the library does not list — is a `404`,\nlike an `id` that names nothing.","operationId":"publication_read","parameters":[{"name":"publication_id","in":"path","description":"The publication's `id`.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The publication.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicationView"}}}},"400":{"description":"A `publication_id` that is not a uuid, or any query parameter: this endpoint takes none.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `websites.catalogue.read` — or the organization does not publish channels, which takes that permission from every key it holds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"No publication the listing answers has this `id`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}},"patch":{"tags":["publications"],"summary":"Change a publication.","description":"The fields you send are written, and the ones you leave out stay as they are; its channel and\nits asset never change. `status: published` puts it on the channel — at the `published_at`\nsent, else now, so one taken off and put back on comes back as new — and `draft` or `archived`\ntakes it off, keeping its date; a `published_at` sent alone moves the date of a published one.\nA new `slug` leaves the old address answering, sending visitors to the new one — unless the\npublication has never been published, since nobody could have reached the old one. `category_ids` replaces the categories it is\nfiled in: one it stays in keeps its place and its featuring, one it enters puts it last.\n`access` moves it between `public` and `authenticated`, and nothing else about who sees it; a\npublication that is `restricted`, `paid` or `on_request` is set from Videas, with the right or\nthe offer it stands for, and a request does not move it. The answer is the whole publication,\nas `GET /v1/publications/{publication_id}` answers it.\n\nSending what it already holds changes nothing — not even its `updated_at`. The last request to\narrive wins: nothing checks what it held when you last read it. There is no deletion: archive a\npublication to retire it, and rename its `slug` to free its address.","operationId":"publication_update","parameters":[{"name":"publication_id","in":"path","description":"The publication's `id`.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePublicationRequest"}}},"required":true},"responses":{"200":{"description":"The publication as it now is, as `GET /v1/publications/{publication_id}` answers it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicationView"}}}},"400":{"description":"`null` on a field that cannot be emptied; a `published_at` beside `status: draft` or `archived`, or sent alone to a publication that is not published; a `slug` that is not lowercase words joined by hyphens, is longer than 255 characters, or is an address the channel's own site answers itself; more than 100 `category_ids`, one that is not a category of the channel, or a `primary_category_id` that is not among the categories it is filed in; an `access` other than `public` or `authenticated` — `restricted`, `paid` and `on_request` are set from Videas; a `publication_id` that is not a uuid; or any query parameter — this endpoint takes none. The message names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `websites.catalogue.publish` — or the organization does not publish channels, which takes that permission from every key it holds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"No publication `GET /v1/publications` lists has this `id`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"The `slug` is taken by another publication or by a page of the channel (the message names the address); `access` would move a publication that is `restricted`, `paid` or `on_request` — those are set from Videas, with the right or the offer they stand for, and leaving one undoes it; or the organization's channels are still being moved to Videas, and are changed from the platform they are moving from until the move is complete.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"The body is not sent as `application/json`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"The body is not this request: a field of the wrong type, a `status` that names no status, an `access` that names no level, or a field this body does not list — among them the publication's `channel_id` and its `asset_id`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/uploads":{"post":{"tags":["uploads"],"summary":"Add a file to the library.","description":"Creates the asset at once — `uploading`, in `workspace_id`: directly in the folder `parent_id`\nnames, or at the workspace's root without one. **Send exactly one of\n`size_bytes` or `source_url`**: `size_bytes` means you send the file yourself, to `upload_url`,\ncarrying `upload_token` in `X-Upload-Token` — whole with one `PUT` when it is at most\n`max_put_bytes`, or with tus 1.0 core. `source_url` means we download the file from that link in\nthe background: the answer carries no address and no token, and `GET /v1/uploads/{upload_id}`\nsays how far the download got, or why it failed. A `source_url` is refused `429`, with\n`Retry-After`, while the organization already has as many links waiting or downloading as it\nmay — a backstop, which completed and failed uploads do not count against.\n\n**This request is not idempotent**: sent twice, it creates two assets. Set `external_ref` on\nevery one, and after a timeout or a `5xx` look it up with `GET /v1/assets?external_ref=` before\nsending it again — a link found that way is already being downloaded. For a file you send, the\nupload found that way cannot be resumed — its token was in the answer you lost — so open a new\none: the first asset ends `error` when its upload expires, which is what an `error` asset with\nno file is.","operationId":"uploads_create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUploadRequest"}}},"required":true},"responses":{"201":{"description":"The asset exists, `uploading`, and the upload is open: for `size_bytes`, send the file to `upload_url` with `upload_token` in `X-Upload-Token`; for `source_url`, the download is queued, and both are `null`. `Location` is the upload's own address on this API.","headers":{"location":{"schema":{"type":"string"},"description":"`/v1/uploads/{upload_id}`."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadCreated"}}}},"400":{"description":"Both `size_bytes` and `source_url`, or neither; a missing or blank `filename` with `size_bytes`; a field the source does not take; a blank `name` or `external_ref`; a `name` or an `external_ref` longer than 500 characters, or a `description` longer than 50000; a `language` that is not a BCP 47 tag; a `size_bytes` of zero or less — an empty file has nothing to store or to play, and is refused —; a `source_url` that is not an `http` or `https` link, carries a user name or a password, names `localhost` or an address that is not public, a port other than its scheme's, or a YouTube, Vimeo or Dailymotion page — the message names which; or any query parameter — this endpoint takes none.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"402":{"description":"The organization has no credit left, or not enough for the first month of storage of a file of `size_bytes`: nothing was created. Top up the credit, then send the request again. The first month of what an upload stores is charged once, and is not refunded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `assets.library.upload`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"No live workspace of this organization has this `workspace_id`, or no folder `GET /v1/workspaces/{workspace_id}/folders` lists has this `parent_id`: nothing was created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"413":{"description":"`size_bytes` is larger than a file may be.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"The body is not sent as `application/json`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"The body is not this request: `workspace_id` missing or not a uuid, a field of the wrong type, or a field this body does not list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/uploads/{upload_id}":{"get":{"tags":["uploads"],"summary":"Read one upload.","description":"Where it is and how far it got. Only an upload opened with an API key of this organization is\nanswered — whichever of its keys opened it; one opened elsewhere is a `404`. **The upload\ntoken is not answered**: it was in the answer that opened the upload, and only there.","operationId":"upload_read","parameters":[{"name":"upload_id","in":"path","description":"The upload's `id`.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The upload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Upload"}}}},"400":{"description":"An `upload_id` that is not a uuid, or any query parameter: this endpoint takes none.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `assets.library.upload`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"No upload opened with an API key of this organization has this `id`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}},"delete":{"tags":["uploads"],"summary":"Give up on an upload.","description":"For a file you send: the transfer is ended, what it received is released, and the asset ends\n`error`, as the tus termination on `upload_url` does. For a link: the download stops — at the\nnext part of the file, when it is running — what it received is released, the link is\nforgotten, and the asset ends `error`. An upload already `cancelled`, `expired` or `failed` is\nanswered `204` and left as it is; a `completed` one is a `409`, its file being the asset's now.","operationId":"upload_cancel","parameters":[{"name":"upload_id","in":"path","description":"The upload's `id`.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"The upload is `cancelled`, and its asset `error` — or it had already been cancelled, had expired or had failed."},"400":{"description":"An `upload_id` that is not a uuid, or any query parameter: this endpoint takes none.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `assets.library.upload`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"No upload opened with an API key of this organization has this `id`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"The upload is `completed`: its file is the asset's, and this is not the way to delete it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/workspaces":{"get":{"tags":["workspaces"],"summary":"List the organization's workspaces.","description":"Every workspace of the organization, oldest first — or newest first with `order=desc`: what an\nasset's `workspace_id` names. Page with `next`: send it back as `after` until it is `null`.","operationId":"workspaces_list","parameters":[{"name":"limit","in":"query","description":"How many items to return, at most. A value above the operation's maximum, or below 1, is\nbrought into range rather than refused.","required":false,"schema":{"type":"integer","format":"int64"},"example":50},{"name":"after","in":"query","description":"The `next` of a previous page. Absent, the list starts from its beginning.","required":false,"schema":{"type":"string"}},{"name":"order","in":"query","description":"`asc` (the default) or `desc`: the list in its order, or reversed. Unless the operation\nsays otherwise, its order is oldest first.","required":false,"schema":{"type":"string","description":"The direction a list is read in: `asc` from its first item, `desc` from its last.","enum":["asc","desc"]},"example":"asc"}],"responses":{"200":{"description":"One page of the organization's workspaces, and the cursor of the next page — `null` on the last one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_WorkspaceSummary"}}}},"400":{"description":"A key given twice or one this endpoint does not list, a `limit` that is not a whole number, an `order` other than `asc` or `desc`, or an `after` this endpoint did not issue.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `assets.library.read`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/workspaces/count":{"get":{"tags":["workspaces"],"summary":"Count the organization's workspaces.","description":"How many workspaces `GET /v1/workspaces` would list — counted when asked.","operationId":"workspaces_count","parameters":[],"responses":{"200":{"description":"How many workspaces the listing would answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceCount"}}}},"400":{"description":"Any query parameter: this endpoint takes none.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `assets.library.read`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/workspaces/{workspace_id}/folders":{"get":{"tags":["workspaces"],"summary":"List a workspace's folders.","description":"Every folder of the workspace's tree, flat, oldest first — or newest first with `order=desc`.\nEach names the folder it sits directly under, `parent_id`, or `null` at the root, so the tree is\nrebuilt from the whole walk. Page with `next`: send it back as `after` until it is `null`. A\nfolder's `id` is what `GET /v1/assets?parent=` takes to list what it holds.","operationId":"workspace_folders_list","parameters":[{"name":"workspace_id","in":"path","description":"The workspace's `id`.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","description":"How many items to return, at most. A value above the operation's maximum, or below 1, is\nbrought into range rather than refused.","required":false,"schema":{"type":"integer","format":"int64"},"example":50},{"name":"after","in":"query","description":"The `next` of a previous page. Absent, the list starts from its beginning.","required":false,"schema":{"type":"string"}},{"name":"order","in":"query","description":"`asc` (the default) or `desc`: the list in its order, or reversed. Unless the operation\nsays otherwise, its order is oldest first.","required":false,"schema":{"type":"string","description":"The direction a list is read in: `asc` from its first item, `desc` from its last.","enum":["asc","desc"]},"example":"asc"}],"responses":{"200":{"description":"One page of the workspace's folders, and the cursor of the next page — `null` on the last one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_FolderSummary"}}}},"400":{"description":"A `workspace_id` that is not a uuid, a key given twice or one this endpoint does not list, a `limit` that is not a whole number, an `order` other than `asc` or `desc`, or an `after` this endpoint did not issue.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `assets.library.read`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"No such workspace in the organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}},"/v1/workspaces/{workspace_id}/folders/count":{"get":{"tags":["workspaces"],"summary":"Count a workspace's folders.","description":"How many folders `GET /v1/workspaces/{workspace_id}/folders` would list — counted when asked.","operationId":"workspace_folders_count","parameters":[{"name":"workspace_id","in":"path","description":"The workspace's `id`.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"How many folders the listing would answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderCount"}}}},"400":{"description":"A `workspace_id` that is not a uuid, or any query parameter: this endpoint takes none.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No `Authorization: Bearer` header, or a key that is unknown, expired or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"The key does not carry `assets.library.read`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"No such workspace in the organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/TimedOut"}}}}},"components":{"schemas":{"AssetCount":{"type":"object","description":"How many assets the listing would answer under the same filter.","required":["count"],"properties":{"count":{"type":"integer","format":"int64","description":"Counted when asked: a listing begun afterwards may meet assets created or deleted since."}}},"AssetStatus":{"type":"string","description":"Where an asset is in its processing.\n\n`uploading` — its bytes are arriving; `processing` — they have arrived and are being worked\non; `awaiting_credit` — a video whose first month of storage the organization's credit could\nnot pay, so nothing of it is encoded yet: it resumes once the credit covers it, and is deleted\nafter seven days still waiting; `ready` — it can be played, although work may still go on\nbehind it; `error` — the work ended with nothing playable. **The list may grow**, like\n`AssetType`'s.","enum":["uploading","processing","awaiting_credit","ready","error"]},"AssetSummary":{"type":"object","description":"One asset of the organization's library.","required":["id","name","type","status","workspace_id","parent_id","description","external_ref","language","duration_ms","created_at","updated_at","third_party","thumbnail_url"],"properties":{"created_at":{"type":"string","format":"date-time","description":"When it was created (RFC 3339). Lists are ordered by this instant, then by `id`."},"description":{"type":["string","null"],"description":"Its description, as the organization wrote it; `null` when it has none."},"duration_ms":{"type":["integer","null"],"format":"int64","description":"Its running time in milliseconds, for a video or a sound; `null` when it has none or it is\nnot known yet."},"external_ref":{"type":["string","null"],"description":"**Your** identifier for this asset, when the organization recorded one — the field that\nmaps an asset of ours to a record of yours. Not unique; `null` when unset."},"id":{"type":"string","format":"uuid","description":"The asset's identifier — stable for its whole life, and the one to store."},"language":{"type":["string","null"],"description":"The language of its content, as a BCP 47 tag (`fr`, `en-GB`); `null` when unknown."},"name":{"type":"string","description":"Its title, as the organization wrote it. Never empty."},"parent_id":{"type":["string","null"],"format":"uuid","description":"The folder of that workspace it sits directly in — the `id` of one of\n`GET /v1/workspaces/{workspace_id}/folders`, what `GET /v1/assets?parent=` takes — or `null`\nat the workspace's root."},"status":{"$ref":"#/components/schemas/AssetStatus","description":"Where it is in its processing: only a `ready` asset can be played."},"third_party":{"oneOf":[{"$ref":"#/components/schemas/ThirdPartyVideo","description":"**For an asset of `type` `third_party`**, the video it plays from another provider's site;\n`null` for every other type."},{"type":"null"}]},"thumbnail_url":{"type":["string","null"],"format":"uri","description":"The address of its picture — the one the organization chose to show it with, else the one\nVideas picked for it — as a JPEG at its own size, at most 3840 pixels a side; `null` while\nit has none.\n\n**Stable and anonymous**: it needs no key, can be put as it is in a web page's `<img>`, and\ngoes on answering the asset's picture when another one is chosen, so store the address\nrather than the bytes. Its answers may be held for a few minutes and carry an `ETag`.\n\nThe same address gives other sizes and formats with its last segment changed:\n`thumbnail.webp` or `thumbnail.png` for the picture at its own size, and\n`{fit}-{width}x{height}.{ext}` for one fitted to a box — `fit` `cover` (filling the box,\ncropped to it) or `contain` (inside it, never cropped), `ext` `jpg`, `webp` or `png` — such\nas `cover-320x180.jpg` or `contain-1280x720.webp`. A box it does not keep is redirected\n(`308`) to the smallest one it keeps that covers it. A picture is never enlarged.\n\nIt answers `404` once the asset is deleted or hidden, or no longer has a picture."},"type":{"$ref":"#/components/schemas/AssetType","description":"What kind of thing it is."},"updated_at":{"type":"string","format":"date-time","description":"When anything about it last changed (RFC 3339) — but for its folder, its tags and its\ncustom fields: moving it or setting them does not move it."},"workspace_id":{"type":"string","format":"uuid","description":"The workspace it is in — the `id` of one of `GET /v1/workspaces`. An asset is in exactly\none here, whatever else the organization files it under."}}},"AssetType":{"type":"string","description":"What kind of thing an asset is.\n\n**The list may grow**: a client should read a value it does not know as *a kind this client\ndoes not handle*, not as an error.","enum":["video","audio","image","document","archive","file","subtitles","third_party","other"]},"AssetView":{"allOf":[{"$ref":"#/components/schemas/AssetSummary"},{"type":"object","required":["excerpt","copyright","seo_title","seo_description","tags","custom_fields"],"properties":{"copyright":{"type":["string","null"],"description":"The notice a reuser of it has to carry — who holds its rights, under what terms — as the\norganization wrote it; `null` when it has none."},"custom_fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomFieldValueEntry"},"description":"Its values of the organization's custom fields — of those that apply to it, by its\nworkspace and its type (`GET /v1/custom-fields` says where each applies) — in the order a\nform lays them out; empty when it has none. A field it holds no value of is not in the list.\nA field of type `record`, `json` or `file` is not read here yet."},"excerpt":{"type":["string","null"],"description":"A short summary of it, as the organization wrote it — what a listing shows under its name\nwhere the description would not fit; `null` when it has none."},"seo_description":{"type":["string","null"],"description":"The description a web page publishing it gives search engines and link previews, where the\norganization wrote one; `null` when it has none, and such a page then describes it with its\n`excerpt`, else its `description`."},"seo_title":{"type":["string","null"],"description":"The title a web page publishing it gives itself — in a browser's tab and a search engine's\nresults — where the organization wrote one; `null` when it has none, and such a page is then\ntitled with its `name`."},"tags":{"type":"array","items":{"$ref":"#/components/schemas/TagSummary"},"description":"The tags the organization files it under, ordered by name; empty when it has none. A tag a\nmachine suggested and nobody confirmed is not one of them."}}}],"description":"One asset of the organization's library, read by its `id`: every field a listing answers about\nit, under the same names, and the ones a listing leaves out."},"CategoryCount":{"type":"object","description":"How many categories the listing would answer.","required":["count"],"properties":{"count":{"type":"integer","format":"int64","description":"Counted when asked: a listing begun afterwards may meet categories created or deleted\nsince."}}},"CategorySummary":{"type":"object","description":"One category of one of the organization's channels: a node of the tree the channel files its\nvideos in.","required":["id","channel_id","parent_id","name","slug","position","is_active","url","created_at","updated_at"],"properties":{"channel_id":{"type":"string","format":"uuid","description":"The channel it belongs to, a `GET /v1/channels` `id`."},"created_at":{"type":"string","format":"date-time","description":"When it was created (RFC 3339). Lists are ordered by this instant, then by `id`."},"id":{"type":"string","format":"uuid","description":"The category's identifier."},"is_active":{"type":"boolean","description":"Whether the channel's audience sees it. A category switched off is hidden from the channel\nwith everything below it; it keeps what is filed in it, and shows it again once it is\nswitched back on."},"name":{"type":"string","description":"Its name, as the channel's audience reads it."},"parent_id":{"type":["string","null"],"format":"uuid","description":"The category it sits under, of the same channel; `null` at the root of the channel's tree.\nIt names a category this listing answers too."},"position":{"type":"integer","format":"int32","description":"Its place among the categories sharing its parent, lowest first. Not unique: siblings at\none position are shown in the order of their names."},"slug":{"type":"string","description":"The handle its address is built on — lowercase letters and digits joined by hyphens, unique\nwithin its channel."},"updated_at":{"type":"string","format":"date-time","description":"When anything about it last changed (RFC 3339) — moving it under another parent included."},"url":{"type":["string","null"],"description":"The address of its page on the channel: the channel's `url` followed by\n`/categories/{slug}/`. `null` when the channel's `url` is. The page answers `404` while the\ncategory, or one above it, is switched off."}}},"ChannelCount":{"type":"object","description":"How many channels the listing would answer.","required":["count"],"properties":{"count":{"type":"integer","format":"int64","description":"Counted when asked: a listing begun afterwards may meet channels created or deleted since."}}},"ChannelSummary":{"type":"object","description":"One channel of the organization: a public site where it publishes videos for an audience.","required":["id","name","url","language","created_at","updated_at"],"properties":{"created_at":{"type":"string","format":"date-time","description":"When it was created (RFC 3339). Lists are ordered by this instant, then by `id`."},"id":{"type":"string","format":"uuid","description":"The channel's identifier — what a category's `channel_id` names."},"language":{"type":"string","description":"The language it is written in, a BCP 47 tag such as `fr` or `en`."},"name":{"type":"string","description":"Its name, as its audience reads it."},"updated_at":{"type":"string","format":"date-time","description":"When the channel itself last changed (RFC 3339). A change of its domains alone, which\nmoves its `url`, does not move it."},"url":{"type":["string","null"],"description":"The address of its home page: its main domain, followed by a language segment such as\n`/fr` when that domain serves several channels, one per language. Every address on the\nchannel starts with it. `null` while no domain of the channel is switched on. It is where\nthe channel answers once it is online — a channel is listed whether it is online or not,\nand this read does not say which."}}},"ChannelView":{"allOf":[{"$ref":"#/components/schemas/ChannelSummary"}],"description":"One channel of the organization, read by its `id`: every field a listing answers about it,\nunder the same names. A field a listing cannot afford on every row may be added here."},"CollectionCount":{"type":"object","description":"How many collections the listing would answer under the same filter.","required":["count"],"properties":{"count":{"type":"integer","format":"int64","description":"Counted when asked: a listing begun afterwards may meet collections created or deleted\nsince."}}},"CollectionItem":{"type":"object","description":"One item of a collection: an asset, and where it comes when the collection is played.","required":["position","asset"],"properties":{"asset":{"$ref":"#/components/schemas/AssetSummary","description":"The asset, as `GET /v1/assets` answers it."},"position":{"type":"integer","format":"int64","description":"Where it comes when the collection is played, from `0` for the first: its rank among the\nitems this endpoint lists, as they stood when this page was read. Sort by it to play them.\nA collection set to play in a random order is answered in the order the organization\narranged it in, the same on every read, while its player plays it shuffled, in an order\ndrawn again each day; one whose items Videas selects by rules answers a new order on every\nread."}}},"CollectionSubtype":{"type":"string","description":"What a collection collects.\n\n**The list may grow**: a client should read a value it does not know as *a kind this client\ndoes not handle*, not as an error.","enum":["videos","audios","images","documents","mixed"]},"CollectionSummary":{"type":"object","description":"One collection of the organization's library: a list of its assets, played one after the\nother.","required":["id","name","description","workspace_id","subtype","item_count","duration_ms","created_at","updated_at","thumbnail_url"],"properties":{"created_at":{"type":"string","format":"date-time","description":"When it was created (RFC 3339). Lists are ordered by this instant, then by `id`."},"description":{"type":["string","null"],"description":"Its description, as the organization wrote it — Markdown, as written and not rendered;\n`null` when it has none."},"duration_ms":{"type":"integer","format":"int64","description":"The running times of those same entries added up, in milliseconds; `0` when none has one."},"id":{"type":"string","format":"uuid","description":"The collection's identifier — stable for its whole life, and the one to store."},"item_count":{"type":"integer","format":"int64","description":"How many entries it holds, counted whatever each entry's asset is: it may count entries\n`GET /v1/collections/{collection_id}/items` leaves out, such as an asset hidden from the\nlibrary. `0` for a collection whose items Videas selects by rules rather than holds: its\nitems are what that endpoint answers."},"name":{"type":"string","description":"Its title, as the organization wrote it. Never empty."},"subtype":{"$ref":"#/components/schemas/CollectionSubtype","description":"What it collects: the kind of asset its items are meant to be, or `mixed` for any kind.\nIt says what the organization made the collection for, not what it holds — a curated\ncollection may hold an asset of another kind."},"thumbnail_url":{"type":["string","null"],"format":"uri","description":"The address of its picture — the one the organization chose for the collection, else its\ncover entry's, else that of the first item it plays, the one its items rank `0` (for a\ncollection set to shuffle, the first in its arrangement) — as a JPEG at its own size, at\nmost 3840 pixels a side; `null` while it has none. A collection whose items Videas selects\nby rules is shown only by a picture chosen for it.\n\n**Stable and anonymous**, like an asset's `thumbnail_url`, and with the same other names —\n`thumbnail.webp`, `cover-320x180.jpg` and the like. It follows the collection: when another\npicture is chosen, another entry becomes its cover, or another item plays first, the address\nanswers that one, so store the address rather than the bytes. It answers `404` once the collection is\ndeleted or hidden, or no longer has a picture."},"updated_at":{"type":"string","format":"date-time","description":"When its name, its description or the picture chosen for it last changed (RFC 3339). Its\ntags and its entries — which assets it holds, and in what order — do not move it: read its\nitems to see theirs."},"workspace_id":{"type":"string","format":"uuid","description":"The workspace it is in — the `id` of one of `GET /v1/workspaces`."}}},"CollectionView":{"allOf":[{"$ref":"#/components/schemas/CollectionSummary"},{"type":"object","required":["tags"],"properties":{"tags":{"type":"array","items":{"$ref":"#/components/schemas/TagSummary"},"description":"The tags the organization files it under, ordered by name; empty when it has none. A tag a\nmachine suggested and nobody confirmed is not one of them."}}}],"description":"One collection of the organization, read by its `id`: every field a listing answers about it,\nunder the same names, and its tags."},"CreateAssetRequest":{"type":"object","description":"An asset to create in the library, from a video hosted on YouTube, Vimeo or Dailymotion.\n\n**This is the one kind of asset created here today**: a file — a video, a sound, a picture, a\ndocument — is added with `POST /v1/uploads`, which receives or fetches its bytes. A field this\nbody does not list is refused.","required":["workspace_id","third_party_url"],"properties":{"copyright":{"type":["string","null"],"description":"The notice a reuser has to carry — who holds its rights, under what terms. At most 1000\ncharacters."},"description":{"type":["string","null"],"description":"The asset's description. Absent, the provider's description where it gives one, else none.\nAt most 50000 characters."},"excerpt":{"type":["string","null"],"description":"A short summary, shown under the title where the description would not fit. At most 1000\ncharacters."},"external_ref":{"type":["string","null"],"description":"**Your** identifier for this asset, returned as its `external_ref` without the spaces around\nit. Not unique, never blank, and at most 500 characters. Set it on every request: after a\ntimeout or a `5xx`, look it up with `GET /v1/assets?external_ref=` before sending the\nrequest again, since the first one may have created the asset."},"language":{"type":["string","null"],"description":"The language of its content, as a BCP 47 tag: `fr`, `en-GB`, `zh-Hans-CN`."},"name":{"type":["string","null"],"description":"The asset's title. Absent, the provider's title. Never blank, and at most 500 characters\nonce the spaces around it are trimmed."},"parent_id":{"type":["string","null"],"format":"uuid","description":"The folder of that workspace the new asset lands directly in — the `id` of one of\n`GET /v1/workspaces/{workspace_id}/folders`. Absent or `null`, it lands at the workspace's\nroot."},"third_party_url":{"type":"string","format":"uri","description":"**The address of the video on YouTube, Vimeo or Dailymotion**, as its page or its share\nbutton gives it: `https://www.youtube.com/watch?v=…`, `https://youtu.be/…`,\n`https://vimeo.com/…`, `https://www.dailymotion.com/video/…`. Its provider is asked about it\nbefore the asset is created, so a private, deleted or non-embeddable video is refused. An\nembed code, an address on any other site and a link to a file are refused with a `400`: a\nfile is added with `POST /v1/uploads`."},"workspace_id":{"type":"string","format":"uuid","description":"The workspace the new asset lands in — the `id` of one of `GET /v1/workspaces`, private\nones included."}},"additionalProperties":false},"CreateFolderRequest":{"type":"object","description":"A folder to make in a workspace's tree. A field this body does not list is refused.","required":["workspace_id","name"],"properties":{"description":{"type":["string","null"],"description":"What it says it is for. At most 50000 characters; absent, `null`, empty or nothing but\nspaces, it says nothing."},"name":{"type":"string","description":"Its name. Never blank, and at most 500 characters once the spaces around it are trimmed.\nTwo folders may have the same name."},"parent_id":{"type":["string","null"],"format":"uuid","description":"The folder it sits directly under — the `id` of one of\n`GET /v1/workspaces/{workspace_id}/folders`. Absent or `null`, it sits at the workspace's\nroot."},"workspace_id":{"type":"string","format":"uuid","description":"The workspace whose tree it joins — the `id` of one of `GET /v1/workspaces`, private ones\nincluded."}},"additionalProperties":false},"CreatePublicationRequest":{"type":"object","description":"An asset to publish on one of the organization's channels. A field this body does not list is\nrefused.","required":["channel_id","asset_id"],"properties":{"access":{"oneOf":[{"$ref":"#/components/schemas/WritablePublicationAccess","description":"Who it is for: `public` or `authenticated`. Absent, the channel's own rule decides —\n`authenticated` on a channel whose visitors open an account themselves and whose site is\notherwise open, `public` on any other. **Created `authenticated` — sent so, or given so by\nthe channel's rule — it is shown locked**: it still shows itself to the visitors it is not\nfor, in the channel's listings when it is listed and at its page, and playing it asks them\nto sign in."},{"type":"null"}]},"asset_id":{"type":"string","format":"uuid","description":"The asset to publish, a `GET /v1/assets` `id`. It must be `ready`, and a channel publishes a\nvideo, a sound, a picture or a video hosted elsewhere — not a document. An asset is\npublished at most once on a channel."},"category_ids":{"type":["array","null"],"items":{"type":"string","format":"uuid"},"description":"The categories to file it in, `GET /v1/categories` `id`s of the same channel, switched-off\nones included. At most 100; an `id` sent twice counts once. Absent, it is filed nowhere.","maxItems":100},"channel_id":{"type":"string","format":"uuid","description":"The channel to publish on, a `GET /v1/channels` `id`."},"is_listed":{"type":["boolean","null"],"description":"Whether the channel shows it in its listings — `true` unless sent `false`."},"primary_category_id":{"type":["string","null"],"format":"uuid","description":"Its main category, one of `category_ids`. Absent, it has none."},"published_at":{"type":["string","null"],"format":"date-time","description":"With `status: published`, when it goes on the channel (RFC 3339) — a date in the future\nschedules it. Absent, now. Refused on a draft."},"slug":{"type":["string","null"],"description":"The handle its address is built on: lowercase letters and digits in words joined by single\nhyphens, at most 255 characters, taken as sent. Absent, the asset's own handle where it has\none, else its name made into one — followed by `-2`, `-3` and on where the channel already\nanswers at that address."},"status":{"oneOf":[{"$ref":"#/components/schemas/PublicationStatus","description":"`draft`, the default, or `published`. A publication is never created `archived`."},{"type":"null"}]}},"additionalProperties":false},"CreateUploadRequest":{"type":"object","description":"What to add to the library: the workspace it lands in, what it is called, and where its bytes\ncome from.\n\n**Send exactly one of `size_bytes` or `source_url`.** `size_bytes` means you send the file\nyourself, to the address the answer gives; `source_url` means we download it from that link in\nthe background. A request carrying both, or neither, is refused with a `400` naming the two.\nA field this body does not list is refused too.","required":["workspace_id"],"properties":{"content_type":{"type":["string","null"],"description":"The type you declare for the file you send. Recorded, never trusted: what the file is gets\nmeasured once it has arrived. Only with `size_bytes`."},"description":{"type":["string","null"],"description":"The asset's description. Absent, it has none. At most 50000 characters."},"external_ref":{"type":["string","null"],"description":"**Your** identifier for this asset, returned as its `external_ref` without the spaces around\nit. Not unique, never blank, and at most 500 characters. Set it on every request: after a\ntimeout or a `5xx`, look it up with `GET /v1/assets?external_ref=` before sending the\nrequest again, since the first one may have created the asset."},"filename":{"type":["string","null"],"description":"The file's name on your side, extension included — what the asset's kind is first read\nfrom. **Required with `size_bytes`**; optional with `source_url`, whose file is then named\nfrom what the link answers. Never blank."},"language":{"type":["string","null"],"description":"The language of its content, as a BCP 47 tag: `fr`, `en-GB`, `zh-Hans-CN`."},"name":{"type":["string","null"],"description":"The asset's title. Absent, the file's name — its first 500 characters. Never blank, and at\nmost 500 characters once the spaces around it are trimmed."},"parent_id":{"type":["string","null"],"format":"uuid","description":"The folder of that workspace the new asset lands directly in — the `id` of one of\n`GET /v1/workspaces/{workspace_id}/folders`. Absent or `null`, it lands at the workspace's\nroot."},"sha256":{"type":["string","null"],"description":"The SHA-256 digest of the file at `source_url`, as 64 hexadecimal characters: when given,\nthe file we download must match it — a copy that does not is downloaded once more, and a\nsecond mismatch fails the upload `checksum_mismatch`. Only with `source_url` — a file you\nsend is answered with the digest of what was stored.","pattern":"^[0-9A-Fa-f]{64}$"},"size_bytes":{"type":["integer","null"],"format":"int64","description":"**You send the file**, and this is its exact size in bytes. At least 1: an empty file is\nrefused with a `400`, since it has nothing to store or to play. At most 10737418240\n(10 GiB); a larger file is refused with a `413`. Exclusive with `source_url`.","minimum":1},"source_url":{"type":["string","null"],"format":"uri","description":"**We fetch the file** from this `http` or `https` link, in the background, from the fixed\naddresses this API's description lists under « Adding a file » — a presigned link to your\nbucket works, and the upload's `status` says how far the download got. Exclusive with\n`size_bytes`. Refused with a `400` naming the reason: a scheme other than `http` or\n`https`, a user name or a password in the link, `localhost`, a literal address that is not\na public one, a port other than 80 for `http` and 443 for `https`, or a YouTube, Vimeo or\nDailymotion page, which is a player and not a file — `POST /v1/assets` creates an asset that\nplays one. The file is at most 10 GiB, and a larger\none fails the upload `too_large`. The link is kept sealed while it is needed and never\nanswered back whole: `source_url` on the upload is it without its query."},"workspace_id":{"type":"string","format":"uuid","description":"The workspace the new asset lands in — the `id` of one of `GET /v1/workspaces`, private\nones included."}},"additionalProperties":false},"CustomFieldChoiceCount":{"type":"object","description":"How many options the listing would answer.","required":["count"],"properties":{"count":{"type":"integer","format":"int64","description":"Counted when asked: a listing begun afterwards may meet options added or withdrawn since."}}},"CustomFieldChoiceSummary":{"type":"object","description":"One option a `choice` field offers.","required":["id","label"],"properties":{"id":{"type":"string","format":"uuid","description":"The option's identifier — what a value of the field holds, and what a write sends."},"label":{"type":"string","description":"What a person reads for it."}}},"CustomFieldCount":{"type":"object","description":"How many custom fields the listing would answer.","required":["count"],"properties":{"count":{"type":"integer","format":"int64","description":"Counted when asked: a listing begun afterwards may meet fields created or deleted since."}}},"CustomFieldLink":{"type":"object","description":"An address, with the words that stand for it.","required":["url","label"],"properties":{"label":{"type":["string","null"],"description":"What a page shows for it; `null` when the address is shown as it is."},"url":{"type":"string","format":"uri","description":"The address, an absolute `http` or `https` one."}}},"CustomFieldSummary":{"type":"object","description":"One of the organization's own fields: something an asset of its library may carry beside its\nname and its description.","required":["id","label","slug","type","multiple","required","public","workspace_id","asset_types","created_at","updated_at"],"properties":{"asset_types":{"type":["array","null"],"items":{"$ref":"#/components/schemas/AssetType"},"description":"The types of asset it applies to; `null` for every type."},"created_at":{"type":"string","format":"date-time","description":"When it was created (RFC 3339). Lists are ordered by this instant, then by `id`."},"id":{"type":"string","format":"uuid","description":"The field's identifier — what a write of an asset's values names it by, and the one to\nstore."},"label":{"type":"string","description":"What a person reads beside its value."},"multiple":{"type":"boolean","description":"For a `choice` field, whether it takes several options rather than one; `false` for every\nother type."},"public":{"type":"boolean","description":"Whether it is shown to the public wherever an asset carrying it is published — on a\nchannel's page and in the player's details."},"required":{"type":"boolean","description":"Whether it may be emptied: a value of a required field can be changed and never cleared. An\nasset may still have none, until somebody gives it one."},"slug":{"type":"string","description":"A short handle the organization gave it: lowercase letters and digits joined by hyphens.\n**Not unique**: two groups of fields may each hold one under the same handle — address a\nfield by its `id`."},"type":{"$ref":"#/components/schemas/CustomFieldType","description":"What it holds, which decides the shape of its value."},"updated_at":{"type":"string","format":"date-time","description":"When anything about it last changed (RFC 3339)."},"workspace_id":{"type":["string","null"],"format":"uuid","description":"The one workspace whose assets it applies to; `null` for every workspace of the\norganization."}}},"CustomFieldType":{"type":"string","description":"What a custom field holds, and so the shape of its value:\n\n- `text` — one line, a string;\n- `long_text` — several lines, a string;\n- `number` — a number;\n- `date` — a day, `YYYY-MM-DD`;\n- `boolean` — `true` or `false`;\n- `choice` — one of the field's options, by its `id`, or a list of them on a `multiple` field;\n- `link` — an address with an optional label, `{\"url\", \"label\"}`;\n- `record` — an entry of a reference list this product keeps for the organization;\n- `json` — structured data;\n- `file` — a file.\n\nThe last three are listed and not yet read or written here. **The list may grow**: read a value\nyou do not know as a field your client neither reads nor writes.","enum":["text","long_text","number","date","boolean","choice","link","record","json","file"]},"CustomFieldValue":{"oneOf":[{"type":"string","description":"A `text`, a `long_text` or a `date` — or the one option of a `choice` field that takes one."},{"type":"number","format":"double","description":"A `number`."},{"type":"boolean","description":"A `boolean`."},{"type":"array","items":{"type":"string","format":"uuid"},"description":"The options of a `multiple` `choice` field."},{"$ref":"#/components/schemas/CustomFieldLink","description":"A `link`."}],"description":"A value of a custom field, in the shape its `type` gives it — the same shape read and written:\n\n- `text`, `long_text` — a string;\n- `number` — a number;\n- `date` — `YYYY-MM-DD`; a value written outside this API may also carry a time of day,\n  `YYYY-MM-DDTHH:MM:SS` with an optional offset;\n- `boolean` — `true` or `false`;\n- `choice` — an option's `id`, as `GET /v1/custom-fields/{field_id}/choices` lists them; on a\n  `multiple` field, a list of them;\n- `link` — `{\"url\", \"label\"}`."},"CustomFieldValueEntry":{"type":"object","description":"One value an asset holds of one of the organization's custom fields.","required":["field_id","slug","label","type","value"],"properties":{"field_id":{"type":"string","format":"uuid","description":"The field — the `id` of one of `GET /v1/custom-fields`."},"label":{"type":"string","description":"The field's label, as that listing answers it."},"slug":{"type":"string","description":"The field's handle, as that listing answers it."},"type":{"$ref":"#/components/schemas/CustomFieldType","description":"The field's type, which decides the shape of `value`."},"value":{"$ref":"#/components/schemas/CustomFieldValue","description":"The value, in the shape its `type` gives it."}}},"CustomFieldValueUpdate":{"type":"object","description":"One field's new value.","required":["field_id","value"],"properties":{"field_id":{"type":"string","format":"uuid","description":"The field — the `id` of one of `GET /v1/custom-fields` that applies to this asset: one of\nevery workspace or of the asset's own, of every type or of the asset's."},"value":{"oneOf":[{"$ref":"#/components/schemas/CustomFieldValue","description":"The value, in the shape the field's `type` gives it — the shape `custom_fields` reads it\nback in: a string for `text` and `long_text`, a number, `YYYY-MM-DD` for a `date`, `true` or\n`false`, an option's `id` for a `choice` — a list of them on a `multiple` one —, and\n`{\"url\", \"label\"}` for a `link`, whose `url` is an absolute `http` or `https` address and\nwhose `label` may be left out. Nothing is converted: `42` is not a text and `\"true\"` is\nnot a boolean.\n\n**Required, and `null` empties the field** — so does an empty string on a `text` or a\n`long_text` field, and an empty list on a `multiple` one; a `required` field cannot be\nemptied. A `record`, `json` or `file` field is not written here yet."},{"type":"null"}]}},"additionalProperties":false},"EmbedAccess":{"type":"string","description":"Who the embed itself opens to. **Open**: a value not listed here may be added, and a reader\ntreats one it does not know as closed to its visitors.\n\n**The organization may also limit every embed of a workspace, or all of its own, to a list of\nsites**, a setting this value does not report: a page on a site outside that list is refused\nwhatever the embed's own level.","enum":["public","domain_restricted","token_required"]},"EmbedView":{"type":"object","description":"The embed a page uses to play an asset or a collection — its default one.","required":["id","asset_id","collection_id","access","active","embed_url","script_url","created_at"],"properties":{"access":{"$ref":"#/components/schemas/EmbedAccess","description":"Who it opens to."},"active":{"type":"boolean","description":"Whether it plays today: `false` when the organization switched it off or its expiry has\npassed. The id stays the same either way."},"asset_id":{"type":["string","null"],"format":"uuid","description":"The asset it plays — the `id` of one of `GET /v1/assets` — or `null` when it plays a\ncollection. Exactly one of `asset_id` and `collection_id` is set."},"collection_id":{"type":["string","null"],"format":"uuid","description":"The collection it plays — the `id` of one of `GET /v1/collections` — or `null` when it\nplays an asset."},"created_at":{"type":"string","format":"date-time","description":"When the embed was created (RFC 3339)."},"embed_url":{"type":["string","null"],"description":"The address of the page that plays it, on the organization's platform — what an `iframe`\ntakes as `src`. `null` when the platform has no host of its own yet."},"id":{"type":"string","format":"uuid","description":"The embed's identifier — what the loader takes as `data-embed`. Stable for as long as the\norganization keeps this embed: store it rather than asking again for every page."},"script_url":{"type":["string","null"],"description":"The address of the loader script on the same platform, which reads `data-embed` and draws\nthe player in its place. `null` when `embed_url` is."}}},"ErrorBody":{"type":"object","description":"The body of every error response, whatever the status: a `code` to branch on, a `message`\nfor a person to read, a `request_id` to quote when you report the failure, and — on a\nrefusal the service names — a `reason`, saying which of its own rules refused.","required":["code","message"],"properties":{"code":{"$ref":"#/components/schemas/ErrorCode"},"message":{"type":"string","description":"What went wrong, in English, for a person to read. It may change at any time: branch on\n`code`, never on this."},"reason":{"type":"string","description":"Which of this service's own rules refused the request, as a lowercase `snake_case` name\nfrom the service's vocabulary of refusals, which the service documents where it names\nany. Branch on it to tell apart refusals that share a `code`: a name is always answered\nunder the same code, so a client that does not know it handles the refusal by its `code`.\nIt names a rule and never carries a value — what the refusal is about is in `message`.\nOnly a refusal of the request (a 4xx status) carries one; absent, never `null`, when the\nservice names none.","pattern":"^[a-z][a-z0-9]*(_[a-z0-9]+)*$"},"request_id":{"type":"string","description":"The request's identifier, to quote when you report this failure. Absent, never `null`,\nwhen the server has none to give."}}},"ErrorCode":{"type":"string","description":"Why a request failed: a stable code, carried in every error body, that says what to do\nabout it. Branch on this, never on `message`.\n\n- `validation` (400, 422) — the request is malformed or invalid: fix it;\n- `unauthorized` (401) — no usable credential: authenticate;\n- `not_signed_in` (401) — the client's own credential was accepted, and the person\n  acting through it is not signed in, or no longer is: sign the person in again, and keep\n  the client's credential. Answered only where a person signs in on top of a client's\n  credential; any other missing or expired credential is `unauthorized`;\n- `forbidden` (403) — the credential is valid and may not do this;\n- `no_organization` (403) — the account belongs to no organization: create or join one,\n  since signing in again does not help;\n- `second_factor_required` (403) — the session is good and this endpoint asks more of it: prove\n  a second factor on it, enrolling one first where the account has none, since signing in again\n  is not what is asked;\n- `not_found` (404) — nothing answers to what the request names;\n- `method_not_allowed` (405) — the address does not take this method;\n- `conflict` (409) — something changed first: read the current state again rather than\n  sending the same request again;\n- `credits_exhausted` (402) — the prepaid balance is spent: top it up;\n- `budget_exceeded` (402) — a spending limit is reached: raise it, or wait for its period\n  to end;\n- `payload_too_large` (413) — the body is larger than accepted: send less;\n- `unsupported_media_type` (415) — the body's `Content-Type` is not one accepted here;\n- `rate_limited` (429) — too many requests: wait the seconds `Retry-After` gives;\n- `quota_exceeded` (429) — an allowance counted over a period is spent: `message` says who can\n  lift it, and sending the request again soon changes nothing;\n- `not_implemented` (501) — the operation is not available yet;\n- `service_unavailable` (503) — the service cannot answer right now: retry later;\n- `upstream_error` (502) — a service called on your behalf failed: retry later;\n- `timed_out` (504) — the server stopped waiting, and the request may have taken effect in\n  part: check before sending a write again, or send it with the same idempotency key;\n- `internal` (500) — a failure on the server's side: retry later, and quote the body's\n  `request_id` when you report it.\n\nA code keeps its meaning. New codes may be added: read one you do not know by the HTTP\nstatus it came with.","enum":["validation","unauthorized","not_signed_in","forbidden","no_organization","second_factor_required","not_found","method_not_allowed","conflict","credits_exhausted","budget_exceeded","payload_too_large","unsupported_media_type","rate_limited","quota_exceeded","not_implemented","service_unavailable","upstream_error","timed_out","internal"]},"ExchangeRequest":{"type":"object","description":"The back-channel exchange: the one-time code from the redirect, and the verifier the install\nthat opened the handshake has kept since before it.\n\n**No client secret and no session**, which is the whole shape of this leg: the integration is\na public client — every customer's site is a different install of one plugin — so what binds\nthe code to that install is PKCE and nothing else.","required":["code","code_verifier"],"properties":{"code":{"type":"string","description":"The `code` the approval redirect carried."},"code_verifier":{"type":"string","description":"The RFC 7636 verifier whose `S256` challenge opened the handshake."}}},"ExchangeResponse":{"type":"object","description":"The credential, handed over exactly once.\n\n`api_key` is the raw key and this response is the only place it ever exists outside the\nintegration's own store: nothing here can hand it over a second time, and an integration that\nloses it opens a new handshake.","required":["api_key","prefix","permissions","organization_id","organization_name"],"properties":{"api_key":{"type":"string","description":"The full raw key, `ak_…`. Present it as `Authorization: Bearer` on every request your\nintegration makes with it."},"organization_id":{"$ref":"#/components/schemas/OrgId","description":"The organization the key authenticates. A key never authenticates a person."},"organization_name":{"type":"string","description":"That organization's name as it stood when the key was handed over, for your integration to\nsay which organization it is connected to. It may change afterwards; `organization_id`\ndoes not."},"permissions":{"type":"array","items":{"type":"string"},"description":"What the key carries, canonical — sorted, each key once. A plain list of permission keys\nand never a closed vocabulary: a product adds a permission in a release of its own."},"prefix":{"type":"string","description":"The display prefix the organization's dashboard lists the key under, so an integration\ncan tell its customer which row is theirs."}}},"FolderCount":{"type":"object","description":"How many folders the listing would answer.","required":["count"],"properties":{"count":{"type":"integer","format":"int64","description":"Counted when asked: a listing begun afterwards may meet folders created or deleted since."}}},"FolderSummary":{"type":"object","description":"One folder of a workspace's tree.","required":["id","name","description","workspace_id","parent_id","created_at","updated_at"],"properties":{"created_at":{"type":"string","format":"date-time","description":"When it was created (RFC 3339). Lists are ordered by this instant, then by `id`."},"description":{"type":["string","null"],"description":"What it says it is for; `null` when it says nothing."},"id":{"type":"string","format":"uuid","description":"The folder's identifier — what `GET /v1/assets?parent=` takes."},"name":{"type":"string","description":"Its name, as the organization wrote it."},"parent_id":{"type":["string","null"],"format":"uuid","description":"The folder it sits directly under in that tree — the `id` of another folder of the same\nlisting — or `null` at the root."},"updated_at":{"type":"string","format":"date-time","description":"When anything about it last changed (RFC 3339)."},"workspace_id":{"type":"string","format":"uuid","description":"The workspace whose tree it is in — the `id` of one of `GET /v1/workspaces`."}}},"FolderView":{"allOf":[{"$ref":"#/components/schemas/FolderSummary"}],"description":"One folder, as a read of it answers."},"OrgId":{"type":"string","format":"uuid","description":"An organization: the account its members act in, and the one an API key belongs to."},"Page_AssetSummary":{"type":"object","description":"One page of a list: its items, and the cursor of the page after it. Send `next` back as\n`after` to read the following page, until it is `null`. A page carries no total.","required":["data","next"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AssetSummary"},"description":"The items of this page, in the list's order."},"next":{"type":["string","null"],"description":"The cursor of the next page, to send back as `after`; `null` on the last page."}}},"Page_CategorySummary":{"type":"object","description":"One page of a list: its items, and the cursor of the page after it. Send `next` back as\n`after` to read the following page, until it is `null`. A page carries no total.","required":["data","next"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CategorySummary"},"description":"The items of this page, in the list's order."},"next":{"type":["string","null"],"description":"The cursor of the next page, to send back as `after`; `null` on the last page."}}},"Page_ChannelSummary":{"type":"object","description":"One page of a list: its items, and the cursor of the page after it. Send `next` back as\n`after` to read the following page, until it is `null`. A page carries no total.","required":["data","next"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ChannelSummary"},"description":"The items of this page, in the list's order."},"next":{"type":["string","null"],"description":"The cursor of the next page, to send back as `after`; `null` on the last page."}}},"Page_CollectionItem":{"type":"object","description":"One page of a list: its items, and the cursor of the page after it. Send `next` back as\n`after` to read the following page, until it is `null`. A page carries no total.","required":["data","next"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CollectionItem"},"description":"The items of this page, in the list's order."},"next":{"type":["string","null"],"description":"The cursor of the next page, to send back as `after`; `null` on the last page."}}},"Page_CollectionSummary":{"type":"object","description":"One page of a list: its items, and the cursor of the page after it. Send `next` back as\n`after` to read the following page, until it is `null`. A page carries no total.","required":["data","next"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CollectionSummary"},"description":"The items of this page, in the list's order."},"next":{"type":["string","null"],"description":"The cursor of the next page, to send back as `after`; `null` on the last page."}}},"Page_CustomFieldChoiceSummary":{"type":"object","description":"One page of a list: its items, and the cursor of the page after it. Send `next` back as\n`after` to read the following page, until it is `null`. A page carries no total.","required":["data","next"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomFieldChoiceSummary"},"description":"The items of this page, in the list's order."},"next":{"type":["string","null"],"description":"The cursor of the next page, to send back as `after`; `null` on the last page."}}},"Page_CustomFieldSummary":{"type":"object","description":"One page of a list: its items, and the cursor of the page after it. Send `next` back as\n`after` to read the following page, until it is `null`. A page carries no total.","required":["data","next"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomFieldSummary"},"description":"The items of this page, in the list's order."},"next":{"type":["string","null"],"description":"The cursor of the next page, to send back as `after`; `null` on the last page."}}},"Page_FolderSummary":{"type":"object","description":"One page of a list: its items, and the cursor of the page after it. Send `next` back as\n`after` to read the following page, until it is `null`. A page carries no total.","required":["data","next"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FolderSummary"},"description":"The items of this page, in the list's order."},"next":{"type":["string","null"],"description":"The cursor of the next page, to send back as `after`; `null` on the last page."}}},"Page_PlaybackSession":{"type":"object","description":"One page of a list: its items, and the cursor of the page after it. Send `next` back as\n`after` to read the following page, until it is `null`. A page carries no total.","required":["data","next"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PlaybackSession"},"description":"The items of this page, in the list's order."},"next":{"type":["string","null"],"description":"The cursor of the next page, to send back as `after`; `null` on the last page."}}},"Page_PublicationSummary":{"type":"object","description":"One page of a list: its items, and the cursor of the page after it. Send `next` back as\n`after` to read the following page, until it is `null`. A page carries no total.","required":["data","next"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PublicationSummary"},"description":"The items of this page, in the list's order."},"next":{"type":["string","null"],"description":"The cursor of the next page, to send back as `after`; `null` on the last page."}}},"Page_WorkspaceSummary":{"type":"object","description":"One page of a list: its items, and the cursor of the page after it. Send `next` back as\n`after` to read the following page, until it is `null`. A page carries no total.","required":["data","next"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WorkspaceSummary"},"description":"The items of this page, in the list's order."},"next":{"type":["string","null"],"description":"The cursor of the next page, to send back as `after`; `null` on the last page."}}},"PlaybackSession":{"type":"object","description":"One playback session: one sitting of one viewer on one asset of the organization.","required":["id","asset_id","viewer_id","started_at","watch_time_ms","completion_percentage","asset_duration_ms","watched"],"properties":{"asset_duration_ms":{"type":"integer","format":"int64","description":"The asset's duration when the sitting was recorded, in milliseconds — which a new version\nof the asset does not move. `0` when it had none, as a live stream has none."},"asset_id":{"type":"string","format":"uuid","description":"The asset watched. **It may be one `GET /v1/assets/{asset_id}` answers `404` for**: a\nsession outlives its asset, whatever became of it — deleted, hidden, moved."},"completion_percentage":{"type":"number","format":"float","description":"How much of the asset the sitting watched, from 0 to 100: its watch time as a percentage of\nwhat a whole viewing lasts — the asset's duration, or the window its players keep of it when\nit is trimmed —, capped at 100 — never where the player stands, so a sitting that skipped to\nthe end has watched only what it played. It only ever grows while the sitting goes on."},"id":{"type":"string","format":"uuid","description":"The sitting's identifier. **One sitting of a collection is one row per asset it played**,\neach carrying the sitting's `id` with its own `asset_id`: a row is an `id` and an\n`asset_id` together."},"started_at":{"type":"string","format":"date-time","description":"When the sitting started (RFC 3339), to the second. Lists are ordered by this instant. It\nnever moves: a reload continues the sitting it reopens."},"viewer_id":{"type":["string","null"],"format":"uuid","description":"Who watched: the `viewer_id` your embed code gave the player, otherwise an identifier the\nplayer keeps for one browser on one device. It identifies a person only if you made it so —\nsend one of your own in the embed code; an identifier of yours that is not a uuid can become\none, a UUIDv5 of it for example. Nothing checks what a page sends. `null` when the session\nwas recorded with none."},"watch_time_ms":{"type":"integer","format":"int64","description":"How long the asset was played, in milliseconds — seeking counts for nothing. It only ever\ngrows while the sitting goes on."},"watched":{"type":"array","items":{"$ref":"#/components/schemas/WatchedRange"},"description":"**The stretches of the asset that were watched**, in order and never overlapping, each at\nleast once — a stretch watched twice is listed once. Their resolution is a hundredth of the\nasset's duration: each stretch starts and ends on one of a hundred equal steps of it, so it\ncovers a little more than was watched, and none ends past `asset_duration_ms`. Empty when\nthe sitting recorded none: nothing was watched yet, the asset has no duration, or the\nplayer that played it did not report one."}}},"PlaybackSessionCount":{"type":"object","description":"How many playback sessions the listing would answer under the same filter.","required":["count"],"properties":{"count":{"type":"integer","format":"int64","description":"Counted when asked: a session played since, or still playing, may make a listing begun\nafterwards answer more."}}},"PublicationAccess":{"type":"string","description":"Who the publication is for — **its own setting**.\n\nIt is not what a given visitor gets, which also depends on the channel's door: a `public`\npublication on a channel that asks every visitor to sign in is still behind that sign-in.\n`public` — anybody the channel lets in; `authenticated` — anybody who signed in to the channel,\nor gave its password; `restricted` — only the members granted it; `paid` — the members who\nbought it, or hold a subscription covering it; `on_request` — the members who asked for it and\nwere granted it. A request sets the first two (`WritablePublicationAccess`); the other three\nare set from Videas, with the right or the offer each stands for. **The list may grow**: read\na value you do not know as `restricted`.","enum":["public","authenticated","restricted","paid","on_request"]},"PublicationCount":{"type":"object","description":"How many publications the listing would answer under the same filters.","required":["count"],"properties":{"count":{"type":"integer","format":"int64","description":"Counted when asked: a listing begun afterwards may meet publications created or changed\nsince."}}},"PublicationStatus":{"type":"string","description":"Where a publication is in its life.\n\n`draft` — not on the channel; `published` — on the channel from its `published_at`, **which may\nbe in the future**: a publication scheduled for later is `published` with a date to come, and\nthe channel shows it from that instant; `archived` — retired from the channel and kept, with\nits date. **The list may grow**: read a value you do not know as a publication the channel does\nnot show.","enum":["draft","published","archived"]},"PublicationSummary":{"type":"object","description":"One asset published on one of the organization's channels.","required":["id","channel_id","asset_id","slug","url","status","published_at","is_listed","access","category_ids","primary_category_id","created_at","updated_at"],"properties":{"access":{"$ref":"#/components/schemas/PublicationAccess"},"asset_id":{"type":"string","format":"uuid","description":"The asset it publishes, a `GET /v1/assets` `id`. It never changes, and an asset is\npublished at most once on a channel."},"category_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"The categories of its channel it is filed in, each a `GET /v1/categories` `id` — a set,\nwhose order says one thing only: **its main category comes first** when it has one, and the\nothers follow in the order `GET /v1/categories` lists them, oldest first. Empty when it is\nfiled nowhere."},"channel_id":{"type":"string","format":"uuid","description":"The channel it is published on, a `GET /v1/channels` `id`. It never changes."},"created_at":{"type":"string","format":"date-time","description":"When it was created (RFC 3339). Lists are ordered by this instant, then by `id`."},"id":{"type":"string","format":"uuid","description":"The publication's identifier — what `PATCH /v1/publications/{publication_id}` takes."},"is_listed":{"type":"boolean","description":"Whether the channel shows it in its catalogue, its categories, its search and its sitemap.\nA publication that is not listed still answers at its `url`."},"primary_category_id":{"type":["string","null"],"format":"uuid","description":"Its main category, the one its page and its card name — one of `category_ids`; `null` when\nit has none."},"published_at":{"type":["string","null"],"format":"date-time","description":"When it went, or goes, on the channel (RFC 3339) — `null` for a draft never published. A\n`published` publication whose date is in the future is scheduled: the channel shows it from\nthat instant. A draft or an archived publication keeps the date it last went out with."},"slug":{"type":"string","description":"The handle its address is built on — lowercase letters and digits in words joined by single\nhyphens, unique among the channel's publications."},"status":{"$ref":"#/components/schemas/PublicationStatus"},"updated_at":{"type":"string","format":"date-time","description":"When its own settings last changed (RFC 3339) — its address, its status, its date, whether\nit is listed, who it is for. Filing it in other categories does not move it."},"url":{"type":["string","null"],"description":"The address of its page on the channel: the channel's `url` followed by `/{slug}/`. `null`\nwhen the channel's `url` is. It answers `404` until the publication is `published` and its\n`published_at` has come, and the channel's own door applies to it — see `access`."}}},"PublicationView":{"allOf":[{"$ref":"#/components/schemas/PublicationSummary"}],"description":"One publication, read by its `id`: every field a listing answers about it, under the same\nnames. A field a listing cannot afford on every row may be added here."},"SetAssetTagsRequest":{"type":"object","description":"The words to file an asset under, which replace the ones it is filed under now.\n\nA field this body does not list is refused.","required":["tags"],"properties":{"tags":{"type":"array","items":{"type":"string"},"description":"The asset's tags, by name: at most 100 words, each at most 100 characters once the spaces\naround it are trimmed, never blank, and holding at least one Latin letter or digit. Case\nand accents do not count, and any run of spaces or punctuation counts as one separator — so\n`Carbon fibre`, `carbon-fibre` and `CARBON FIBRE` are one tag, and `carbonfibre` another.\nTwo words that are one tag are filed once. An empty list takes off every tag but those\nthis product attaches itself, and a word naming one of those is taken only on an asset\nthat already carries it.","maxItems":100}},"additionalProperties":false},"TagSummary":{"type":"object","description":"A tag the organization files assets under.","required":["id","name"],"properties":{"id":{"type":"string","format":"uuid","description":"The tag's identifier — the same on every asset that carries it, and kept when the tag is\nrenamed."},"name":{"type":"string","description":"The word itself, as the organization wrote it."}}},"ThirdPartyProvider":{"type":"string","description":"Who hosts a third-party video: `youtube`, `vimeo` or `dailymotion` — or `other`, a player from\nanother site, which has no `video_id`.\n\n**The list may grow**: read a value you do not know as `other`.","enum":["youtube","vimeo","dailymotion","other"]},"ThirdPartyVideo":{"type":"object","description":"A video another provider hosts, which an asset of `type` `third_party` plays from there.","required":["provider","video_id","player_url"],"properties":{"player_url":{"type":["string","null"],"format":"uri","description":"The address of its player, `https://`, to put in an `<iframe>`; `null` when none is known,\nand the video then plays nowhere."},"provider":{"$ref":"#/components/schemas/ThirdPartyProvider","description":"Who hosts it."},"video_id":{"type":["string","null"],"description":"The provider's own identifier of the video — what the address of its page names, such as\nthe `v` of a YouTube address — and what to match your own records on. `null` for `other`,\nand when it is not known."}}},"UpdateAssetCustomFieldsRequest":{"type":"object","description":"Values to write in an asset's custom fields: the fields you name, and no other.\n\nA field left out keeps its value. A field this body does not list is refused.","required":["values"],"properties":{"values":{"type":"array","items":{"$ref":"#/components/schemas/CustomFieldValueUpdate"},"description":"The values, one per field: at most 200, and a field named once.","maxItems":200}},"additionalProperties":false},"UpdateAssetRequest":{"type":"object","description":"What to change about an asset: the fields you send, and no other.\n\nA field left out is left as it is, and `null` empties a field that may be empty — every field\nbut `name` — or, on `parent_id`, moves the asset to its workspace's root. A field this body\ndoes not list is refused, among them the asset's `type`, its handle, whether it is listed, its\nexpiry, its licence, its picture and its workspace.","properties":{"copyright":{"type":["string","null"],"description":"The notice a reuser has to carry — who holds its rights, under what terms. At most 1000\ncharacters; `null` or an empty string empties it."},"description":{"type":["string","null"],"description":"Its description. At most 50000 characters; `null` or an empty string empties it."},"excerpt":{"type":["string","null"],"description":"A short summary, shown under the title where the description would not fit. At most 1000\ncharacters; `null` or an empty string empties it."},"external_ref":{"type":["string","null"],"description":"**Your** identifier for this asset, kept without the spaces around it. Not unique, never\nblank, and at most 500 characters; `null` empties it."},"language":{"type":["string","null"],"description":"The language of its content, as a BCP 47 tag: `fr`, `en-GB`, `zh-Hans-CN`. `null` empties\nit: the language is then unknown."},"name":{"type":"string","description":"The asset's title. Never blank, at most 500 characters once the spaces around it are\ntrimmed, and never `null`: an asset always has one."},"parent_id":{"type":["string","null"],"format":"uuid","description":"The folder of its workspace it moves to — the `id` of one of\n`GET /v1/workspaces/{workspace_id}/folders` for the workspace its `workspace_id` names — or\n`null` for that workspace's root. The `parent_id` the asset already reads with, `null`\nincluded, leaves it where it is. An asset never changes workspace here, and moving it into\na folder shared by a link makes it visible through that link."},"seo_description":{"type":["string","null"],"description":"The description a web page publishing it gives search engines and link previews. Kept\nwithout the spaces around it, at most 1000 characters, and never blank; `null` empties it."},"seo_title":{"type":["string","null"],"description":"The title a web page publishing it gives itself, in place of its `name`. Kept without the\nspaces around it, at most 255 characters, and never blank; `null` empties it."}},"additionalProperties":false},"UpdatePublicationRequest":{"type":"object","description":"What to change about a publication: the fields you send, and no other. Its channel and its asset\nnever change, and a field this body does not list is refused.","properties":{"access":{"$ref":"#/components/schemas/WritablePublicationAccess","description":"Who it is for: `public` or `authenticated`, the two levels a request moves a publication\nbetween. Only the level moves: whether it shows itself, locked, to the visitors it is not\nfor stays as it was — a publication created `authenticated` through this API does, and one\ncreated `public` and made `authenticated` later does not: those visitors do not see it at\nall. A publication that is `restricted`, `paid` or `on_request` is not moved by a request:\na `409`. Never `null`."},"category_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"The categories it is filed in, as a whole: the list replaces the one it has, and the order\nit is sent in says nothing. A category it\nstays in keeps its place and its featuring there, one it enters puts it last, and one left\nout no longer holds it. `[]` files it nowhere; never `null`. At most 100, all of its own\nchannel's; an `id` sent twice counts once.","maxItems":100},"is_listed":{"type":"boolean","description":"Whether the channel shows it in its listings. Never `null`."},"primary_category_id":{"type":["string","null"],"format":"uuid","description":"Its main category — one of the categories it is filed in once this change is made — or\n`null` for none. Absent, the main category stays where it is while the publication is still\nfiled there, and there is none otherwise."},"published_at":{"type":"string","format":"date-time","description":"When it goes on the channel (RFC 3339), for a publication that is `published` or is made so\nby `status`: a date in the future schedules it, and sent alone it moves the date of one\nalready published. Refused on a draft or an archived publication; never `null`."},"slug":{"type":"string","description":"A new handle for its address, on the terms of the creation. Its old address goes on\nanswering, sending visitors to the new one. Never `null`."},"status":{"$ref":"#/components/schemas/PublicationStatus","description":"`draft` or `archived` takes it off the channel and keeps its `published_at`; `published`\nputs it on — at the `published_at` sent, else now: one taken off and put back on comes back\nas new rather than under the date it first went out on. Never `null`."}},"additionalProperties":false},"Upload":{"type":"object","description":"One upload into the organization's library, opened with an API key.\n\n**For a file you send** (`source: client`), send it to `upload_url`, carrying the\n`upload_token` the opener answered in `X-Upload-Token`: whole with one `PUT` when it is at most\n`max_put_bytes`, or with tus 1.0 core. The address is opaque — use it as given. **For a link**\n(`source: link`) there is nothing to send: we download the file in the background, `source_url`\nsays from where — without its query — and `failure` says why, if it fails. The asset exists\nfrom the start, `uploading`; once the upload is `completed` it goes on to `processing` and\n`ready`, which `GET /v1/assets/{asset_id}` reads.\n\nThe fields that describe the transfer — `upload_url`, `max_put_bytes`, `expires_at` and\n`received_bytes` — are `null` once its record is deleted, ninety days after the upload ended;\n`size_bytes` then answers the stored file's size for a completed upload.","required":["id","asset_id","workspace_id","source","status","size_bytes","received_bytes","upload_url","max_put_bytes","expires_at","source_url","failure","created_at","updated_at","finished_at"],"properties":{"asset_id":{"type":"string","format":"uuid","description":"The asset the upload creates, which exists from the moment the upload opens — the `id`\n`GET /v1/assets/{asset_id}` takes."},"created_at":{"type":"string","format":"date-time","description":"When the upload was opened (RFC 3339)."},"expires_at":{"type":["string","null"],"format":"date-time","description":"When a file you send that has not completed by then is given up on (RFC 3339): its asset\nends `error`. A request still sending bytes at that moment pushes it out for as long as it\nruns. `null` for a link, and once the upload has ended."},"failure":{"oneOf":[{"$ref":"#/components/schemas/UploadFailure","description":"**Why the download of a link failed**, when `status` is `failed`; `null` otherwise."},{"type":"null"}]},"finished_at":{"type":["string","null"],"format":"date-time","description":"When the upload ended — completed, cancelled, expired, failed or refused (RFC 3339); `null`\nwhile it is open."},"id":{"type":"string","format":"uuid","description":"The upload's identifier: what `GET` and `DELETE /v1/uploads/{upload_id}` take."},"max_put_bytes":{"type":["integer","null"],"format":"int64","description":"The largest file one `PUT` to `upload_url` carries, in bytes; a larger one goes with tus,\nin chunks of at most this size. `null` for a link, and once the transfer's record is deleted."},"received_bytes":{"type":["integer","null"],"format":"int64","description":"How many bytes have been received — `0` for a link whose download has not started; `null`\nonce the transfer's record is deleted."},"size_bytes":{"type":["integer","null"],"format":"int64","description":"The file's size in bytes, as the opener declared it — for a link, as the remote declared\nit, `null` until it has; `null` once the transfer's record is deleted, for an upload that\ndid not complete."},"source":{"$ref":"#/components/schemas/UploadSource","description":"Where the bytes come from."},"source_url":{"type":["string","null"],"format":"uri","description":"**For a link**, where the file is fetched from: the link without its query, its fragment and\nany user name — so no signature it carried. `null` for a file you send."},"status":{"$ref":"#/components/schemas/UploadStatus","description":"Where the upload is."},"updated_at":{"type":"string","format":"date-time","description":"When anything about the upload last changed (RFC 3339)."},"upload_url":{"type":["string","null"],"format":"uri","description":"Where to send the file, with `X-Upload-Token`: whole with one `PUT`, or with tus 1.0 core.\nAn absolute URL, to be used as given. `null` for a link, and once the transfer's record is\ndeleted."},"workspace_id":{"type":["string","null"],"format":"uuid","description":"The workspace the asset is in — the `id` of one of `GET /v1/workspaces`; `null` while the\nasset is on no workspace of the organization, once it has been deleted."}}},"UploadCreated":{"allOf":[{"$ref":"#/components/schemas/Upload"},{"type":"object","required":["upload_token"],"properties":{"upload_token":{"type":["string","null"],"description":"**The credential `upload_url` takes, in `X-Upload-Token`**, answered here and never again:\nno read of the upload returns it. It admits its holder to this one upload until the upload\nends, and to nothing else, so it may be handed to the page that sends the file — never the\nAPI key. `null` for a link, which nobody sends anything to."}}}],"description":"The upload just opened, and the token to send its file with."},"UploadFailure":{"type":"object","description":"Why the download of a link failed.","required":["code","message"],"properties":{"code":{"$ref":"#/components/schemas/UploadFailureCode"},"message":{"type":"string","description":"What happened, in English, for a person to read. Never the link, and never what the remote\nanswered in its body. Not stable: branch on `code`."}}},"UploadFailureCode":{"type":"string","description":"Why the download of a link failed, for a program to branch on. Each is final: once the cause\nis fixed, a new upload is how to try again.\n\n- `address_refused` — we do not connect to where the link leads: an address of ours, or one\n  that is not public. **Over `https` it is also the answer when the connection to the server\n  cannot be opened, twice in a row** — a name that does not resolve, a server that refuses us —\n  so check the link's host, and that it accepts connections from the addresses we fetch from;\n- `unreachable` — no answer, after trying again for a while: over plain `http`, a name that\n  does not resolve or a connection that fails; a TLS failure or a timeout; or a server that kept\n  failing (`5xx`) or pushing back (`429`);\n- `not_found` — `404` or `410`: the link is wrong, or the file is gone;\n- `refused` — any other `4xx`, typically a presigned link that expired: sign it for longer than\n  the download may take, retries included; or a redirect we do not follow: a sixth one, or one\n  from `https` to plain `http`;\n- `not_a_file` — a web page where a file was expected: link to the file itself;\n- `too_large` — larger than a file may be, 10 GiB;\n- `interrupted` — the download broke off more times than it is retried;\n- `checksum_mismatch` — the file was downloaded twice, and twice it was not the `sha256` you\n  gave.\n\n**The list may grow**, like `source`'s: read a code you do not know as a failure your code does\nnot handle yet.","enum":["address_refused","unreachable","not_found","refused","not_a_file","too_large","interrupted","checksum_mismatch"]},"UploadSource":{"type":"string","description":"Where an upload's bytes come from: `client` — the caller sends the file to `upload_url`;\n`link` — we download it from `source_url`.\n\n**The list may grow**: a client should read a value it does not know as *a source this client\ndoes not handle*, not as an error.","enum":["client","link"]},"UploadStatus":{"type":"string","description":"Where an upload is. Both sources reach every value but `failed`, which is a link's alone:\n\n- `pending` — open, nothing received yet; for a link, the download has not started;\n- `receiving` — bytes are arriving; for a link, the download is running;\n- `completed` — the file is stored, and the asset goes on to `processing`;\n- `cancelled` — given up on with `DELETE /v1/uploads/{upload_id}`; for a file you send, also\n  with the tus termination on `upload_url`, and for a link, when its asset is deleted before\n  the file has arrived;\n- `expired` — a file you send that did not complete before `expires_at`; for a link, a\n  download nobody was fetching any more;\n- `failed` — **a link's only**: the download failed, and `failure` says why;\n- `refused` — the file arrived and the organization's credit could not pay its first month of\n  storage, so nothing was kept: top up the credit, then upload the file again.\n\nThe last five are final, and the asset of an upload that ended any other way than\n`completed` ends `error`. **The list may grow**, like `source`'s.","enum":["pending","receiving","completed","cancelled","expired","failed","refused"]},"WatchedRange":{"type":"object","description":"One stretch of an asset a sitting watched.","required":["start_ms","end_ms"],"properties":{"end_ms":{"type":"integer","format":"int64","description":"Where it ends, in milliseconds from the asset's start — after `start_ms`, and at most the\nsession's `asset_duration_ms`."},"start_ms":{"type":"integer","format":"int64","description":"Where it starts, in milliseconds from the asset's start."}}},"WorkspaceCount":{"type":"object","description":"How many workspaces the listing would answer.","required":["count"],"properties":{"count":{"type":"integer","format":"int64","description":"Counted when asked: a listing begun afterwards may meet workspaces created or deleted\nsince."}}},"WorkspaceSummary":{"type":"object","description":"One workspace of the organization.","required":["id","name","created_at","updated_at"],"properties":{"created_at":{"type":"string","format":"date-time","description":"When it was created (RFC 3339). Lists are ordered by this instant, then by `id`."},"id":{"type":"string","format":"uuid","description":"The workspace's identifier — what an asset's `workspace_id` names."},"name":{"type":"string","description":"Its name, as the organization wrote it."},"updated_at":{"type":"string","format":"date-time","description":"When anything about it last changed (RFC 3339)."}}},"WritablePublicationAccess":{"type":"string","description":"Who a publication is for, as a request sets it: `public` — anybody the channel lets in;\n`authenticated` — anybody who signed in to the channel, or gave its password.\n\nIt is the publication's own level, not what a visitor gets: on a channel that asks every\nvisitor to sign in, a `public` publication is still behind that sign-in. `restricted`, `paid`\nand `on_request` are read and not set by a request — each stands for a right or an offer set\nfrom Videas, and is accepted here once those can be set through this API. Sending one is a\n`400`.","enum":["public","authenticated"]}},"responses":{"InternalError":{"description":"A failure on our side. Quote the body's `request_id` when you tell us about it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"RateLimited":{"description":"More than this API accepts right now, from this key or its organization. Wait the number of seconds `Retry-After` gives, then send the request again.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"How many seconds to wait before sending it again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"ServiceUnavailable":{"description":"The service cannot answer right now. Send the request again after a growing delay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"TimedOut":{"description":"The server stopped waiting for this request. A `GET`, a `PATCH` or a `PUT` is safe to send again as it is; look for what a `POST` may have created before sending it again, as « Retrying » says.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"securitySchemes":{"api_key":{"type":"http","scheme":"bearer","description":"An API key belonging to your organization, `ak_…`. An owner or an administrator creates one in the Videas console; the raw value is shown once."}}},"security":[{"api_key":[]}],"tags":[{"name":"analytics","description":"What the organization's audience watched, as measured: its playback sessions, read from the analytics store — the played ones only, whatever became of their asset, and bots left out."},{"name":"assets","description":"The organization's library: its videos, sounds, pictures and documents, each in one workspace."},{"name":"categories","description":"The trees the organization's channels file their videos in, one category at a time: rebuild a channel's tree from each category's `parent_id`."},{"name":"channels","description":"The organization's channels: the public sites where it publishes videos for an audience, each at its own address."},{"name":"collections","description":"The organization's collections: lists of its library's assets played one after the other, such as playlists, and what each one plays."},{"name":"custom-fields","description":"The organization's own fields: what an asset of its library may carry beside its name and its description, where each applies, and the options a `choice` field offers."},{"name":"integrations","description":"Connecting an integration without anybody copying a key: the one-time code handed back when a person of the organization approves it, exchanged for the key, and a key giving itself back when the integration disconnects."},{"name":"publications","description":"What the organization's channels publish: each an asset of the library on one channel, at its own address, filed in that channel's categories."},{"name":"uploads","description":"Adding a file to the library: the asset is created at once, and its file sent to the address the upload answers — or fetched from a link."},{"name":"workspaces","description":"The workspaces the organization files its library in — what an asset's `workspace_id` names — and the folders each one files its assets in, which a key reads and makes."}]}