Below is the text of the page https://www.keycdn.com/api stored 2024-06-30 by archive.org.ua. The original page over time could change. View as original html

API - KeyCDN

[/] Features Solutions Website Acceleration Image Processing Video & Streaming Cloud Storage Network Pricing Support Login Sign Up Sign Up API Complete content delivery control from any application in any language. Overview Support Changelog Authentication Example Request Response Parameters Example Response Errors HTTP Status Code Summary Rate Limiting Zones API List Zones View Zone Add Zone Edit Zone Delete Zone Purge Zone Cache Purge Zone URL Zone Aliases API List Zone Aliases Add Zone Alias Edit Zone Alias Delete Zone Alias Zone Referrers API List Zone Referrers Add Zone Referrer Edit Zone Referrer Delete Zone Referrer Reports API Traffic Statistics Storage Statistics Image Processing Statistics Status Statistics Credits Statistics Credit Balance Sections Overview Support Changelog Authentication Example Request Response Parameters Example Response Errors HTTP Status Code Summary Rate Limiting Zones API List Zones View Zone Add Zone Edit Zone Delete Zone Purge Zone Cache Purge Zone URL Zone Aliases API List Zone Aliases Add Zone Alias Edit Zone Alias Delete Zone Alias Zone Referrers API List Zone Referrers Add Zone Referrer Edit Zone Referrer Delete Zone Referrer Reports API Traffic Statistics Storage Statistics Image Processing Statistics Status Statistics Credits Statistics Credit Balance Overview The KeyCDN API allows you to manage your Zones, Zone Aliases, Zone Referrers, or generate reports. This documentation provides you the required information to successfully make use of the API. The KeyCDN API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and to use HTTP response codes to indicate API errors. We use built-in HTTP features, such as HTTP authentication and HTTP terminology, which can be understood by off-the-shelf HTTP clients. JSON will be returned in all responses from the API, including errors. Support Check our API Libraries on GitHub . They allow you a quick and simple integration into your current solution. Please open a support request if you have any questions. Please submit a request for enhancement (RFE) if you need more functionality. Changelog 2024-06-12 Added region to traffic statistics. 2022-02-24 Added Cache Key Country. 2021-04-08 Added Secure Token IP address. 2020-06-12 Added Block Referrer feature. 2020-02-12 Added credit balance and Image Processing reporting. 2020-01-28 Added Image Processing feature. 2020-01-20 Added 3xx and 5xx to status statistics. 2019-08-05 Increased API rate limit. 2019-03-30 Added support to purge various cache key combinations. 2017-09-01 Added Forward Host Header, Cache Key Scheme, Cache Key Host, Cache Key Cookie, Cache Key Device, Cache Brotli, and Generic Error Pages features. 2016-07-22 Changed Edit Zone to not require name parameter. 2016-03-05 Added Let's Encrypt feature. 2015-11-20 Changed the API base URL to api.keycdn.com . 2015-09-22 Purge simplification. 2015-09-22 Updated API key authentication. 2015-01-26 Added Origin Shield feature. 2014-09-10 Added Force SSL feature. 2014-08-25 Added Zones, Zone Aliases, and Zone Referrers. 2014-08-25 Introduced rate limiting. 2014-07-29 Added Reports API. 2013-10-10 Added Purge URL feature. 2013-08-01 Released beta version of the KeyCDN API. Authentication You authenticate to the KeyCDN API by providing your API key in the request. Keep your credentials secret. Authentication to the API occurs via HTTP Basic Auth. All API requests must be made over HTTPS. Calls made over plain HTTP will fail. You must authenticate for all requests. curl uses the -u flag to pass basic auth credentials (adding a colon after your API key will prevent it from asking you for a password). To receive data or make changes to your account, replace the example API key with your actual API key. Example Request $ curl https://api.keycdn.com/zones.json \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: Response Parameters Parameter Description status Status code of the current API call. description Description of an API call. data The response data of the API call. Example Response { "status": "success", "description": "Data successfully received.", "data": { ... } } Errors KeyCDN uses conventional HTTP response codes to indicate success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that resulted from the provided information (e.g. a required parameter was missing or invalid), and codes in the 5xx range indicate an error with KeyCDN's edge servers. Not all errors map cleanly onto HTTP response codes. HTTP Status Code Summary Status Description 200 OK Everything worked as expected. 400 Bad Request Often missing a required parameter. 403 Forbidden Access denied. 404 Not Found The requested item does not exist. 413 Request Entity Too Large Maximum body size is 64 KB. 429 Too Many Requests Rate limit exceeded. 451 Illegal Illegal or malicious request. 500 , 502 , 503 , or 504 Something went wrong on KeyCDN's end. Rate Limiting API requests are currently rate limited at 60 queries per 60 seconds window. Purge requests are limited to 1 request per second. Ensure that you inspect the following HTTP response headers, as they provide pertinent data on where your utilization is at for the given rate limit. The calling IP will be blocked if the X-Rate-Limit-Remaining value reaches 0 . Header Description X-Rate-Limit-Limit The rate limit ceiling for that given request. X-Rate-Limit-Remaining The number of requests left for the 60 seconds window. The KeyCDN API will return an HTTP 429 Too Many Requests response status when you exceed the rate limit. Zones API Parameter Description id Zone ID name Zone name status Zone status type Zone type forcedownload Forces content to download instead of opening. The following response header will be set: Content-Disposition: Attachment cors Allow unrestricted Cross-Origin Resource Sharing (CORS). The following response header will be set: Access-Control-Allow-Origin: \* gzip Gzip compression on content 1 KB or larger. imgproc Transform and optimize images in real time with simple query parameters. Image Processing incurs an additional cost. expire Adding or modifying the Cache-Control and Expires response headers that are sent to the client if the HTTP response status code equals 200 , 201 , 204 , 206 , 301 , 302 , 303 , 304 , or 307 : -1 Cache-Control: no-cache 0 Push Zone: disabled Pull Zone: as received from the origin server >0 Cache-Control: max-age=t where t is the time specified in minutes and then converted to seconds If cacheignorecachecontrol is enabled the expire value will only have an impact on the browser cache and not on the KeyCDN cache. blockbadbots Block bad bots (returns a 451 Unavailable For Legal Reasons response status). allowemptyreferrer Allow requests with an empty Referer request header value if one or more Zone Referrer is active. blockreferrer Block requests with a Referer request header value matching a Zone Referrer (returns a 403 Forbidden response status). securetoken Restrict access to all content within Zone by Secure Token. securetokenkey Secret used to check authenticity of request if securetoken is enabled. securetokenip The IP of the client will be part of Secure Token if enabled. sslcert Add SSL/TLS certificate to be used for HTTPS requests: shared Enables the shared wildcard certificate to be used with the Zone URL (e.g. https://examplepull-hexid.kxcdn.com ) custom Enables the custom certificate defined in customsslkey and customsslcert to be used with a Zone Alias (e.g. https://cdn.example.com ) letsencrypt Enables a Let's Encrypt certificate to be used with one Zone Alias (e.g. https://cdn.example.com ) You must remove an exising Zone Alias before enabling the letsencrypt option (or recreate the Zone Alias afterwards). customsslkey The custom SSL/TLS certificate private key. Include the -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY----- statements. customsslcert The custom SSL/TLS certificate. The required format is PEM (Base64 encoded ASCII), which is the most common format that Certificate Authorities issue. Include the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- statements and optionally include the intermediate certificate: Cert only -----BEGIN CERTIFICATE----- Certificate -----END CERTIFICATE----- With intermediate cert -----BEGIN CERTIFICATE----- Certificate -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- Intermediate certificate -----END CERTIFICATE----- forcessl Redirects HTTP requests to HTTPS (returns a 301 Moved Permanently response status). originurl URL of the origin server where content is pulled from. Include only the scheme and hostname (e.g. https://www.example.com ). Do not include a file path (e.g. https://www.example.com/index.html ). originshield Predefined shield servers will pull content from the origin server instead of our edge servers. This will reduce traffic on the origin server but adds an additional request from the edge server to the shield server if the content has not been cached yet. The following response header will be set: X-Shield: active cachemaxexpire Define the maximum time in minutes that cacheable content will be retained in the KeyCDN cache without checking the origin server. Applies only if not defined by the origin server X-Accel-Expires , Cache-Control , or Expires response headers. cacheignorecachecontrol Ignores processing of X-Accel-Expires , Cache-Control , and Expires response headers received from the origin server. If enabled the cachemaxexpire value has precedence. cacheignorequerystring Ignores the presence of query strings. The KeyCDN cache will respond with a cached response even if the query string differs. cachehostheader Forwards the Host request header (e.g. Host: cdn.example.com ) to the origin server as received from the client instead of the Host request header defined by the originurl hostname. cachekeyscheme Scheme based caching ( http:// or https:// ) as requested by the client. cachekeyhost Host request header based caching that matches the Zone Alias. cachekeycookie Cookie variable based caching as received in the Cookie request header. cachekeydevice Device based caching ( desktop , tablet , or mobile ) as received in the User-Agent request header. The default device type is desktop . cachekeywebp WebP image format based caching as received in the Accept request header. cachekeycountry Country code based caching derived from the client IP address. cachebr Brotli based caching as requested by the client. The origin server must support the Brotli compression format. cachecookies Ignore the presence of cookies. By default content with cookies are not cacheable, but when cookies are ignored content becomes cacheable. cachestripcookies Strip the Set-Cookie response header received from the origin server. cachexpullkey Set a custom X-Pull request header value (e.g. X-Pull: example ). This is a custom request header that can serve multiple purposes, such as restricting access to the origin server or allowing all KeyCDN edge server requests through a firewall. cachecanonical Add a canonical response header with the originurl as the reference to consolidate duplicate content. The following response header will be set: Link: ; rel="canonical" cacherobots Adding or modifying the robots.txt to prevent content from being indexed: User-agent: * Disallow: / cacheerrorpages Deliver generic error pages for 4xx and 5xx errors instead of the error pages received from the origin server. dirlist Generates directory indexes automatically (similar to the Unix ls command or the Win32 dir shell command). List Zones Returns a list of all Zones on the specified account. GEThttps://api.keycdn.com/zones.json Response Parameters Returns a list of Zones as defined in View Zone . Example Request Response $ curl https://api.keycdn.com/zones.json \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: { "status": "success", "description": "Data successfully received.", "data": { "zones": [ { "id": "1000", "name": "examplepull", "status": "active", "type": "pull", "forcedownload": "disabled", "cors": "disabled", "gzip": "disabled", "imgproc": "disabled", "expire": "0", "blockbadbots": "enabled", "allowemptyreferrer": "enabled", "blockreferrer": "disabled", "securetoken": "disabled", "securetokenkey": null, "securetokenip": "disabled", "sslcert": "shared", "customsslkey": null, "customsslcert": null, "forcessl": "disabled", "originurl": "https://example.com", "cachemaxexpire": "1440", "cacheignorecachecontrol": "enabled", "cacheignorequerystring": "enabled", "cachehostheader": "disabled", "cachekeyscheme": "disabled", "cachekeyhost": "disabled", "cachekeycookie": null, "cachekeydevice": "disabled", "cachekeywebp": "disabled", "cachekeycountry": "disabled", "cachebr": "disabled", "cachecookies": "disabled", "cachestripcookies": "disabled", "cachexpullkey": "KeyCDN", "cachecanonical": "disabled", "cacherobots": "disabled", "cacheerrorpages": "enabled" }, { "id": "1001", "name": "examplepush", "status": "active", "type": "push", "forcedownload": "disabled", "cors": "disabled", "gzip": "disabled", "imgproc": "disabled", "expire": "0", "blockbadbots": "enabled", "allowemptyreferrer": "enabled", "blockreferrer": "disabled", "securetoken": "disabled", "securetokenkey": null, "securetokenip": "disabled", "sslcert": "shared", "customsslkey": null, "customsslcert": null, "forcessl": "disabled", "dirlist": "disabled" }, ... ] } } View Zone Returns a Zone specified by the {zone_id} parameter. GEThttps://api.keycdn.com/zones/{zone_id}.json Response Parameters Parameter Pull Push id name status type forcedownload cors gzip imgproc expire blockbadbots allowemptyreferrer blockreferrer securetoken securetokenkey securetokenip sslcert customsslkey customsslcert forcessl originurl originshield cachemaxexpire cacheignorecachecontrol cacheignorequerystring cachehostheader cachekeyscheme cachekeyhost cachekeycookie cachekeydevice cachekeywebp cachekeycountry cachebr cachecookies cachestripcookies cachexpullkey cachecanonical cacherobots cacheerrorpages dirlist Example Request Response $ curl https://api.keycdn.com/zones/1000.json \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: { "status": "success", "description": "Data successfully received.", "data": { "zone": { "id": "1000", "name": "examplepull", "status": "active", "type": "pull", "forcedownload": "disabled", "cors": "disabled", "gzip": "disabled", "imgproc": "disabled", "expire": "0", "blockbadbots": "enabled", "allowemptyreferrer": "enabled", "blockreferrer": "disabled", "securetoken": "disabled", "securetokenkey": null, "securetokenip": "disabled", "sslcert": "shared", "customsslkey": null, "customsslcert": null, "forcessl": "disabled", "originurl": "https://example.com", "originshield": "disabled", "cachemaxexpire": "1440", "cacheignorecachecontrol": "enabled", "cacheignorequerystring": "enabled", "cachehostheader": "disabled", "cachekeyscheme": "disabled", "cachekeyhost": "disabled", "cachekeycookie": null, "cachekeydevice": "disabled", "cachekeywebp": "disabled", "cachekeycountry": "disabled", "cachebr": "disabled", "cachecookies": "disabled", "cachestripcookies": "disabled", "cachexpullkey": "KeyCDN", "cachecanonical": "disabled", "cacherobots": "disabled", "cacheerrorpages": "enabled" } } } Add Zone Add a new Zone with the specified parameters for the accessing user. POSThttps://api.keycdn.com/zones.json Request Parameters Parameter Value Default Pull Push name required {alphanumeric} max length: 20 status optional active or inactive active type required pull or push push forcedownload optional enabled or disabled disabled cors optional enabled or disabled disabled gzip optional enabled or disabled disabled imgproc optional enabled or disabled disabled expire optional {numeric} range: -1 to 525949 0 blockbadbots optional enabled or disabled disabled allowemptyreferrer optional enabled or disabled enabled blockreferrer optional enabled or disabled disabled securetoken optional enabled or disabled disabled securetokenkey optional {alphanumeric} length: 4-15 securetokenip optional enabled or disabled disabled sslcert optional shared , custom , letsencrypt or disabled shared customsslkey optional {valid key} customsslcert optional {valid cert} forcessl optional enabled or disabled disabled originurl required {url} max length: 128 originshield optional enabled or disabled disabled cachemaxexpire optional {numeric} range: 1 to 525949 1440 cacheignorecachecontrol optional enabled or disabled enabled cacheignorequerystring optional enabled or disabled enabled cachehostheader optional enabled or disabled disabled cachekeyscheme optional enabled or disabled disabled cachekeyhost optional enabled or disabled disabled cachekeycookie optional {alphanumeric} max length: 32 cachekeydevice optional enabled or disabled disabled cachekeywebp optional enabled or disabled disabled cachekeycountry optional enabled or disabled disabled cachebr optional enabled or disabled disabled cachecookies optional enabled or disabled disabled cachestripcookies optional enabled or disabled disabled cachexpullkey optional {alphanumeric} length: 4-15 KeyCDN cachecanonical optional enabled or disabled disabled cacherobots optional enabled or disabled disabled cacheerrorpages optional enabled or disabled enabled dirlist optional enabled or disabled disabled Response Parameters Returns the newly created Zone according to View Zone . Example Request Response $ curl https://api.keycdn.com/zones.json \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: \ -X POST \ -d name=examplepull \ -d type=pull \ -d originurl=https://example.com { "status": "success", "description": "Zone successfully added.", "data": { "zone": { "id": "1000", "name": "examplepull", "status": "active", "type": "pull", "forcedownload": "disabled", "cors": "disabled", "gzip": "disabled", "imgproc": "disabled", "expire": "0", "blockbadbots": "enabled", "allowemptyreferrer": "enabled", "blockreferrer": "disabled", "securetoken": "disabled", "securetokenkey": null, "securetokenip": "disabled", "sslcert": "shared", "customsslkey": null, "customsslcert": null, "forcessl": "disabled", "originurl": "https://example.com", "originshield": "disabled", "cachemaxexpire": "1440", "cacheignorecachecontrol": "enabled", "cacheignorequerystring": "enabled", "cachehostheader": "disabled", "cachekeyscheme": "disabled", "cachekeyhost": "disabled", "cachekeycookie": null, "cachekeydevice": "disabled", "cachekeywebp": "disabled", "cachekeycountry": "disabled", "cachebr": "disabled", "cachecookies": "disabled", "cachestripcookies": "disabled", "cachexpullkey": "KeyCDN", "cachecanonical": "disabled", "cacherobots": "disabled", "cacheerrorpages": "enabled" } } } Edit Zone Edit the given Zone specified by the parameter {zone_id} with the specified request parameters. PUThttps://api.keycdn.com/zones/{zone_id}.json Request Parameters Same request parameters as in Add Zone (but all are optional). Response Parameters Returns the edited Zone according to View Zone . Example Request Response $ curl https://api.keycdn.com/zones/1000.json \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: \ -X PUT \ -d expire=43200 { "status": "success", "description": "Zone successfully changed.", "data": { "zone": { "id": "1000", "name": "examplepull", "status": "active", "type": "pull", "forcedownload": "disabled", "cors": "disabled", "gzip": "disabled", "imgproc": "disabled", "expire": "43200", "blockbadbots": "enabled", "allowemptyreferrer": "enabled", "blockreferrer": "disabled", "securetoken": "disabled", "securetokenkey": null, "securetokenip": "disabled", "sslcert": "shared", "customsslkey": null, "customsslcert": null, "forcessl": "disabled", "originurl": "https://example.com", "originshield": "disabled", "cachemaxexpire": "1440", "cacheignorecachecontrol": "enabled", "cacheignorequerystring": "enabled", "cachehostheader": "disabled", "cachekeyscheme": "disabled", "cachekeyhost": "disabled", "cachekeycookie": null, "cachekeydevice": "disabled", "cachekeywebp": "disabled", "cachekeycountry": "disabled", "cachebr": "disabled", "cachecookies": "disabled", "cachestripcookies": "disabled", "cachexpullkey": "KeyCDN", "cachecanonical": "disabled", "cacherobots": "disabled", "cacheerrorpages": "enabled" } } } Delete Zone Delete the given Zone specified by the parameter {zone_id} . DELETEhttps://api.keycdn.com/zones/{zone_id}.json Example Request Response $ curl https://api.keycdn.com/zones/1000.json \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: \ -X DELETE { "status": "success", "description": "Zone successfully deleted.", "data": [] } Purge Zone Cache Clears the entire cache of a Pull Zone specified by the {zone_id} parameter. GEThttps://api.keycdn.com/zones/purge/{zone_id}.json Example Request Response $ curl https://api.keycdn.com/zones/purge/1000.json \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: { "status": "success", "description": "Cache has been cleared for zone examplepull." } Purge Zone URL Clears the cache for the defined URL(s) by the {zone_id} parameter. DELETEhttps://api.keycdn.com/zones/purgeurl/{zone_id}.json Request Parameters Parameter Value Default Pull Push urls required {array of URLs} without scheme Example Request Response $ curl https://api.keycdn.com/zones/purgeurl/1000.json \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: \ -X DELETE \ -H "Content-Type: application/json" \ --data '{"urls":["examplepull-hexid.kxcdn.com/css/style.css","examplepull-hexid.kxcdn.com/js/app.js","examplepull-hexid.kxcdn.com/img/logo.svg"]}' { "status": "success", "description": "Cache has been cleared for URL(s)." } If cachekeyscheme is enabled prepend the scheme. Example Request Response $ curl https://api.keycdn.com/zones/purgeurl/1000.json \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: \ -X DELETE \ -H "Content-Type: application/json" \ --data '{"urls":["http://examplepull-hexid.kxcdn.com/css/style.css","https://examplepull-hexid.kxcdn.com/css/style.css"]}' { "status": "success", "description": "Cache has been cleared for URL(s)." } If cachekeyhost is enabled use the Zone Alias instead of the Zone URL. Example Request Response $ curl https://api.keycdn.com/zones/purgeurl/1000.json \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: \ -X DELETE \ -H "Content-Type: application/json" \ --data '{"urls":["cdnpull.example.com/css/style.css","cdnpull.example.com/js/app.js","cdnpull.example.com/img/logo.svg"]}' { "status": "success", "description": "Cache has been cleared for URL(s)." } If cacheignorequerystring is disabled append the query string. Example Request Response $ curl https://api.keycdn.com/zones/purgeurl/1000.json \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: \ -X DELETE \ -H "Content-Type: application/json" \ --data '{"urls":["examplepull-hexid.kxcdn.com/css/style.css","examplepull-hexid.kxcdn.com/css/style.css?name=value"]}' { "status": "success", "description": "Cache has been cleared for URL(s)." } If cachekeycookie is enabled append the cookie variable. Example Request Response $ curl https://api.keycdn.com/zones/purgeurl/1000.json \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: \ -X DELETE \ -H "Content-Type: application/json" \ --data '{"urls":["examplepull-hexid.kxcdn.com/css/style.css","examplepull-hexid.kxcdn.com/css/style.csscookie"]}' { "status": "success", "description": "Cache has been cleared for URL(s)." } If cachekeydevice is enabled append the device type. Example Request Response $ curl https://api.keycdn.com/zones/purgeurl/1000.json \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: \ -X DELETE \ -H "Content-Type: application/json" \ --data '{"urls":["examplepull-hexid.kxcdn.com/css/style.cssdesktop","examplepull-hexid.kxcdn.com/css/style.csstablet","examplepull-hexid.kxcdn.com/css/style.cssmobile"]}' { "status": "success", "description": "Cache has been cleared for URL(s)." } If cachekeywebp is enabled append webp . Example Request Response $ curl https://api.keycdn.com/zones/purgeurl/1000.json \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: \ -X DELETE \ -H "Content-Type: application/json" \ --data '{"urls":["examplepull-hexid.kxcdn.com/img/logo.png", "examplepull-hexid.kxcdn.com/img/logo.pngwebp"]}' { "status": "success", "description": "Cache has been cleared for URL(s)." } If cachekeycountry is enabled append the two-letter country code (e.g. US). Example Request Response $ curl https://api.keycdn.com/zones/purgeurl/1000.json \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: \ -X DELETE \ -H "Content-Type: application/json" \ --data '{"urls":["examplepull-hexid.kxcdn.com/img/logo.png", "examplepull-hexid.kxcdn.com/img/logo.pngUS"]}' { "status": "success", "description": "Cache has been cleared for URL(s)." } If cachebr is enabled append br . Example Request Response $ curl https://api.keycdn.com/zones/purgeurl/1000.json \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: \ -X DELETE \ -H "Content-Type: application/json" \ --data '{"urls":["examplepull-hexid.kxcdn.com/css/style.css","examplepull-hexid.kxcdn.com/css/style.cssbr"]}' { "status": "success", "description": "Cache has been cleared for URL(s)." } Combine two or more cache keys in the following order: scheme host querystring cookie br device webp country Example Request Response $ curl https://api.keycdn.com/zones/purgeurl/1000.json \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: \ -X DELETE \ -H "Content-Type: application/json" \ --data '{"urls":["https://cdnpull.example.com/css/style.css?name=valuecookiebrdesktop"]}' { "status": "success", "description": "Cache has been cleared for URL(s)." } Zone Aliases API Parameter Description id Zone Alias ID zone_id Associated Zone ID name Zone Alias hostname List Zone Aliases Returns a list of all Zone Aliases on the specified account. GEThttps://api.keycdn.com/zonealiases.json Response Parameters Parameter Pull Push id zone_id name Example Request Response $ curl https://api.keycdn.com/zonealiases.json \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: { "status": "success", "description": "Data successfully received.", "data": { "zonealiases": [ { "id": "2000", "zone_id": "1000", "name": "cdnpull.example.com" }, { "id": "2001", "zone_id": "1001", "name": "cdnpush.example.com" } ] } } Add Zone Alias Adds a Zone Aliases for a given Zone. POSThttps://api.keycdn.com/zonealiases.json Request Parameters Parameter Value Default Pull Push zone_id required {numeric} name required {hostname} max length: 128 Response Parameters Returns the added Zone Alias with the same parameters as in List Zone Aliases . Example Request Response $ curl https://api.keycdn.com/zonealiases.json \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: \ -X POST \ -d name=cdnpull.example.com \ -d zone_id=1000 { "status": "success", "description": "Zone Alias successfully added.", "data": { "zonealias": { "id": "2000", "name": "cdnpull.example.com", "zone_id": "1000" } } } Edit Zone Alias Edit the given Zone Alias specified by the parameter {zonealias_id} with the speciefied request parameters. PUThttps://api.keycdn.com/zonealiases/{zonealias_id}.json Request Parameters Same request parameters as in Add Zone Alias . Response Parameters Returns the changed Zone Alias with the same parameters as in List Zone Aliases . Example Request Response $ curl https://api.keycdn.com/zonealiases/2000.json \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: \ -X PUT \ -d name=cdn-pull.example.com \ -d zone_id=1000 { "status": "success", "description": "Zone Alias successfully changed.", "data": { "zonealias": { "id": "2000", "name": "cdn-pull.example.com", "zone_id": "1000" } } } Delete Zone Alias Delete the given Zone Alias specified by the parameter {zonealias_id} . DELETEhttps://api.keycdn.com/zonealiases/{zonealias_id}.json Example Request Response $ curl https://api.keycdn.com/zonealiases/2000.json \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: \ -X DELETE { "status": "success", "description": "Zone Alias successfully deleted.", "data": [] } Zone Referrers API Parameter Description id Zone Referrer ID zone_id Associated Zone ID name Zone Referrer hostname List Zone Referrers Returns a list of all Zone Referrers on the specified account. GEThttps://api.keycdn.com/zonereferrers.json Response Parameters Parameter Pull Push id zone_id name Example Request Response $ curl https://api.keycdn.com/zonereferrers.json \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: { "status": "success", "description": "Data successfully received.", "data": { "zonereferrers": [ { "id": "3000", "zone_id": "1000", "name": "example.com" }, { "id": "3001", "zone_id": "1000", "name": "cdnpull.example.com" }, { "id": "3002", "zone_id": "1000", "name": "examplepull-hexid.kxcdn.com" } ] } } Add Zone Referrer Adds a Zone Referrers for a given Zone. POSThttps://api.keycdn.com/zonereferrers.json Request Parameters Parameter Value Default Pull Push zone_id required {numeric} name required {hostname} max length: 46 Response Parameters Returns the added Zone Referrer with the same parameters as in List Zone Referrers . Example Request Response $ curl https://api.keycdn.com/zonereferrers.json \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: \ -X POST \ -d name=example.com \ -d zone_id=1000 { "status": "success", "description": "Zone Referrer successfully added.", "data": { "zonereferrer": { "id": "3000", "name": "example.com", "zone_id": "1000" } } } Edit Zone Referrer Edit the given Zone Referrer specified by the parameter {zonereferrer_id} with the speciefied request parameters. PUThttps://api.keycdn.com/zonereferrers/{zonereferrer_id}.json Request Parameters Same request parameters as in Add Zone Referrer . Response Parameters Returns the changed Zone Referrer with the same parameters as in List Zone Referrers . Example Request Response $ curl https://api.keycdn.com/zonereferrers/3000.json \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: \ -X PUT \ -d name=example.net \ -d zone_id=1000 { "status": "success", "description": "Zone Referrer successfully changed.", "data": { "zonereferrer": { "id": "3000", "name": "example.net", "zone_id": "1000" } } } Delete Zone Referrer Delete the given Zone Referrer specified by the parameter {zonereferrer_id} . DELETEhttps://api.keycdn.com/zonereferrers/{zonereferrer_id}.json Example Request Response $ curl https://api.keycdn.com/zonereferrers/3000.json \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: \ -X DELETE { "status": "success", "description": "Zone Referrer successfully deleted.", "data": [] } Reports API Traffic Statistics Returns a list of traffic statistics for a given time range. GEThttps://api.keycdn.com/reports/traffic.json Request Parameters Parameter Value Default Pull Push zone_id optional {numeric} start required {timestamp} unix end required {timestamp} unix region optional a , b or c Response Parameters Parameter Pull Push amount bytes timestamp unix Example Request Response $ curl "https://api.keycdn.com/reports/traffic.json?start=1541030400&end=1541203200" \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: { "status":"success", "description":"Data successfully received.", "data":{ "stats":[ { "amount":"6822186", "timestamp":"1541030400" }, { "amount":"9327251", "timestamp":"1541116800" }, { "amount":"6104220", "timestamp":"1541203200" } ] } } Storage Statistics Returns a list of storage statistics for a given time range. GEThttps://api.keycdn.com/reports/storage.json Request Parameters Parameter Value Default Pull Push zone_id optional {numeric} start required {timestamp} unix end required {timestamp} unix Response Parameters Parameter Pull Push amount bytes timestamp unix Example Request Response $ curl "https://api.keycdn.com/reports/storage.json?start=1541030400&end=1541203200" \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: { "status":"success", "description":"Data successfully received.", "data":{ "stats":[ { "amount":"538923008", "timestamp":"1541030400" }, { "amount":"538923008", "timestamp":"1541116800" }, { "amount":"538923008", "timestamp":"1541203200" } ] } } Image Processing Statistics Returns a list of Image Processing statistics for a given time range. GEThttps://api.keycdn.com/reports/ip.json Request Parameters Parameter Value Default Pull Push zone_id optional {numeric} start required {timestamp} unix end required {timestamp} unix Response Parameters Parameter Pull Push amount ops timestamp unix Example Request Response $ curl "https://api.keycdn.com/reports/ip.json?start=1541030400&end=1541203200" \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: { "status":"success", "description":"Data successfully received.", "data":{ "stats":[ { "amount":"1208", "timestamp":"1541030400" }, { "amount":"1234", "timestamp":"1541116800" }, { "amount":"1062", "timestamp":"1541203200" } ] } } Status Statistics Returns a list of state statistics for a given time range. GEThttps://api.keycdn.com/reports/statestats.json Request Parameters Parameter Value Default Pull Push zone_id optional {numeric} start required {timestamp} unix end required {timestamp} unix Response Parameters Parameter Pull Push totalcachehit totalcachemiss total2xx total3xx total4xx total5xx timestamp unix Example Request Response $ curl "https://api.keycdn.com/reports/statestats.json?start=1541030400&end=1541203200" \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: { "status":"success", "description":"Data successfully received.", "data":{ "stats":[ { "totalcachehit":"313", "totalcachemiss":"18", "totalsuccess":"329", "totalerror":"5", "timestamp":"1541030400" }, { "totalcachehit":"219", "totalcachemiss":"4", "totalsuccess":"220", "totalerror":"2", "timestamp":"1541116800" }, { "totalcachehit":"284", "totalcachemiss":"11", "totalsuccess":"302", "totalerror":"4", "timestamp":"1541203200" } ] } } Credits Statistics Returns a list of credit bookings for a given time range. GEThttps://api.keycdn.com/reports/credits.json Request Parameters Parameter Value Default start required {timestamp} unix end required {timestamp} unix Response Parameters Parameter amount credits type traffic, storage, zones, initial, or payment timestamp unix Example Request Response $ curl "https://api.keycdn.com/reports/credits.json?start=?start=1541030400&end=1541203200" \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: { "status":"success", "description":"Data successfully received.", "data":{ "stats":[ { "amount":"-0.01", "type":"storage", "timestamp":"1541030400" }, { "amount":"-0.02", "type":"traffic", "timestamp":"1541030400" }, { "amount":"-0.01", "type":"traffic", "timestamp":"1541116800" }, { "amount":"-0.01", "type":"storage", "timestamp":"1541116800" }, { "amount":"-0.01", "type":"storage", "timestamp":"1541203200" }, { "amount":"-0.02", "type":"traffic", "timestamp":"1541203200" } ] } } Credit Balance Returns the credit balance. GEThttps://api.keycdn.com/reports/creditbalance.json Response Parameters Parameter amount credits Example Request Response $ curl "https://api.keycdn.com/reports/creditbalance.json" \ -u sk_prod_zbSVNe8gVUMT4KjYcJWuyC86: { "status":"success", "description":"Data successfully received.", "data":{ "amount":"100" } } Product Features Network Pricing API Company About Blog Contact Referrals Careers Support Knowledge Base Network Status Open Source FAQ Tools © 2024 proinity LLC Made in Switzerland Terms Privacy GDPR × KeyCDN uses cookies to make its website easier to use. Learn more ×