Endpoints

POST /enqueue

Puts an upload job on the queue. The body is one of two shapes, told apart by its top-level keys.

SNS envelope (the metadata-check Lambda): a body with a top-level Type or Message key. The Vimond id is vimond_id inside the Message JSON.

Prepared job (the intake Lambda in tv4-youtube-mapper): a complete job with the fields in the table below, keyed on the metadata clip id. The worker fetches nothing from Vimond for it except the video file: it resolves the Vimond id through nordic-idmap and uses it only for the delivered_assets dedupe and the video lookup. When the SNS path is switched off, the dedupe key moves to the clip id, with a one-time backfill of the Vimond ids already in the set.

Requires a valid API key. An SNS envelope may send it in the X-Api-Key header or the key query string parameter. A prepared job must send it in the X-Api-Key header; key in the query string is answered with 401.

Example cURL request, prepared job
curl -X POST -H 'X-Api-Key: <KEY>' -H 'Content-Type: application/json' \
  -d '{"clip_id":"1e0d2d46-8a4c-4fd9-9b39-0d4f2b0e1f60","template":"Nyhetsmorgon (Nyhetsmorgon)","title":"Så blir vädret i helgen","description":"Meteorologen om helgens väder.","publish_at":"2026-09-24T06:30:00Z","image_url":"https://images.example.com/clips/1e0d2d46.jpg"}' \
  https://tv4-youtube-uploader.a2d-stage.tv/enqueue
Example cURL request, SNS envelope
curl -X POST -H 'X-Api-Key: <KEY>' -d '{"Subject":"asset","Message":"{\"vimond_id\":\"3968321\"}"}' https://tv4-youtube-uploader.a2d-stage.tv/enqueue
  • Parameters
  • Name Description Required Type Example
    vimond_id (SNS)

    Inside Message. The id of a Vimond asset that is marked for upload to YouTube.

    Required string 3968321
    clip_id

    Prepared job. Clip in the metadata repository. The job id, SFTP folder, file names and end of the CSV custom_id; logged on every worker line.

    Required string 1e0d2d46-8a4c-4fd9-9b39-0d4f2b0e1f60
    template

    Prepared job. Mapper key, looked up in tv4-youtube-mapper as today; an unknown key means the clip is not published.

    Required string Nyhetsmorgon (Nyhetsmorgon)
    title

    Prepared job.

    Required string Så blir vädret i helgen
    description

    Prepared job.

    Optional string Meteorologen om helgens väder.
    publish_at

    Prepared job. RFC 3339; becomes start_time in the CSV and the <date> in the description suffix.

    Required string 2026-09-24T06:30:00Z
    image_url

    Prepared job. Absolute http(s) URL of the 16:9 image, fetched as-is.

    Required string https://images.example.com/clips/1e0d2d46.jpg
  • Response 200 SHOW
  • < Content-Type: application/json; charset=utf-8
  • Response 400 SHOW
  • Returned if the body is not JSON, or a prepared job is missing a field or has a malformed one. errors[0].detail names the field.
    
    
  • Response 401 SHOW
  • Returned if the API key is invalid, or a prepared job sent it as a query parameter
    
    
  • Response 405 SHOW
  • Response 500 SHOW
  • Returned if the job could not be put on the queue, or an SNS Message has no vimond_id
    
    
GET /delivery/keys

A sorted list of all delivery keys

  • Response 200 SHOW
  • < Content-Type: application/json; charset=utf-8

Info

Endpoints containing information about the TV4 YouTube Uploader service.

GET /__status

Whatsup status document

  • Response 200 SHOW
  • < Content-Type: application/json; charset=utf-8
GET /workers

Information about the state of the workers

  • Response 200 SHOW
  • < Content-Type: application/json; charset=utf-8