# Media

The CDA (Content Delivery API) is a read-only API that delivers published resources to public visitors. This page covers how to read published *Media*, that is, file assets such as images, videos, and documents, and how to obtain their delivery addresses. Because CDA delivers a snapshot from the time of publishing, *Media* that has not yet been published in the content studio does not appear here.

CDA has only read (GET) endpoints; uploading, editing, and publishing *Media* is the responsibility of [CMA Media](/api/reference/cma/media.md). For CDA's common behavior, such as authentication and the published delivery model (the published snapshot, `revision`, and published-only visibility), see the [CDA overview](/api/reference/cda.md). Unlike the other published resources, *Media* **always** omits author information (`createdBy` and `updatedBy`). `title`, `description`, and `file` come back as single values resolved for the requested `locale`.

## Resource structure {#resource-structure}

The following is how CDA delivers, in a single read with `locale=en-US`, one published *Media* from the demo *Space* (a product photo of the "Stainless Tumbler 500ml"). Along with `sys` (system properties), it has `fields`, which holds the `title`, `description`, and `file` resolved for that locale.

```json
{
  "sys": {
    "id": "3trmXRM3RqbgSnifyg7PBe7ehkOn8e",
    "type": "Media",
    "space": { "sys": { "id": "tcq4V2Xb", "type": "Refer", "targetType": "Space" } },
    "createdAt": "2026-06-17T17:07:13.154Z",
    "updatedAt": "2026-06-17T17:07:13.384Z",
    "revision": 1
  },
  "fields": {
    "title": "Stainless Tumbler 500ml front shot",
    "description": "Front product shot of the tumbler on a white background.",
    "file": {
      "fileName": "tumbler.png",
      "contentType": "image/png",
      "mimeGroups": ["Image"],
      "url": "https://weegloo-media.com/medias/tcq4V2Xb/n8e/3trmXRM3RqbgSnifyg7PBe7ehkOn8e/en-US/1/tumbler.png",
      "detail": {
        "size": 50847,
        "image": { "width": 900, "height": 900 }
      }
    }
  }
}
```

Key properties:

- `sys.id`: The unique identifier of the *Media*. It goes into `{mediaId}` in the single-read path.
- `sys.revision`: The version at the time it was published. Because CDA does not carry the management `version`, `revision` is the only value that points to the published version.
- `fields.title` and `fields.description`: Single values resolved for the requested `locale` (not locale maps).
- `fields.file`: An object representing the one file for that locale. The delivery address for showing the file to a visitor is `file.url`. The object keys are described in [fields](#fields) below.

## System properties (sys) {#system-properties-sys}

The `sys` of a published *Media* carries only properties for the published snapshot. `space` is in the `Refer` shape (`{ "sys": { "id", "type": "Refer", "targetType" } }`).

| Property | Type | Description |
|---|---|---|
| `id` | string | Unique resource identifier. |
| `type` | string | Resource kind. For a *Media* this is always `"Media"`. |
| `space` | Refer&lt;Space&gt; | The *Space* this *Media* belongs to. |
| `createdAt` | string (date-time) | Creation time. |
| `updatedAt` | string (date-time) | Last update time. |
| `revision` | integer | The version at the time it was published. Each publish records the version at that moment here. |

Because this is a published snapshot, the `version`, `status`, `publish`, and `archive` found in CMA's `sys` are not carried. `revision` is the only value that points to the published version. Author information (`createdBy` and `updatedBy`) is also always omitted from the delivery response.

## fields {#fields}

`fields` holds single values resolved for the requested `locale`. Unlike CMA, which returns a map holding every per-locale value such as `fields.title.ko-KR`, CDA picks the value for the one requested locale and places it directly.

| Key | Type | Description |
|---|---|---|
| `title` | string | The title of the *Media*. A single value resolved for the requested `locale`. |
| `description` | string | The *Media* description. A single value resolved for the requested `locale`. |
| `file` | object | The one file for that locale. See the table below. |

The keys of the `file` object are as follows.

| Key | Type | Description |
|---|---|---|
| `fileName` | string | Original file name. |
| `contentType` | string | The MIME type of the file (e.g. `image/png`). |
| `mimeGroups` | string[] | An array of the logical categories the file belongs to. Each value is one or more of these 12: `Attachment`, `Plaintext`, `Image`, `Audio`, `Video`, `RichText`, `Presentation`, `Spreadsheet`, `PdfDocument`, `Archive`, `Code`, `Markup`. |
| `url` | string | The CDN address that delivers the file to a visitor. |
| `detail` | object | File metadata. Holds `size` (size in bytes); for an image, `image` (`width`, `height`) is added, and for a video, `video` is added. |

## API {#api}

The base URL for the two endpoints below is `https://cda.weegloo.com/v1`, and a Bearer token that authenticates against CDA is required in the `Authorization` header. Both endpoints choose the language to receive with the `locale` query parameter: a code such as `locale=ko-KR` returns values for that locale, omitting it uses the *Space*'s default *Locale*, and `locale=*` returns the full locale map. In the first two cases, the response carries an `x-weegloo-locale` header that reports the locale actually used.

```api-endpoint
{
  "title": "List published Media",
  "method": "GET",
  "path": "/spaces/{spaceId}/medias",
  "description": "Reads the list of published Media in a Space, page by page. Only published items are included; unpublished Media is not.",
  "responseStatus": 200,
  "baseUrl": "https://cda.weegloo.com/v1",
  "pathParameterSchema": {
    "spaceId": { "type": "string", "description": "The sys.id of the Space", "required": true }
  },
  "queryParameterSchema": {
    "locale": { "type": "string", "description": "Language to receive. A code (e.g. en-US) returns values for that locale, omitting it uses the default Locale, and * returns the full locale map." },
    "limit": { "type": "integer", "description": "Number of items to return per page (1-100)", "default": 15 },
    "skip": { "type": "integer", "description": "Number of items to skip", "default": 0 },
    "next": { "type": "string", "description": "Next page cursor (the value obtained from links.next in the previous response)" },
    "prev": { "type": "string", "description": "Previous page cursor (the value obtained from links.prev in the previous response)" },
    "order": { "type": "string", "description": "Sort criteria. Comma-separated for multi-level sorting (e.g. sys.createdAt,sys.id)", "default": "sys.createdAt,sys.id" },
    "include": { "type": "integer", "description": "Related-resource inclusion level. 0=default, 1=related resources, 2=nested relations, 3=full", "default": 0 },
    "select": { "type": "string", "description": "Fields to include (sys.id,sys.createdAt) or exclude (-sys.id). Do not mix include and exclude." }
  },
  "additionalQueryParams": true,
  "requestHeaderSchema": {
    "Authorization": { "type": "string", "description": "Bearer token (CDA authentication; usually a DeliveryAccessToken)" }
  },
  "responseExample": {
    "sys": { "type": "TotalPageResponse" },
    "limit": 15,
    "totalCount": 1,
    "items": [
      {
        "sys": {
          "id": "3trmXRM3RqbgSnifyg7PBe7ehkOn8e",
          "type": "Media",
          "space": { "sys": { "id": "tcq4V2Xb", "type": "Refer", "targetType": "Space" } },
          "createdAt": "2026-06-17T17:07:13.154Z",
          "updatedAt": "2026-06-17T17:07:13.384Z",
          "revision": 1
        },
        "fields": {
          "title": "Stainless Tumbler 500ml front shot",
          "description": "Front product shot of the tumbler on a white background.",
          "file": {
            "fileName": "tumbler.png",
            "contentType": "image/png",
            "mimeGroups": ["Image"],
            "url": "https://weegloo-media.com/medias/tcq4V2Xb/n8e/3trmXRM3RqbgSnifyg7PBe7ehkOn8e/en-US/1/tumbler.png",
            "detail": {
              "size": 50847,
              "image": { "width": 900, "height": 900 }
            }
          }
        }
      }
    ],
    "links": { "self": "/v1/spaces/tcq4V2Xb/medias?locale=en-US" }
  }
}
```

```api-endpoint
{
  "title": "Read a single published Media",
  "method": "GET",
  "path": "/spaces/{spaceId}/medias/{mediaId}",
  "description": "Reads one published Media by sys.id. Unpublished Media is not delivered.",
  "responseStatus": 200,
  "baseUrl": "https://cda.weegloo.com/v1",
  "pathParameterSchema": {
    "spaceId": { "type": "string", "description": "The sys.id of the Space", "required": true },
    "mediaId": { "type": "string", "description": "The sys.id of the Media", "required": true }
  },
  "queryParameterSchema": {
    "locale": { "type": "string", "description": "Language to receive. A code (e.g. en-US) returns values for that locale, omitting it uses the default Locale, and * returns the full locale map." },
    "include": { "type": "integer", "description": "Related-resource inclusion level. 0=default, 1=related resources, 2=nested relations, 3=full", "default": 0 }
  },
  "requestHeaderSchema": {
    "Authorization": { "type": "string", "description": "Bearer token (CDA authentication; usually a DeliveryAccessToken)" }
  },
  "responseExample": {
    "sys": {
      "id": "3trmXRM3RqbgSnifyg7PBe7ehkOn8e",
      "type": "Media",
      "space": { "sys": { "id": "tcq4V2Xb", "type": "Refer", "targetType": "Space" } },
      "createdAt": "2026-06-17T17:07:13.154Z",
      "updatedAt": "2026-06-17T17:07:13.384Z",
      "revision": 1
    },
    "fields": {
      "title": "Stainless Tumbler 500ml front shot",
      "description": "Front product shot of the tumbler on a white background.",
      "file": {
        "fileName": "tumbler.png",
        "contentType": "image/png",
        "mimeGroups": ["Image"],
        "url": "https://weegloo-media.com/medias/tcq4V2Xb/n8e/3trmXRM3RqbgSnifyg7PBe7ehkOn8e/en-US/1/tumbler.png",
        "detail": {
          "size": 50847,
          "image": { "width": 900, "height": 900 }
        }
      }
    }
  }
}
```

## Related documents {#related-documents}

- [CDA Content](/api/reference/cda/content.md): Published Content that references Media.
- [CMA Media](/api/reference/cma/media.md): The API for uploading and managing Media.
- [Media (concept)](/getting-started/core-concepts/content/media.md): How to work with file assets in the content studio.
