Update Media

View Markdown

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

Header Parameters

Accept-Versionstring

Specifies the API Version

Default: "2025-08-20"Value in: "2025-08-20" | "latest"

Response Body

Success

idRequiredstring
objectRequiredstring
kindstring
Value in: "video" | "image" | "audio"
titlestring
altstring
widthinteger
heightinteger
durationnumber
Format: "float"
filesRequiredarray<object>
urlsRequiredobject
backgroundstring
metadataobject
createdRequiredstring
Format: "date-time"
updatedRequiredstring
Format: "date-time"
const body = {
  title: "Updated Video Example",
  alt: "An updated example video used to demonstrate the ittybit API",
  metadata: { "anotherKey": "an updated value" }
};

const media = await fetch("https://api.ittybit.com/media/med_abcdefgh1234", {
  method: "PATCH",
  headers: { "Authorization": "Bearer ITTYBIT_API_KEY" },
  body: JSON.stringify(body)
})
{
  "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": "a different custom value"
  },
  "created": "2025-01-01T01:23:45Z",
  "updated": "2025-01-01T01:23:46Z"
}