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

# PUT /api/grants/{id}

`PUT /api/grants/{id}`

## Request

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

Airtime grants: a window of airtime given to one organization, and the
list of what plays in it.

Members see their organizations' grants and replace a grant's list
while it is open (or until air, if it is exempt from locking). Staff
see every grant, create grants, and cancel or exempt them.

## Path parameters

- `id` integer, required

## Request body

- AirtimeGrantUpdateRequest: Staff cancels a grant, moves its deadline or end, or exempts it from locking.
  - `state` 'cancelled': Only 'cancelled': withdraw the grant and free its window. * `cancelled` - cancelled
  - `locksAt` string, date-time
  - `lockExempt` boolean
  - `starttime` string, date-time: Move the start, until the grant is on air. A start that has passed means now. Entries that no longer fit come off the list; an earlier start needs the extra time to be free.
  - `endtime` string, date-time: Move the end, even while the grant is on air: what is on air past it is cut short there. Entries that no longer fit come off the list. A later end needs the extra time to be free.

## 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`
- `403`
- `404`
- `405`
- `406`
- `415`
- `500`

## Changes

- **2026-11-16** `deeacd00bbb6`: 1 breaking, 5 info
  - added `#/components/schemas/GrantsUpdateStarttimeErrorComponent, #/components/schemas/GrantsUpdateEndtimeErrorComponent` to the `oneOf[#/components/schemas/GrantsUpdateValidationError]/errors/items/` response property `oneOf` list for the response status `400`
  - added the new optional request property `endtime`
  - added the new optional request property `starttime`
  - added `starttime, endtime` discriminator mapping keys to the `oneOf[#/components/schemas/GrantsUpdateValidationError]/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/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)
