Create Media

View Markdown

Create a new media object.

Media created in this way will be empty. You can add either new or existing files using the Files endpoints.


POST
/media

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 with one or more of title, alt, or metadata properties. See Media Object for more details.

titlestring
altstring
metadataobject

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: "My Video Example",
  alt: "An example video used to demonstrate the ittybit API",
  metadata: { "anotherKey": "another customer value" }
};

const media = await fetch("https://api.ittybit.com/media", {
  method: "POST",
  headers: { "Authorization": "Bearer ITTYBIT_API_KEY" },
  body: JSON.stringify(body)
});
{
  "id": "med_abcdefgh1234",
  "object": "media",
  "kind": null,
  "title": "My Video Example",
  "alt": "An example video used to demonstrate the ittybit API",
  "files": [],
  "urls": {},
  "background": null,
  "metadata": {
    "customKey": "your custom value"
  },
  "created": "2025-01-01T01:23:45Z",
  "updated": "2025-01-01T01:23:45Z"
}