---
title: "PUT /api/grants/{id}/items"
method: PUT
path: "/api/grants/{id}/items"
tags: ["grants"]
---

# PUT /api/grants/{id}/items

`PUT /api/grants/{id}/items`

## Request

- The document declares no server URL.
- Auth: one of:
  - API key in header `Authorization`
  - API key in cookie `sessionid`

Save the chosen videos, pinned, in the order given. With
`automatic`, the grant's recipe fills the time they leave.

## Path parameters

- `id` integer, required

## Request body

- GrantItemsWriteRequest: The videos the organization chose, in playing order. They replace the current list and are pinned.
  - `items` GrantItemWriteRequest[], required
    - `video` integer
    - `poster` integer
    - `graphic` integer: Staff only.
    - `duration` string: With `graphic`: how long it is on.
  - `automatic` boolean: True: the grant's recipe fills the time these videos leave, and keeps doing so. False: the list stays exactly as given.
  - `recipe` RecipeRequest: With `automatic`: how the grant fills itself. Leave out to keep what it has.
    - `kind` 'uploads' | 'series' | 'playlist' | 'jukebox', required: * `uploads` - Everything the owner uploads * `series` - One of the owner's series * `playlist` - A list of videos * `jukebox` - The video jukebox
    - `series` integer, nullable
    - `name` string
    - `categories` integer[]
    - `shortest` string, nullable
    - `longest` string, nullable
    - `newerThanDays` integer, nullable
    - `olderThanDays` integer, nullable
  - `wholeSlot` boolean: With `recipe`: make it the choice for the grant's recurring slot too, so its other broadcasts follow.

## Response `200`

- AirtimeGrant
  - `id` integer, required
  - `organization` GrantOrganization, required
    - `id` integer, required
    - `name` string, required
  - `starttime` string, date-time, required
  - `endtime` string, date-time, required
  - `state` 'open' | 'locked' | 'compiled' | 'cancelled', required: * `open` - Open * `locked` - Locked * `compiled` - Compiled * `cancelled` - Cancelled
  - `locksAt` string, date-time, required
  - `lockExempt` boolean, required: Editable until air; every save after compiling recompiles it. Staff only.
  - `recipe` Recipe, nullable, required: How the grant fills the time its pinned items leave. Null: hand-made.
    - `id` integer, required
    - `kind` 'uploads' | 'series' | 'playlist' | 'jukebox', required: * `uploads` - Everything the owner uploads * `series` - One of the owner's series * `playlist` - A list of videos * `jukebox` - The video jukebox
    - `description` string, required
    - `series` integer, nullable
    - `seriesName` string, nullable, required
    - `name` string
    - `categories` integer[]
    - `shortest` string, nullable
    - `longest` string, nullable
    - `newerThanDays` integer, nullable
    - `olderThanDays` integer, nullable
  - `originSlot` integer, nullable, required: Provenance only: the grant copied the slot's time when issued.
  - `items` GrantItem[], required
    - `position` integer, required
    - `video` GrantItemVideo, nullable, required
      - `id` integer, required
      - `name` string, required
      - `duration` string, required
      - `organization` GrantOrganization, required
        - `id` integer, required
        - `name` string, required
      - `pendingUpload` boolean, required: An entry made ahead of its file; its duration was set by hand.
      - `liveSource` GrantItemLiveSource, nullable, required: Set for a live programme: it airs from this source until it has a file.
        - `id` integer, required
        - `name` string, required
    - `poster` GrantItemPoster, nullable, required: Set instead of `video` for a text poster.
      - `id` integer, required
      - `template` 'standard' | 'notice', required: * `standard` - Vanlig * `notice` - Viktig melding
      - `heading` string, required
      - `text` string, required
      - `duration` string, required: How long it is on screen each time it airs.
    - `graphic` GrantItemGraphic, nullable, required: Set instead of `video` for a staff graphic, on for `duration`.
      - `id` integer, required
      - `name` string, required
      - `url` string, required: Where CasparCG loads it from: a full address, or a path on the site such as /infographics/ (add ?page=<id> to hold one page). Playout adds ?duration=<ms>.
    - `duration` string, nullable, required: How long the graphic is on. Only for a graphic.
    - `pinned` boolean, required: Chosen by the owner. Automatic filling keeps it and fills around it.
  - `itemsDuration` string, required: From the grant's start to the end of the list, with the gaps that start each programme on the five-minute grid.
  - `padded` boolean, required: Whether programmes start on the five-minute grid, at least 30 s after the programme before. Posters follow whatever is before them. False for a jukebox grant, which plays back to back.
  - `canEdit` boolean, required: Whether the requesting user may replace the list right now.
  - `startedItems` integer, required: How many entries at the head of the list have aired, are on air or start within seconds. Staff may change what follows them, and move the end, while the grant is on air.
  - `airedItems` integer, required: How many entries at the head of the list have finished airing. An edit must keep them first, as they are. Staff may leave out the ones between this and `startedItems`: that takes them off the air at once.

## Other responses

- `400`
- `401`
- `404`
- `405`
- `406`
- `415`
- `500`

## Changes

- **2026-11-16** `deeacd00bbb6`: 1 breaking, 5 info
  - added `#/components/schemas/GrantsItemsUpdateItemsINDEXGraphicErrorComponent, #/components/schemas/GrantsItemsUpdateItemsINDEXDurationErrorComponent` to the `oneOf[#/components/schemas/GrantsItemsUpdateValidationError]/errors/items/` response property `oneOf` list for the response status `400`
  - added the new optional request property `items/items/duration`
  - added the new optional request property `items/items/graphic`
  - added `items.INDEX.graphic, items.INDEX.duration` discriminator mapping keys to the `oneOf[#/components/schemas/GrantsItemsUpdateValidationError]/errors/items/` response property for the response status `400`
  - …2 more
- **2026-11-16** `d41a12e49411`: 1 info
  - added the required property `airedItems` to the response with the `200` status
- **2026-11-16** `f1620d3cfe01`: 1 info
  - added the required property `startedItems` to the response with the `200` status
- …earlier changes not shown

[Operation history](https://skmtc.dev/frikanalen/apis/frikanalen-django-api/changes/api/grants/:id/items/put.md)

---

[API](https://skmtc.dev/frikanalen/apis/frikanalen-django-api.md) - [All operations](https://skmtc.dev/frikanalen/apis/frikanalen-django-api/llms.txt) - [OpenAPI document](https://skmtc.dev/frikanalen/apis/frikanalen-django-api/revisions/ebd4175e41fe?raw)
