Update Media

Update a media object by ID.


PATCH
/media/{id}

Authorization

AuthorizationRequiredBearer <token>

See API Security for more details.

In: header

Request Body

application/jsonRequired

The request body should contain a properly formatted JSON object. Optional properties are listed below. See Media Object for more details.

titlestring
altstring
metadataobject

Path Parameters

idRequiredstring

Response Body

Success

TypeScript Definitions

Use the response body type in TypeScript.

metaobject
dataobject
errorobject | null | null
linksobject
const body = JSON.stringify({
  "title": "Updated Video Example",
  "alt": "An updated example video used to demonstrate the ittybit API",
  "metadata": {
    "customKey2": "a different custom value"
  }
})

fetch("https://api.ittybit.com/media/med_abcdefgh1234", {
  headers: {
    "Authorization": "Bearer <token>"
  },
  body
})
{
  "meta": {
    "request_id": "req_abcdefghij1234567890",
    "org_id": "org_abcdefgh1234",
    "project_id": "prj_abcdefgh1234",
    "version": "2025-01-01",
    "type": "object"
  },
  "data": {
    "id": "med_abcdefgh1234",
    "object": "media",
    "kind": "video",
    "title": "Updated Video Example",
    "alt": "An updated example video used to demonstrate the ittybit API",
    "width": 1920,
    "height": 1080,
    "duration": 123.45,
    "files": [
      {
        "id": "file_abcdefgh1234",
        "object": "source",
        "etc": "..."
      },
      {
        "id": "file_abcdefgh5678",
        "object": "source",
        "etc": "..."
      }
    ],
    "urls": {
      "original": "https://you.ittybit.net/example/video.mp4",
      "thumbnail": "https://you.ittybit.net/example/image.png"
    },
    "background": "#2OBO75",
    "metadata": {
      "customKey": "your custom value"
    },
    "created": "2025-01-01T01:23:45Z",
    "updated": "2025-01-01T01:23:46Z"
  },
  "error": null,
  "links": {
    "self": "https://api.ittybit.com/media/med_abcdefgh1234",
    "parent": "https://api.ittybit.com/media"
  }
}