Media

Lists the media belonging to the account. This endpoint can also be used to do a batch fetch based off of the hashed id.

Requires api token with one of the following permissions

Read all folder and media data

Tokens with the "Act with a team member's permissions" permission (all:delegate_to_contact_permissions scope) can also be used. Requests made with such a token are authorized using the permissions of the contact assigned to the token.

get/medias

Request

  • Base URL
    https://api.wistia.com/modern
  • URL
    https://api.wistia.com/modern/medias
  • Auth
    HTTP bearer

Query parameters

pageinteger

The page number to retrieve. This cannot be combined with cursor, pagination.

per_pageinteger

The number of medias per page. Use this for both offset pagination and cursor pagination.

enabled0 | 1

If cursor[enabled] is set to 1, the first result set will be fetched with cursor pagination enabled. This values is ignored if cursor[before] or cursor[after] are set.

beforestring

If cursor[before] is set then cursor pagination is enabled and all records before the cursor up to the per_page are returned. This feature is useful for fetching "new records", for example, in a "pull to refersh" feature when showing records in a descending order.

afterstring

If cursor[after] is set then cursor pagination is enabled and all records after the cursor up to the per_page are returned.

If cursor[enabled] is set to 1 then cursor pagination is enabled and the first set of records are fetched up to the per_page. Cursor pagination will also be turned on if cursor[before] or cursor[after] are set. Records returned will have a cursor property set which can be used to fetch more records in the same sort_by ordering. The cursor value of the last record can be used to fetch records after the current result set and the cursor of the first record can be used to fetch records before the result set.

NOTE: a cursor value is only valid if the sort_by value hasn't changed from the last fetch. For example, you cannot fetch using sort_by id and then pass that cursor value to a sort_by name.

sort_by'name' | 'created' | 'updated' | 'position'

Ordering. When using cursor pagination (see cursor param), only id and created are supported. All other sort_by options (name, updated, position) require offset pagination.

sort_direction0 | 1

Ordering Sort Direction (0 = desc, 1 = asc; default is 1)

folder_idstring

Hashed ID of the folder (e.g., "4d23503f70")

A hashed ID specifying the folder from which you would like to get results.

namestring

Find a media or medias whose name exactly matches this parameter.

description_format'markdown'
Example:markdown

Format for media descriptions

include'speakers'

Set to speakers to include active transcript speaker assignments used for diarization. Webinar hosts and panelists are not included.

type'Video' | 'Audio' | 'Image' | 'PdfDocument' | 'MicrosoftOfficeDocument' | 'Swf' | 'UnknownType'

A string specifying which type of media you would like to get.

hashed_ids[]string[]

Find all of the medias by these hashed_ids.

tags[]string[]

Find all of the medias that match all of these tag names.

archivedboolean

Filter by archived status. True will return only archived medias, while false will return only active medias.

Headers

X-Wistia-API-Versionstring required

Response

Successful response

idinteger

A unique numeric identifier for the media within the system.

namestring

The display name of the media.

type'Video' | 'Audio' | 'Image' | 'PdfDocument' | 'MicrosoftOfficeDocument' | 'Swf' | 'UnknownType'

A string representing what type of media this is.

archivedboolean

Whether or not the media is archived, either true or false.

createdstring date-time

The date when the media was originally uploaded.

updatedstring date-time

The date when the media was last changed.

durationnumber nullable

Specifies the length (in seconds) for audio and video files. Specifies number of pages in the document. Omitted for other types of media.

embedCodestring

DEPRECATED: If you want to programmatically embed videos, follow the construct an embed code guide.

hashed_idstring

A unique alphanumeric identifier for this media.

descriptionstring

A description for the media which usually appears near the top of the sidebar on the media's page.

progressnumber

A floating point value between 0 and 1 that indicates the progress of the processing for this file.

status'queued' | 'processing' | 'ready' | 'failed'

Post upload processing status. - queued: the file is waiting in the queue to be processed. - processing: the file is actively being processed. - ready: the file has been fully processed and is ready for embedding and viewing. - failed: the file was unable to be processed (usually a format or size error).

sectionstring nullable

The title of the section in which the media appears. This attribute is omitted if the media is not in a section (default).

protectedboolean nullable

Whether the media is protected (e.g. requires a password or other authentication to view). Null if the media is not protected.

cursorstring nullable

A cursor for stable pagination based on current sort_by order. You can pass this to cursor[before] or cursor[after] as a parameter to fetch the records before or after this record in the same sort order. This is only populated if records were fetched with cursor[enabled], or cursor[before] or cursor[after].

Example response

[
  {
    "folder": {
      "id": 22570,
      "name": "My Folder Title",
      "hashed_id": "4d23503f70"
    },
    "subfolder": {
      "hashed_id": "abc123def4",
      "name": "Marketing Videos",
      "description": "Collection of all marketing and promotional videos",
      "position": 1,
      "created": "2024-01-15T10:30:00+00:00",
      "updated": "2024-01-20T14:45:00+00:00"
    }
  }
]

Changes