Umbraco Heartcore
CMSCloudDXP
  • What is Umbraco Heartcore?
    • Compare with Umbraco CMS
  • Versions and updates
  • Getting Started
    • API Browser
    • Backoffice Users and API Keys
    • Building a project from scratch
    • Environments
    • GraphQL Playground
    • Preview
    • The Umbraco Cloud Portal
    • Tour of the Backoffice
    • Using the Forms API
    • Webhooks
    • Deployment workflow
      • Content and media transfer / restore
      • Structure deployments
  • API Documentation
    • API Documentation
      • Rate Limits
    • Content Delivery
      • Content
      • Media
      • Redirect API
    • Content Management
      • Umbraco Forms
      • Languages
      • Content
        • Content Types
      • Media
        • Media Types
      • Members
        • Member Groups
        • Member Types
      • Relations
        • Relation Types
    • GraphQL API
      • Filtering and Ordering
      • Property Editors
      • Schema Generation
      • Persisted Queries
  • Backoffice
    • Custom Grid Editors
  • Client Libraries
    • Client Libraries
    • .NET Core Console Application
    • Node.js Client library
    • .NET Client library
      • MVC Sample
      • Content Management Sample
  • Tutorials
    • Custom Grid Editors
    • Querying with GraphQL
    • Creating content with media
  • Release Notes
    • February 2024
    • April 2024
    • August 2024
    • September 2024
    • April 2025
Powered by GitBook
On this page
  • Table of Contents
  • Common Headers
  • Errors
  • Get root media
  • Success Response
  • Get by id
  • Success Response
  • Get children
  • Success Response

Was this helpful?

Edit on GitHub
Export as PDF
  1. API Documentation
  2. Content Delivery

Media

PreviousContentNextRedirect API

Last updated 2 years ago

Was this helpful?

BASE URL: https://cdn.umbraco.io

Table of Contents

Common Headers

Api-Version: 2
Umb-Project-Alias: {project-alias}

Errors

If an error occours you will receive a HTTP status code along with an API error code and an error message in the response body.

Status Code
Error Code
Message

401

Unauthorized

Authorization has been denied for this request.

404

NotFound

Media with id '{id}' could not be found.

500

InternalServerError

Internal server error.

JSON example:

{
  "error": {
    "code": "NotFound",
    "message": "Media with id 'b6f11172-373f-4473-af0f-0b0e5aefd21c' could not be found."
  }
}

Get root media

Get all media at the root of the tree.

URL: /media

Method: GET

Success Response

Code: 200

Content Example:

{
    "_links": {
        "self": {
            "href": "https://cdn.umbraco.io/media"
        },
        "media": [
            {
                "href": "https://cdn.umbraco.io/media/b6f11172-373f-4473-af0f-0b0e5aefd21c"
            },
            {
                "href": "https://cdn.umbraco.io/media/1fd2ecaf-f371-4c00-9306-867fa4585e7a"
            },
            {
                "href": "https://cdn.umbraco.io/media/6d5bf746-cb82-45c5-bd15-dd3798209b87"
            }
        ]
    },
    "_embedded": {
        "media": [
            {
                "_creatorName": "Rasmus",
                "_url": "",
                "_writerName": "Rasmus",
                "_hasChildren": true,
                "_level": 1,
                "_createDate": "2019-06-17T13:46:41.47Z",
                "_id": "b6f11172-373f-4473-af0f-0b0e5aefd21c",
                "_updateDate": "2019-06-17T13:46:41.47Z",
                "_links": {
                    "self": {
                        "href": "https://cdn.umbraco.io/media/b6f11172-373f-4473-af0f-0b0e5aefd21c"
                    }
                },
                "mediaTypeAlias": "Folder",
                "name": "Design",
                "sortOrder": 1
            },
            {
                "_creatorName": "Rasmus",
                "_url": "",
                "_writerName": "Rasmus",
                "_hasChildren": true,
                "_level": 1,
                "_createDate": "2019-06-17T13:46:41.64Z",
                "_id": "1fd2ecaf-f371-4c00-9306-867fa4585e7a",
                "_updateDate": "2019-06-17T13:46:41.64Z",
                "_links": {
                    "self": {
                        "href": "https://cdn.umbraco.io/media/1fd2ecaf-f371-4c00-9306-867fa4585e7a"
                    }
                },
                "mediaTypeAlias": "Folder",
                "name": "People",
                "sortOrder": 1
            },
            {
                "_creatorName": "Rasmus",
                "_url": "",
                "_writerName": "Rasmus",
                "_hasChildren": true,
                "_level": 1,
                "_createDate": "2019-06-17T13:46:41.783Z",
                "_id": "6d5bf746-cb82-45c5-bd15-dd3798209b87",
                "_updateDate": "2019-06-17T13:46:41.783Z",
                "_links": {
                    "self": {
                        "href": "https://cdn.umbraco.io/media/6d5bf746-cb82-45c5-bd15-dd3798209b87"
                    }
                },
                "mediaTypeAlias": "Folder",
                "name": "Products",
                "sortOrder": 1
            }
        ]
    }
}

Get by id

Get a single media by its ID.

URL: /media/{id}

Method: GET

Success Response

Code: 200

Content Example:

{
    "_creatorName": "Rasmus",
    "_url": "https://media.umbraco.io/my-headless-site/media/662af6ca411a4c93a6c722c4845698e7/00000006000000000000000000000000/16403439029_f500be349b_o.jpg",
    "_writerName": "Rasmus",
    "_hasChildren": false,
    "_level": 2,
    "_createDate": "2019-06-17T13:46:42.203Z",
    "_id": "662af6ca-411a-4c93-a6c7-22c4845698e7",
    "_updateDate": "2019-06-17T13:46:42.203Z",
    "_links": {
        "self": {
            "href": "https://cdn.umbraco.io/media/662af6ca-411a-4c93-a6c7-22c4845698e7"
        },
        "root": {
            "href": "https://cdn.umbraco.io/media"
        },
        "children": {
            "href": "https://cdn.umbraco.io/media/662af6ca-411a-4c93-a6c7-22c4845698e7/children"
        },
        "parent": {
            "href": "https://cdn.umbraco.io/media/b6f11172-373f-4473-af0f-0b0e5aefd21c"
        }
    },
    "mediaTypeAlias": "Image",
    "name": "Umbraco Campari Meeting Room",
    "parentId": "b6f11172-373f-4473-af0f-0b0e5aefd21c",
    "sortOrder": 0,
    "umbracoFile": {
        "src": "/media/662af6ca411a4c93a6c722c4845698e7/00000006000000000000000000000000/16403439029_f500be349b_o.jpg",
        "focalPoint": null,
        "crops": null
    },
    "umbracoWidth": 1600,
    "umbracoHeight": 1067,
    "umbracoBytes": 759116,
    "umbracoExtension": "jpg"
}

Get children

Get children of a single media.

URL: /media/{id}/children

Method: GET

Query Strings

?page={integer=1}
?pageSize={integer=10}

Success Response

Code: 200

Content Example:

{
    "_totalItems": 1,
    "_totalPages": 1,
    "_page": 1,
    "_pageSize": 10,
    "_links": {
        "self": {
            "href": "https://cdn.umbraco.io/media/b6f11172-373f-4473-af0f-0b0e5aefd21c/children?page=1"
        },
        "page": {
            "href": "https://cdn.umbraco.io/media/{id}/children{?page,pageSize}",
            "templated": true
        },
        "root": {
            "href": "https://cdn.umbraco.io/media"
        },
        "media": {
            "href": "https://cdn.umbraco.io/media/662af6ca-411a-4c93-a6c7-22c4845698e7"
        }
    },
    "_embedded": {
        "media": [
            {
                "_creatorName": "Rasmus",
                "_url": "https://media.umbraco.io/my-headless-site/media/662af6ca411a4c93a6c722c4845698e7/00000006000000000000000000000000/16403439029_f500be349b_o.jpg",
                "_writerName": "Rasmus",
                "_contentTypeAlias": "Image",
                "_createDate": "2019-06-17T13:46:42.203Z",
                "_updateDate": "2019-06-17T13:46:42.203Z",
                "_hasChildren": false,
                "_id": "662af6ca-411a-4c93-a6c7-22c4845698e7",
                "_level": 2,
                "_name": "Umbraco Campari Meeting Room",
                "_parentId": "b6f11172-373f-4473-af0f-0b0e5aefd21c",
                "_sortOrder": 0,
                "_links": {
                    "self": {
                        "href": "https://cdn.umbraco.io/media/662af6ca-411a-4c93-a6c7-22c4845698e7"
                    },
                    "root": {
                        "href": "https://cdn.umbraco.io/media"
                    },
                    "children": {
                        "href": "https://cdn.umbraco.io/media/662af6ca-411a-4c93-a6c7-22c4845698e7/children"
                    }
                },
                "umbracoFile": {
                    "src": "/media/662af6ca411a4c93a6c722c4845698e7/00000006000000000000000000000000/16403439029_f500be349b_o.jpg",
                    "focalPoint": null,
                    "crops": null
                },
                "umbracoWidth": 1600,
                "umbracoHeight": 1067,
                "umbracoBytes": 759116,
                "umbracoExtension": "jpg"
            }
        ]
    }
}
Common Headers
Errors
Get Root Media
Get By Id
Get Children