---
title: "/assets/:assetId/cdnLinks"
method: POST
path: "/v1/assets/{assetId}/cdnLinks"
tags: ["Assets"]
---

# /assets/:assetId/cdnLinks

`POST /v1/assets/{assetId}/cdnLinks`

Create a CDN link for an asset.

Use `followsDefaultVersion: true` for an evergreen link that tracks the asset's current default version, or `versionId` to pin the link to a specific version.

Returns `409 Conflict` if a link already exists. Use `GET /v1/assets/{assetId}/cdnLinks` to retrieve the existing link.

## Request body

- union — Specify exactly one of `followsDefaultVersion` or `versionId`
  - object
    - `followsDefaultVersion` true, required — Create a CDN link that follows the asset's default version
  - object
    - `versionId` string, uuid, required — Pin the CDN link to this asset version

## Response `201`

CDN link created successfully

- CdnLink
  - `id` string, required — The CDN link ID
  - `url` string, uri, required — The public CDN URL for the asset or version
  - `assetId` string, required — The asset this CDN link belongs to
  - `followsDefaultVersion` boolean, required — When true, the link serves the asset's current default version. When false, the link is pinned to a specific version (`versionId`).
  - `active` boolean, required — Whether the CDN link is active and serving content
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required
  - `versionId` string — Present when `followsDefaultVersion` is false — the pinned asset version ID

## Other responses

- `400` — Invalid request body, asset too large for CDN links, or missing storage location
- `404` — Asset or version not found
- `409` — A CDN link already exists for this asset or version
- `422` — CDN Links are not enabled for this workspace

---

[API](https://skmtc.net/air/apis/air-api.md) · [All operations](https://skmtc.net/air/apis/air-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/air/air-api/revisions/2bd9c9fa2a0c/schema)
