CDN77 API reference

Add CDN Resource

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

Request body≥1 required

  • 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.
  • labelstringrequired
    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_idstringrequired
    ID of attached Origin (content source for CDN Resource). More information in our Origin API documentation.
  • origin_headersobject
  • response_headersobject
    Custom HTTP headers included in response sent to the client.
  • 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.
  • 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
Example of the request body
{
  "cache": {
    "max_age": 1440,
    "max_age_404": 1,
    "requests_with_cookies_enabled": false
  },
  "cnames": [
    "cname.your-domain.com"
  ],
  "geo_protection": {
    "countries": [
      "UK"
    ],
    "type": "passlist"
  },
  "headers": {
    "cors_enabled": true,
    "cors_timing_enabled": false,
    "cors_wildcard_enabled": false,
    "host_header_forwarding_enabled": false,
    "content_disposition": {
      "type": "parameter"
    }
  },
  "hotlink_protection": {
    "domains": [
      "some-domain.com"
    ],
    "type": "passlist",
    "empty_referer_denied": true
  },
  "https_redirect": {
    "code": 301,
    "enabled": false
  },
  "ip_protection": {
    "ips": [
      "8.8.8.8"
    ],
    "type": "passlist"
  },
  "label": "My cdn",
  "note": "Note for my CDN",
  "mp4_pseudo_streaming": {
    "enabled": false
  },
  "origin_id": "e56564d1-8d3e-4457-93a6-082b054bc736",
  "origin_headers": {
    "custom": {
      "additionalProp1": "default-src 'self' *.example.com; img-src *",
      "additionalProp2": "default-src 'self' *.example.com; img-src *",
      "additionalProp3": "default-src 'self' *.example.com; img-src *"
    }
  },
  "response_headers": {
    "headers": [
      {
        "name": "X-Custom-Header",
        "value": "custom-value"
      }
    ]
  },
  "query_string": {
    "parameters": [
      "utm"
    ],
    "ignore_type": "all"
  },
  "rate_limit": {
    "enabled": false
  },
  "secure_token": {
    "token": "2Xod4tW8Ln4BDg23",
    "type": "parameter"
  },
  "ssl": {
    "type": "SNI",
    "ssl_id": "9880280c-0507-46d1-88f3-71cfee83fa57"
  }
}

Responses

Detail of the created CDN Resource.

Response parameters

  • idinteger
    ID of the CDN Resource. This is also used as the CDN Resource URL.
  • cnamesarray of objects
    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.
  • creation_timestring, format date-time
    Timestamp when CDN Resource was created.
  • labelstring
    The label helps you to identify your CDN Resource.
  • notestring
    Optional note for the CDN Resource.
  • origin_idstring
    ID of attached Origin (content source for CDN Resource). More information in our Origin API documentation.
  • origin_referenceobject
  • urlstring
    URL of the CDN Resource. Automatically generated when the CDN Resource is created. The number is the same as the CDN Resource ID.
  • 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.
  • 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.
  • 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.
  • headersobject
  • https_redirectobject
    If enabled, all requests via HTTP are redirected to HTTPS. Verify HTTPS availability of CNAMEs before activating, if applicable.
  • 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.
  • sslobject
  • streamobject
    Detail parameters of stream CDN Resource.
  • hotlink_protectionobject
    Hotlink protection enables you to control which hostnames/domains can link to and access your content directly.
  • ip_protectionobject
    IP protection enables you to control which networks can access your content directly.
  • geo_protectionobject
    Geo protection enables you to control which countries can access your content directly.
  • 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.
  • origin_headersobject
  • response_headersobject
    Custom HTTP headers included in response sent to the client.
Example of the response
{
  "id": 1234567890,
  "cnames": [
    {
      "id": "9880280c-0507-46d1-88f3-71cfee83fa57",
      "cname": "cname.your-domain.com"
    }
  ],
  "creation_time": "2027-07-07T00:00:00.000Z",
  "label": "My cdn",
  "note": "Note for my CDN",
  "origin_id": "e56564d1-8d3e-4457-93a6-082b054bc736",
  "origin_reference": {
    "id": "e56564d1-8d3e-4457-93a6-082b054bc736",
    "label": "My origin",
    "fallbacks": [
      {
        "id": "e56564d1-8d3e-4457-93a6-082b054bc736",
        "label": "My fallback origin"
      }
    ]
  },
  "url": "1234567890.rsc.cdn77.org",
  "cache": {
    "max_age": 1440,
    "max_age_404": 1,
    "requests_with_cookies_enabled": false
  },
  "secure_token": {
    "token": "2Xod4tW8Ln4BDg23",
    "type": "parameter"
  },
  "query_string": {
    "parameters": [
      "utm"
    ],
    "ignore_type": "all"
  },
  "headers": {
    "cors_enabled": true,
    "cors_timing_enabled": false,
    "cors_wildcard_enabled": false,
    "host_header_forwarding_enabled": false,
    "content_disposition": {
      "type": "parameter"
    }
  },
  "https_redirect": {
    "code": 301,
    "enabled": false
  },
  "mp4_pseudo_streaming": {
    "enabled": false
  },
  "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": {
      "additionalProp1": "default-src 'self' *.example.com; img-src *",
      "additionalProp2": "default-src 'self' *.example.com; img-src *",
      "additionalProp3": "default-src 'self' *.example.com; img-src *"
    }
  },
  "response_headers": {
    "headers": [
      {
        "name": "X-Custom-Header",
        "value": "custom-value"
      }
    ]
  }
}