List media
Media library items, one page at a time.
Access: WordPress core’s own rules for this route decide.
/mediaOptional — this operation also accepts unauthenticated requests.
wordpress_logged_in_{hash}API key · cookieWordPress's logged-in cookie, as a browser holds it after signing in. A request with it must also carry X-WP-Nonce.
X-WP-NonceAPI key · headerA WordPress REST nonce (wp_create_nonce('wp_rest')) for the cookie's session.
AuthorizationBasic auth · headerA WordPress user name and one of the user's application passwords.
AuthorizationBearer token (JWT) · headerA First Identity access token.
limitintegerHow many rows to return: 50 unless given, and never more than 100.
offsetintegerHow many rows to skip.
cursorstringThe cursor of the previous page, to read the next one. It replaces offset.
searchstringText to find, as WordPress core searches this route.
One page of rows.
dataMedia[]requiredShow propertiesHide properties
Mediaidintegerrequiredurlstringrequiredmimestringrequiredsizeintegerwidthinteger | nullheightinteger | nullaltstring | nullfilenamestringcreatedAtstring<date-time>sizesobjectfocalobject | nullShow propertiesHide properties
xnumberynumberauthorinteger | nullcaptionstring | nullcursorstring | nullrequiredAn error, as an RFC 9457 problem document.
typestringrequiredAlways about:blank: code names the problem.
titlestringrequiredThe problem in a few words.
statusintegerrequiredThe HTTP status.
codestringrequiredA stable name for the problem, such as unauthenticated, forbidden, not_found, invalid_input, invalid_query, invalid_json, method_not_allowed, unique_violation or reference_violation.
detailstringrequiredWhat went wrong, for a person.
pointerstringA JSON pointer to the field of the request at fault, when there is one.
An error, as an RFC 9457 problem document.
typestringrequiredAlways about:blank: code names the problem.
titlestringrequiredThe problem in a few words.
statusintegerrequiredThe HTTP status.
codestringrequiredA stable name for the problem, such as unauthenticated, forbidden, not_found, invalid_input, invalid_query, invalid_json, method_not_allowed, unique_violation or reference_violation.
detailstringrequiredWhat went wrong, for a person.
pointerstringA JSON pointer to the field of the request at fault, when there is one.