Media
Get a media item by id
Retrieve a single media item by its id. To fetch by file name instead, query the media list endpoint with query={"name":"..."}.
get/buckets/{slug}/media/{media_id}
Request
- Base URLhttps://api.cosmicjs.com/v3
- AuthAPI key in query parameter read_key
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Query parameters
read_keystring
The Bucket read key. Required unless the Bucket has no read key configured.
propsstring
Comma-separated list of properties to return, including nested metadata paths. Omit to return everything. Narrowing props is the main way to keep responses under the 6 MB response cap and to reduce latency.
useCacheboolean
Set to false to bypass the cache and read through to the database. Guarantees you see writes you just made, at the cost of higher latency.
prettyboolean
Set to true to indent the JSON response for human reading. Increases response size.
Response
The requested media item.
Example response
{
"media": {
"type": "image/png"
}
}Changes
No recorded changes to this operation across all 1 revision of this API.