---
title: "Create or retrieve the CDN resource of the given files"
method: POST
path: "/dam/cdn/relationships/files"
tags: ["DAM: Files: CDN"]
---

# Create or retrieve the CDN resource of the given files

`POST /dam/cdn/relationships/files`

## Request

- Base URL: `https://api.kontainer.com/jsonapi/v2`
- URL: `https://api.kontainer.com/jsonapi/v2/dam/cdn/relationships/files`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/kontainer/apis/kontainer-api-documentation/docs/dam/cdn/relationships/files/post.ts> (a function with typed inputs; its response is checked against the schema)

## Create or retrieve DAM CDN files resources
Endpoint for creating or retrieving a CDN resource for a given collection of files. Note only 1 CDN resource can exist on a given file.

## Request body

- object
  - `data` object[], required: Array of data objects
    - `type` string: Resource Type
    - `id` string: ID of resource

## Response `200`

success

- CdnFiles
  - `data` object[]
    - `type` string: Resource Type
    - `id` string: ID of resource
    - `attributes` object
      - `url` string: Download URL of related files resource
      - `file_id` integer: ID of related files resource

## Other responses

- `201`: created
- `401`: Unauthorized

---

[API](https://skmtc.dev/kontainer/apis/kontainer-api-documentation.md) - [All operations](https://skmtc.dev/kontainer/apis/kontainer-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/kontainer/apis/kontainer-api-documentation/revisions/b80a5167e09a?raw)
