# Set chapters, captions, audio tracks or the transcript of a video or audio file

`PUT /assets/{id}/media-facts` · Rivier · files

Set chapters, captions, audio tracks or the transcript of a video or audio file. A model's drafts are held as unreviewed until a person reviews them.

- Scope: files:write
- Mcp: rivier_assets_media_facts
- Graphql: Mutation.filesAssetMediaFacts
- Sdk: files.asset.mediaFacts
- Cli: files asset media facts
- Events: files.asset.updated

## Parameters

- `id` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "chapters": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "start": {
            "type": "number",
            "minimum": 0
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "thumbnail": {
            "type": "string",
            "pattern": "^[A-Za-z0-9._-]{1,80}$"
          },
          "aiGenerated": {
            "type": "boolean",
            "default": false
          },
          "reviewed": {
            "type": "boolean",
            "default": false
          },
          "reviewedBy": {
            "type": "string",
            "maxLength": 200
          }
        },
        "required": [
          "start",
          "title"
        ],
        "additionalProperties": false
      },
      "maxItems": 200,
      "default": []
    },
    "captions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "lang": {
            "type": "string",
            "maxLength": 12
          },
          "kind": {
            "type": "string",
            "enum": [
              "subtitles",
              "captions"
            ]
          },
          "assetId": {
            "type": "string",
            "format": "uuid"
          },
          "vtt": {
            "type": "string",
            "maxLength": 500000
          },
          "aiGenerated": {
            "type": "boolean",
            "default": false
          },
          "reviewed": {
            "type": "boolean",
            "default": false
          },
          "reviewedBy": {
            "type": "string",
            "maxLength": 200
          }
        },
        "required": [
          "lang",
          "kind"
        ],
        "additionalProperties": false
      },
      "maxItems": 40,
      "default": []
    },
    "audioTracks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "lang": {
            "type": "string",
            "maxLength": 12
          },
          "label": {
            "type": "string",
            "maxLength": 60
          }
        },
        "required": [
          "lang",
          "label"
        ],
        "additionalProperties": false
      },
      "maxItems": 20,
      "default": []
    },
    "transcript": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "lang": {
              "type": "string",
              "maxLength": 12
            },
            "segments": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "start": {
                    "type": "number",
                    "minimum": 0
                  },
                  "end": {
                    "type": "number",
                    "minimum": 0
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 2000
                  }
                },
                "required": [
                  "start",
                  "end",
                  "text"
                ],
                "additionalProperties": false
              },
              "maxItems": 20000
            },
            "aiGenerated": {
              "type": "boolean",
              "default": false
            },
            "reviewed": {
              "type": "boolean",
              "default": false
            },
            "reviewedBy": {
              "type": "string",
              "maxLength": 200
            }
          },
          "required": [
            "lang",
            "segments"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "posterAtSeconds": {
      "anyOf": [
        {
          "type": "number",
          "minimum": 0,
          "maximum": 36000
        },
        {
          "type": "null"
        }
      ],
      "default": null
    }
  },
  "additionalProperties": false
}
```

## Responses

- `200`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X PUT 'https://api.rivier.ai/assets/{id}/media-facts' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "chapters": [],
  "captions": [],
  "audioTracks": [],
  "transcript": null,
  "posterAtSeconds": null
}'
```
