# impartire API — Reference: Asset types

Every path is under `https://impartire.com/api/v1`. The machine-readable contract is https://impartire.com/api/v1/openapi.json (OpenAPI 3.1).

#### GET /api/v1/asset-types

List the asset types the org can create assets of, with their field definitions and file slots

Each type's `fields` is the validation contract for `fields` on POST and PATCH /assets: a declared key must hold a value of its type.

Scopes: `assets:read`

Response 200 — `AssetTypeList`

- `data` (array of AssetType, required)
  - `id` (string (uuid), required)
  - `name` (string, required)
  - `kind` ("asset", required)
  - `fields` (array of AssetField, required) — The type's live field definitions, in the app's form order. Deprecated fields, and for an OAuth token the fields its person may not read, are left out.
    - `id` (string (uuid), required)
    - `key` (string, required) — The key a value is stored under in an asset's `fields`.
    - `name` (string, required) — The field's label, as the app shows it.
    - `type` (string, required) — text | url (a string) · select (one option `value`) · multiselect (an array of option values) · date (YYYY-MM-DD) · datetime (epoch milliseconds) · number · reference (an id, or an array of ids when `multiple`). More may be added.
    - `required` (boolean, required) — Required for the asset to be ready (a workflow gate may wait on it). Not enforced on a write: an asset may be created empty and filled in later.
    - `multiple` (boolean, required) — For a reference field, whether the value is an array of ids.
    - `options` (array of object or null, required) — For select and multiselect, the accepted values (store `value`; `label` is for display). Null for every other type.
      - `value` (string, required)
      - `label` (string, required)
  - `file_slots` (array of FileSlot, required)
    - `id` (string (uuid), required)
    - `name` (string or null, required)
    - `media_type` (string, required) — video | image | audio | document | subtitle
    - `accept_extensions` (array of string or null, required) — Accepted file extensions, or null for any of the media type.
    - `multiple` (boolean, required) — Whether the slot holds several files.
- `next_cursor` (string or null, required) — Always null: the list is returned whole.

Other responses:

- 401 (Problem) — unauthenticated — no key, or an unknown, revoked or expired one.
- 403 (Problem) — insufficient-scope — the key lacks a required scope.
- 404 (Problem) — not-found.
- 429 (Problem) — rate-limited — the key's request budget is spent; wait Retry-After seconds.
- 500 (Problem) — internal.
