Skip to navigation

Create CDN distribution

Creates a CDN distribution that caches and serves content from an object storage bucket or other origin through the edge network. Requires scope: cdn.write.

# Example request with curl (set IBEE_API_TOKEN to a platform API token and WORKSPACE_ID to the workspace first).
curl -X POST "https://api.ibee.ai/v1/cdn/distributions?workspace_id=$WORKSPACE_ID" \
-H "Authorization: Bearer $IBEE_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "<name>", "origin_id": "<origin_id>"}'

Authentication

AuthorizationBearer

IBEE platform API token. Production tokens start with ibee_prod_key_; development tokens start with ibee_dev_key_. Use a token only with its matching gateway environment.

Query parameters

workspace_idstringRequiredformat: "^[1-9][0-9]*$">=1 character

The positive numeric workspace ID to scope this request to. Zero, negative, and non-numeric values are rejected.

Request

This endpoint expects an object.
namestringRequired1-128 characters

Display name of the distribution (1-128 characters).

origin_idstringRequired>=1 character

Bucket name for bucket origins, or the custom origin’s ID.

origin_typeenumOptionalDefaults to bucket
  • bucket: serve an Object Storage bucket (default).
  • custom: serve a custom origin.
Allowed values:
cache_policyenumOptionalDefaults to static-assets

Caching behaviour. Default static-assets.

  • static-assets: long-term caching for immutable assets; 1 year at the CDN, browsers revalidate.
  • media: medium-term caching for video and audio; 30 days at the CDN.
  • short: short-term caching for frequently changing content; 1 hour at the CDN.
  • no-cache: no caching, for dynamic responses.
Allowed values:

Response

Distribution created successfully.
idstring
Unique ID of the distribution.
namestring
Display name of the distribution.
origin_typeenum
  • bucket: an Object Storage bucket.
  • custom: a custom origin.
Allowed values:
origin_idstring
Bucket name or custom origin ID.
cache_policystring

Caching behaviour in effect.

  • static-assets: long-term caching for immutable assets; 1 year at the CDN, browsers revalidate.
  • media: medium-term caching for video and audio; 30 days at the CDN.
  • short: short-term caching for frequently changing content; 1 hour at the CDN.
  • no-cache: no caching, for dynamic responses.
enabledboolean
Whether the distribution serves traffic.
statusenum
  • active: serving.
  • deploying: configuration is being rolled out to the edge.
  • disabled: turned off.
  • failed: deployment failed.
  • deleted: removed.
Allowed values:
default_domainstring

Hostname IBEE assigned to the distribution, for example dl-abc123.cdn.ibee.ai.

default_urlstringformat: "uri"

https:// URL of default_domain.

custom_domainslist of strings
Custom hostnames attached to the distribution.
created_atdatetime

When the distribution was created (ISO 8601).

updated_atdatetime or nullOptional

When the distribution was last changed (ISO 8601).

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
409
Conflict Error
413
Content Too Large Error
422
Unprocessable Entity Error
423
Locked Error
429
Too Many Requests Error
500
Internal Server Error
502
Bad Gateway Error
503
Service Unavailable Error
504
Gateway Timeout Error