CDN Resources

Available endpoints:
NameMethodPath
get/v3/cdn
post/v3/cdn
get/v3/cdn/{id}
patch/v3/cdn/{id}
delete/v3/cdn/{id}
get/v3/cdn/{id}/cname
post/v3/cdn/{id}/cname
put/v3/cdn/{id}/datacenters
get/v3/cdn/{id}/datacenters

List of CDN Resources

gethttps://api.cdn77.com/v3/cdn

Responses

200List of CDN Resources

// example of the response
[
  {
    "id": 1234567890,
    "cnames": [
      {
        "id": "9880280c-0507-46d1-88f3-71cfee83fa57",
        "cname": "cname.your-domain.com"
      }
    ],
    "creation_time": "2024-04-24T07:35:07.649Z",
    "label": "My cdn",
    "note": "Note for my CDN",
    "origin_id": "e56564d1-8d3e-4457-93a6-082b054bc736",
    "url": "1234567890.rsc.cdn77.org",
    "mp4_pseudo_streaming": {
      "enabled": true
    }
  }
]

Add CDN Resource

posthttps://api.cdn77.com/v3/cdn

Request bodyrequired

// example of the request body
{
  "cnames": [
    "cname.your-domain.com"
  ],
  "label": "My cdn",
  "note": "Note for my CDN",
  "origin_id": "e56564d1-8d3e-4457-93a6-082b054bc736"
}
cnamesarray of strings

All CNAMEs should be mapped via DNS to CDN URL. Otherwise it's not possible to generate SSL certificate. Maximum number of CNAMEs is "10". To add more, contact our support.

labelrequiredstring

The label helps you to identify your CDN Resource.

notestring

Optional note for the CDN Resource.

origin_idrequiredstring

ID of attached Origin (content source for CDN Resource). More information in our Origin API documentation.

Responses

201CDN Resource created.

// example of the response
{
  "id": 1234567890,
  "cnames": [
    {
      "id": "9880280c-0507-46d1-88f3-71cfee83fa57",
      "cname": "cname.your-domain.com"
    }
  ],
  "creation_time": "2024-04-24T07:35:07.650Z",
  "label": "My cdn",
  "note": "Note for my CDN",
  "origin_id": "e56564d1-8d3e-4457-93a6-082b054bc736",
  "url": "1234567890.rsc.cdn77.org",
  "mp4_pseudo_streaming": {
    "enabled": true
  }
}

422Unable to create CDN Resource.

Detail of CDN Resource

gethttps://api.cdn77.com/v3/cdn/{id}

Request parameters

idrequiredinteger in path

ID of the CDN Resource. This is also used as the CDN Resource URL.

Responses

200Detail of the given CDN Resource returned.

// example of the response
{
  "id": 1234567890,
  "cnames": [
    {
      "id": "9880280c-0507-46d1-88f3-71cfee83fa57",
      "cname": "cname.your-domain.com"
    }
  ],
  "creation_time": "2024-04-24T07:35:07.651Z",
  "label": "My cdn",
  "note": "Note for my CDN",
  "origin_id": "e56564d1-8d3e-4457-93a6-082b054bc736",
  "origin_protection": {
    "enabled": true
  },
  "url": "1234567890.rsc.cdn77.org",
  "cache": {
    "max_age": 1440,
    "max_age_404": 1,
    "requests_with_cookies_enabled": true
  },
  "secure_token": {
    "token": "2Xod4tW8Ln4BDg23",
    "type": "parameter"
  },
  "query_string": {
    "parameters": [
      "utm"
    ],
    "ignore_type": "all"
  },
  "headers": {
    "cors_enabled": true,
    "cors_timing_enabled": true,
    "cors_wildcard_enabled": true,
    "host_header_forwarding_enabled": true,
    "content_disposition": {
      "type": "parameter"
    }
  },
  "https_redirect": {
    "code": 301,
    "enabled": true
  },
  "mp4_pseudo_streaming": {
    "enabled": true
  },
  "quic": {
    "enabled": true
  },
  "waf": {
    "enabled": true
  },
  "ssl": {
    "type": "SNI",
    "ssl_id": "9880280c-0507-46d1-88f3-71cfee83fa57"
  },
  "stream": {
    "origin_url": "prg-1.s.cdn77.com",
    "password": "P4ssw0rd123456",
    "query_key": "123456789",
    "protocol": "rtmp",
    "port": 1936,
    "path": "static"
  },
  "hotlink_protection": {
    "domains": [
      "some-domain.com"
    ],
    "type": "passlist",
    "empty_referer_denied": true
  },
  "ip_protection": {
    "ips": [
      "8.8.8.8"
    ],
    "type": "passlist"
  },
  "geo_protection": {
    "countries": [
      "UK"
    ],
    "type": "passlist"
  },
  "rate_limit": {
    "enabled": false
  },
  "origin_headers": {
    "custom": {
      "MISSING KEY": "MISSING VALUE"
    }
  }
}

404CDN Resource not found.

Edit CDN Resource

patchhttps://api.cdn77.com/v3/cdn/{id}

Request parameters

idrequiredinteger in path

ID of the CDN Resource. This is also used as the CDN Resource URL.

Request bodyrequired

// example of the request body
{
  "cache": {
    "max_age": 1440,
    "max_age_404": 1,
    "requests_with_cookies_enabled": true
  },
  "cnames": [
    "cname.your-domain.com"
  ],
  "geo_protection": {
    "countries": [
      "UK"
    ],
    "type": "passlist"
  },
  "headers": {
    "cors_enabled": true,
    "cors_timing_enabled": true,
    "cors_wildcard_enabled": true,
    "host_header_forwarding_enabled": true,
    "content_disposition": {
      "type": "parameter"
    }
  },
  "hotlink_protection": {
    "domains": [
      "some-domain.com"
    ],
    "type": "passlist",
    "empty_referer_denied": true
  },
  "https_redirect": {
    "code": 301,
    "enabled": true
  },
  "ip_protection": {
    "ips": [
      "8.8.8.8"
    ],
    "type": "passlist"
  },
  "label": "My cdn",
  "note": "Note for my CDN",
  "mp4_pseudo_streaming": {
    "enabled": true
  },
  "origin_id": "e56564d1-8d3e-4457-93a6-082b054bc736",
  "origin_headers": {
    "custom": {
      "MISSING KEY": "MISSING VALUE"
    }
  },
  "query_string": {
    "parameters": [
      "utm"
    ],
    "ignore_type": "all"
  },
  "quic": {
    "enabled": true
  },
  "rate_limit": {
    "enabled": false
  },
  "secure_token": {
    "token": "2Xod4tW8Ln4BDg23",
    "type": "parameter"
  },
  "ssl": {
    "type": "SNI",
    "ssl_id": "9880280c-0507-46d1-88f3-71cfee83fa57"
  },
  "waf": {
    "enabled": true
  }
}
cacheobject

Your files will remain cached for the specified duration, after which your origin will be checked for an updated version of your files. Expiry/cache-control headers override this setting.

cnamesarray of strings

All CNAMEs should be mapped via DNS to CDN URL. Otherwise it's not possible to generate SSL certificate.Maximum number of CNAMEs is "10". To add more, contact our support.

geo_protectionobject

Geo protection enables you to control which countries can access your content directly.

headersobject
hotlink_protectionobject

Hotlink protection enables you to control which hostnames/domains can link to and access your content directly.

https_redirectobject

If enabled, all requests via HTTP are redirected to HTTPS. Verify HTTPS availability of CNAMEs before activating, if applicable.

ip_protectionobject

IP protection enables you to control which networks can access your content directly.

labelstring

The label helps you to identify your CDN Resource.

notestring

Optional note for the CDN Resource.

mp4_pseudo_streamingobject

Turn this option on if using a flash-based video player with MP4 files. Pseudo-streaming is used mainly in flash players. HTML5 players use range-requests. When enabled the "query_string" option must be set to ignore all parameters.

origin_idstring

ID of attached Origin (content source for CDN Resource). More information in our Origin API documentation.

origin_headersobject
query_stringobject

Enabling this feature will ignore the query string, allowing URLs with query strings to cache properly. This is particularly useful if you tag your URLs with tracking/marketing parameters, for example.

quicobject

This option enables the QUIC protocol transport that works with chromium-based browsers originally designed for the transmission of HTTP/2 frames.

rate_limitobject

When enabled, this feature limits the data transfer rate by setting "limit_rate" based on the "rs" URL parameter and "limit_rate_after" by the value from the "ri" URL parameter.

secure_tokenobject

This feature allows you to serve your content using signed URLs. You can enable your users to download secured content from the CDN Resource with a valid hash. Note: When you check this option, make sure to generate secured links to access your content. Maximum length is 64 characters.

sslobject
wafobject

Protect your website against XSS, SQL injection and more with our SmartWAF. We're using OWASP Core Rule Set (CRS) to protect your data against the most exploited vulnerabilities.

Responses

204CDN Resource details were edited.

404CDN Resource not found.

422Unable to edit CDN Resource.

Delete CDN Resource

deletehttps://api.cdn77.com/v3/cdn/{id}

Request parameters

idrequiredinteger in path

ID of the CDN Resource. This is also used as the CDN Resource URL.

Responses

204CDN Resource was deleted.

404CDN Resource not found.

List of CNAMEs

gethttps://api.cdn77.com/v3/cdn/{id}/cname

Request parameters

idrequiredinteger in path

ID of the CDN Resource. This is also used as the CDN Resource URL.

Responses

200List of CNAMEs returned.

// example of the response
[
  {
    "id": "9880280c-0507-46d1-88f3-71cfee83fa57",
    "cname": "cname.your-domain.com"
  }
]

404CDN Resource not found.

Add CNAME

posthttps://api.cdn77.com/v3/cdn/{id}/cname

Request parameters

idrequiredinteger in path

ID of the CDN Resource. This is also used as the CDN Resource URL.

Request bodyrequired

// example of the request body
{
  "cname": "test.cname.com"
}
cnamerequiredstring

CNAME should be mapped via DNS to CDN URL. Otherwise it's not possible to generate SSL certificate for any CNAME assigned to CDN Resource.

Responses

204CNAME added.

404CDN Resource not found.

422Invalid input.

Enable data centers

puthttps://api.cdn77.com/v3/cdn/{id}/datacenters

Request parameters

idrequiredinteger in path

ID of the CDN Resource. This is also used as the CDN Resource URL.

Request bodyrequired

// example of the request body
[
  "65b63934-2278-40aa-affa-f4c0d1e7c029"
]
[uuid]array of strings, format uuid

Responses

204CDN Resource datacenters were updated.

422Data centers could not be enabled.

List of data centers

gethttps://api.cdn77.com/v3/cdn/{id}/datacenters

Request parameters

idrequiredinteger in path

ID of the CDN Resource. This is also used as the CDN Resource URL.

Responses

200List of datacenters for CDN Resource.

// example of the response
[
  {
    "location_id": "81b5aa5e-52f2-4350-823f-4899eb67848b",
    "city": "Los Angeles",
    "continent_code": "EU",
    "country": "Germany",
    "is_enabled": true,
    "latitude": 48.5833,
    "longitude": 7.75
  }
]

404CDN Resource not found.

422Data centers list could not be resolved.