CDN APIs (2.0.1)

The base URL for this API is: https://api.leaseweb.com/cdn/v2

BETA
This API is in BETA. Documentation might be incorrect or incomplete. Functionality might change with the final release.

Errors

The API uses standard HTTP status codes to indicate the success or failure of the API call.The response will be JSON. Most APIs use the following format:

{
"errorCode" : "APP00800",
"errorMessage" : "The connection with the DB cannot be established.",
"correlationId" : "550e8400-e29b-41d4-a716-446655440000",
"userMessage" : "Cannot handle your request at the moment. Please try again later.",
"reference" : "https://developer.leaseweb.com/errors/APP00800"
}

Authentication

Authentication for the APIs is required. To authenticate your call, you will need to sent your API key as X-LSW-Auth header.

You can generate API keys in the Customer Portal.

Origin

Create Origin

Create origin resouces to be used within distributions.

There are 2 types of origins:

  • Simple Origin
  • Advanced Origin
Authorizations:
None
Request Body schema: application/json
required
resourceType
required
string
Enum: "SIMPLE_ORIGIN" "ADVANCED_ORIGIN"
required
Array of items

Responses

Request samples

Content type
application/json
{
  • "resourceType": "SIMPLE_ORIGIN",
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "resourceType": "SIMPLE_ORIGIN",
  • "data": [
    ]
}

Get All Origins

Get the list of origins including all of the origin types. Types are specified in each record.

Authorizations:
None
query Parameters
limit
integer
Example: limit=20

Limit the number of results returned.

offset
integer
Example: offset=10

Return results starting from the given offset.

Responses

Response samples

Content type
application/json
{
  • "origins": [
    ],
  • "_metadata": {
    }
}

Get Origin By Id

Get an origin by its ID.

Authorizations:
None
path Parameters
origin_id
required
string (Origin Id)

Responses

Response samples

Content type
application/json
Example
{
  • "resourceType": "SIMPLE_ORIGIN",
  • "data": [
    ]
}

Update Origin By Id

Update the options available in an origin.

Note: Type of the origin can't be changed since it's considered a different type of entity.

Authorizations:
None
path Parameters
origin_id
required
string (Origin Id)
Request Body schema: application/json
required
resourceType
required
string (Resourcetype)
required
Array of objects (Data)

Responses

Request samples

Content type
application/json
{
  • "resourceType": "SIMPLE_ORIGIN",
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "resourceType": "SIMPLE_ORIGIN",
  • "data": [
    ]
}

Delete Origin By Id

Authorizations:
None
path Parameters
origin_id
required
string (Origin Id)

Responses

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "400",
  • "errorDetails": { },
  • "errorMessage": "The API could not interpret your request correctly."
}

OriginGroup

Create Origin Group

Using origin groups you can define loadbalancers on top of your origins.

Available loadbalancing methods:

  • ROUNDROBIN
  • CONSISTENT
  • STICKY
  • FAILOVER
Authorizations:
None
Request Body schema: application/json
required
resourceType
required
string (Resourcetype)
required
Array of objects (Data)

Responses

Request samples

Content type
application/json
{
  • "resourceType": "ORIGIN_GROUP",
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "resourceType": "ORIGIN_GROUP",
  • "data": [
    ]
}

Get All Origin Groups

Get the list of your origin groups.

Authorizations:
None
query Parameters
limit
integer
Example: limit=20

Limit the number of results returned.

offset
integer
Example: offset=10

Return results starting from the given offset.

Responses

Response samples

Content type
application/json
{
  • "originGroups": [
    ],
  • "_metadata": {
    }
}

Get Origin Group By Id

Get the details of an origin group by its ID.

Authorizations:
None
path Parameters
origin_group_id
required
string (Origin Group Id)

Responses

Response samples

Content type
application/json
{
  • "resourceType": "ORIGIN_GROUP",
  • "data": [
    ]
}

Update Origin Group By Id

Update the parameters in an origin group.

Note: members are managed by another endpoint.

Authorizations:
None
path Parameters
origin_group_id
required
string (Origin Group Id)
Request Body schema: application/json
required
resourceType
required
string (Resourcetype)
required
Array of objects (Data)

Responses

Request samples

Content type
application/json
{
  • "resourceType": "ORIGIN_GROUP",
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "resourceType": "ORIGIN_GROUP",
  • "data": [
    ]
}

Delete Origin Group By Id

Delete an origin group by its ID.

Authorizations:
None
path Parameters
origin_group_id
required
string (Origin Group Id)

Responses

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "400",
  • "errorDetails": { },
  • "errorMessage": "The API could not interpret your request correctly."
}

Create Origin Group Member

Add members (origins) to your origin group.

These are the backend servers that are going to be used within the loadbalancer.

Authorizations:
None
path Parameters
origin_group_id
required
string (Origin Group Id)
Request Body schema: application/json
required
resourceType
required
string (Resourcetype)
required
Array of objects (Data)

Responses

Request samples

Content type
application/json
{
  • "resourceType": "ORIGIN_GROUP_MEMBER",
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "resourceType": "ORIGIN_GROUP_MEMBER",
  • "data": [
    ]
}

Get All Origin Group Members

Get all of the members belonging to an origin group.

Authorizations:
None
path Parameters
origin_group_id
required
string (Origin Group Id)
query Parameters
limit
integer
Example: limit=20

Limit the number of results returned.

offset
integer
Example: offset=10

Return results starting from the given offset.

Responses

Response samples

Content type
application/json
{
  • "originGroupMembers": [
    ],
  • "_metadata": {
    }
}

Get Origin Group Member By Id

Get the details of an origin group member by its ID.

Authorizations:
None
path Parameters
origin_group_id
required
string (Origin Group Id)
origin_group_member_id
required
string (Origin Group Member Id)

Responses

Response samples

Content type
application/json
{
  • "resourceType": "ORIGIN_GROUP_MEMBER",
  • "data": [
    ]
}

Update Origin Group Member By Id

Update the parameters in an origin group member.

Authorizations:
None
path Parameters
origin_group_id
required
string (Origin Group Id)
origin_group_member_id
required
string (Origin Group Member Id)
Request Body schema: application/json
required
resourceType
required
string (Resourcetype)
required
Array of objects (Data)

Responses

Request samples

Content type
application/json
{
  • "resourceType": "ORIGIN_GROUP_MEMBER",
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "resourceType": "ORIGIN_GROUP_MEMBER",
  • "data": [
    ]
}

Delete Origin Group Member By Id

Authorizations:
None
path Parameters
origin_group_id
required
string (Origin Group Id)
origin_group_member_id
required
string (Origin Group Member Id)

Responses

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "400",
  • "errorDetails": { },
  • "errorMessage": "The API could not interpret your request correctly."
}

Debug

Debug Url

You can use this endpoint to debug your distributions on each CDN provider independently. All of the returned headers per provider are included in the response.

Note: Use the specific domain you want to debug since each distribution can have multiple custom domains.

Authorizations:
None
Request Body schema: application/json
required
url
required
string <uri> (Url) [ 1 .. 2083 ] characters

Responses

Request samples

Content type
application/json

Response samples

Content type
application/json
{}

Invalidation

Do Invalidation

You can submit multiple URLs to be invalidated and purged on all of the CDN PoPs. The time to finish the purge depends on the CDN providers and the number of cached files.

Authorizations:
None
Request Body schema: application/json
required
files
Array of strings (Files)

Responses

Request samples

Content type
application/json

Response samples

Content type
application/json
{
  • "type": "INVALIDATION",
  • "resource": {
    },
  • "status": "PENDING",
  • "id": "0533396e-e5c6-4de2-bd08-06dfa91a3ab6",
  • "customerId": "47927462",
  • "created": "2024-07-11T12:14:43Z",
  • "updated": ""
}

Certificate

Create Certificate

Using this endpoint, you can upload your custom TLS certificates to be used in your distributions.

Note: some CDN providers need more time to apply your new certificate to your newly created distribution. Please be aware and always try to upload your certificates as soon as possible.

Authorizations:
None
Request Body schema: application/json
required
Any of
Description (string) or Description (null) (Description)
certificate
required
string (Certificate)
privateKey
required
string (Privatekey)
caBundle
required
string (Cabundle)
validation
boolean (Validation)
Default: true

Responses

Request samples

Content type
application/json
{
  • "description": "Main LSW Certificate 2024",
  • "certificate": "-----BEGIN CERTIFICATE----- {***} -----END CERTIFICATE-----",
  • "privateKey": "-----BEGIN PRIVATE KEY----- {***} -----END PRIVATE KEY-----",
  • "caBundle": "-----BEGIN CERTIFICATE----- {***} -----END CERTIFICATE-----",
  • "validation": true
}

Response samples

Content type
application/json
{
  • "description": "Main LSW Certificate 2024",
  • "certificate": "Hidden for security reasons",
  • "privateKey": "Hidden for security reasons",
  • "caBundle": "Hidden for security reasons",
  • "validation": true,
  • "id": "ce-5g8wbh25",
  • "commonName": "c1",
  • "issuer": "c1",
  • "valid": true,
  • "trusted": true,
  • "daysLeft": 364,
  • "validFrom": 1723118047,
  • "validUntil": 1754646847,
  • "created": "2024-03-19T08:15:23",
  • "updated": "2024-03-19T08:15:23"
}

Get All Certificates

Get the list of your certificates.

Authorizations:
None
query Parameters
limit
integer
Example: limit=20

Limit the number of results returned.

offset
integer
Example: offset=10

Return results starting from the given offset.

Responses

Response samples

Content type
application/json
{
  • "certificates": [
    ],
  • "_metadata": {
    }
}

Get Certificate By Id

Get the details of a certificate by its ID

Authorizations:
None
path Parameters
certificate_id
required
string (Certificate Id)

Responses

Response samples

Content type
application/json
{
  • "description": "Main LSW Certificate 2024",
  • "certificate": "Hidden for security reasons",
  • "privateKey": "Hidden for security reasons",
  • "caBundle": "Hidden for security reasons",
  • "validation": true,
  • "id": "ce-5g8wbh25",
  • "commonName": "c1",
  • "issuer": "c1",
  • "valid": true,
  • "trusted": true,
  • "daysLeft": 364,
  • "validFrom": 1723118047,
  • "validUntil": 1754646847,
  • "created": "2024-03-19T08:15:23",
  • "updated": "2024-03-19T08:15:23"
}

Delete Certificate By Id

Authorizations:
None
path Parameters
certificate_id
required
string (Certificate Id)

Responses

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "400",
  • "errorDetails": { },
  • "errorMessage": "The API could not interpret your request correctly."
}

Action

Get All Actions

Get the list of all of the actions to monitor the progress of your background jobs.

Authorizations:
None
query Parameters
filters
Array of strings (Filters)
Items Enum: "INVALIDATION" "CREATE_DIST" "UPDATE_DIST" "DELETE_DIST"
limit
integer
Example: limit=20

Limit the number of results returned.

offset
integer
Example: offset=10

Return results starting from the given offset.

Responses

Response samples

Content type
application/json
{
  • "actions": [
    ],
  • "_metadata": {
    }
}

Get Action By Id

Get an action by ID to monitor the progress.

Authorizations:
None
path Parameters
action_id
required
string <uuid> (Action Id)

Responses

Response samples

Content type
application/json
{
  • "type": "INVALIDATION",
  • "status": "PENDING",
  • "id": "50ea5204-4827-41d2-a940-cb5afdfb2426",
  • "customerId": "215468472",
  • "created": "2019-08-24T14:15:22Z",
  • "updated": "2019-08-24T14:15:22Z"
}

Distribution

Create Distribution

Create any kind of distribution using this endpoint.

Available distribution types:

  • DISTRIBUTION_VOLUME
  • DISTRIBUTION_PREMIUM
  • SHIELD_CDN
Authorizations:
None
Request Body schema: application/json
required
resourceType
required
string (Resourcetype)
required
Array of objects (Data)

Responses

Request samples

Content type
application/json
Example
{
  • "resourceType": "DISTRIBUTION_VOLUME",
  • "data": [
    ]
}

Response samples

Content type
application/json
Example
{
  • "resourceType": "DISTRIBUTION_VOLUME",
  • "data": [
    ]
}

Get All Distributions

Get the list of your distributions.

Authorizations:
None
query Parameters
limit
integer
Example: limit=20

Limit the number of results returned.

offset
integer
Example: offset=10

Return results starting from the given offset.

Responses

Response samples

Content type
application/json
{
  • "distributions": [
    ],
  • "_metadata": {
    }
}

Get Distribution By Id

Get the general details of a distribution by its ID.

Authorizations:
None
path Parameters
distribution_id
required
string (Distribution Id)

Responses

Response samples

Content type
application/json
{
  • "resourceType": "DISTRIBUTION_VOLUME",
  • "data": [
    ]
}

Update Distribution By Id

Authorizations:
None
path Parameters
distribution_id
required
string (Distribution Id)
Request Body schema: application/json
required
resourceType
required
string (Resourcetype)
required
Array of objects (Data)

Responses

Request samples

Content type
application/json
{
  • "resourceType": "DISTRIBUTION_VOLUME",
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "resourceType": "DISTRIBUTION_VOLUME",
  • "data": [
    ]
}

Delete Distribution By Id

Authorizations:
None
path Parameters
distribution_id
required
string (Distribution Id)

Responses

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "400",
  • "errorDetails": { },
  • "errorMessage": "The API could not interpret your request correctly."
}

Domain

Create Domain

Add custom domains to a distribution.

Authorizations:
None
path Parameters
distribution_id
required
string (Distribution Id)
Request Body schema: application/json
required
domain
required
string (Domain)

Responses

Request samples

Content type
application/json
{
  • "domain": "test2.com"
}

Response samples

Content type
application/json
{
  • "domain": "test2.com",
  • "id": "test2.com",
  • "distributionId": "di-yt84vrj",
  • "created": "2024-07-31T02:15:32",
  • "updated": "2024-08-04T23:24:29"
}

Get All Domains

Get the list of custom domains attached to a distribution.

Authorizations:
None
path Parameters
distribution_id
required
string (Distribution Id)
query Parameters
limit
integer
Example: limit=20

Limit the number of results returned.

offset
integer
Example: offset=10

Return results starting from the given offset.

Responses

Response samples

Content type
application/json
{
  • "domains": [
    ],
  • "_metadata": {
    }
}

Get Domain By Id

Get the details of a custom domain attached to a dsitribution.

Authorizations:
None
path Parameters
distribution_id
required
string (Distribution Id)
domain_id
required
string (Domain Id)

Responses

Response samples

Content type
application/json
{
  • "domain": "test2.com",
  • "id": "test2.com",
  • "distributionId": "di-yt84vrj",
  • "created": "2024-07-31T02:15:32",
  • "updated": "2024-08-04T23:24:29"
}

Delete Domain By Id

Authorizations:
None
path Parameters
distribution_id
required
string (Distribution Id)
domain_id
required
string (Domain Id)

Responses

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "400",
  • "errorDetails": { },
  • "errorMessage": "The API could not interpret your request correctly."
}

Policy

Create Policy

Apply custom configurations using policies.

Note: Policies only exist for Volume and Shield distributions and only one policy can be added for volume distributions.

Authorizations:
None
path Parameters
distribution_id
required
string (Distribution Id)
Request Body schema: application/json
required
securityToken
boolean (Securitytoken)
Default: false
"LEASEWEB" (any) or Securitytokenvendor (null) (Securitytokenvendor)
Securitytokenmethod (string) or Securitytokenmethod (null) (Securitytokenmethod)
Securitytokensecret (string) or Securitytokensecret (null) (Securitytokensecret)
Securitytokenaeskey (string) or Securitytokenaeskey (null) (Securitytokenaeskey)
Securitytokenshakey (string) or Securitytokenshakey (null) (Securitytokenshakey)
securityTokenClientIp
boolean (Securitytokenclientip)
Default: false
Securitytokenexpirationparam (string) or Securitytokenexpirationparam (null) (Securitytokenexpirationparam)
Securitytokenparam (string) or Securitytokenparam (null) (Securitytokenparam)
securityTokenNumberOfPathComponents
integer (Securitytokennumberofpathcomponents) [ -1 .. 10 ]
Default: -1
securityTokenEmbedIntoPath
boolean (Securitytokenembedintopath)
Default: false
securityGeoAcl
boolean (Securitygeoacl)
Default: false
Securitygeoacldefault (string) or Securitygeoacldefault (null) (Securitygeoacldefault)
securityIpAcl
boolean (Securityipacl)
Default: false
Securityipacldefault (string) or Securityipacldefault (null) (Securityipacldefault)
securityReferrerAcl
boolean (Securityreferreracl)
Default: false
Securityreferreracldefault (string) or Securityreferreracldefault (null) (Securityreferreracldefault)
originPullProtocol
string (Originpullprotocol)
Default: "HTTP"
Enum: "HTTP" "HTTPS"
Originpullcompressed (boolean) or Originpullcompressed (null) (Originpullcompressed)
Originpullhostheader (string) or Originpullhostheader (null) (Originpullhostheader)
Originpullid (string) or Originpullid (null) (Originpullid)
Originpullgroupid (string) or Originpullgroupid (null) (Originpullgroupid)
Originpullshieldid (string) or Originpullshieldid (null) (Originpullshieldid)
originPullXff
boolean (Originpullxff)
Default: false
originPullPassCookie
boolean (Originpullpasscookie)
Default: false
originPullPassVary
boolean (Originpullpassvary)
Default: false
cacheQueryString
boolean (Cachequerystring)
Default: false
Cachedefaultttl (integer) or Cachedefaultttl (null) (Cachedefaultttl)
cacheHonorOriginTtl
boolean (Cachehonororiginttl)
Default: false
cacheStale
boolean (Cachestale)
Default: false
cacheByPass
boolean (Cachebypass)
Default: false
cacheSegmented
boolean (Cachesegmented)
Default: true
deliveryTtlInherit
boolean (Deliveryttlinherit)
Default: false
deliveryTtlOverride
integer (Deliveryttloverride)
Default: 0
deliveryCompress
boolean (Deliverycompress)
Default: false
deliveryRateLimit
boolean (Deliveryratelimit)
Default: false
Deliverytransferrate (integer) or Deliverytransferrate (null) (Deliverytransferrate)
Deliveryburstsize (integer) or Deliveryburstsize (null) (Deliveryburstsize)
deliveryForceHttps
boolean (Deliveryforcehttps)
Default: false
deliveryPassThroughAllHeaders
boolean (Deliverypassthroughallheaders)
Default: false
description
string (Description)
Allowedmethods (string) or Allowedmethods (null) (Allowedmethods)
Default: "GET,HEAD"
path
string (Path)
Default: "/"

Responses

Request samples

Content type
application/json
{
  • "description": "test-policy-1",
  • "allowedMethods": "GET,POST,HEAD,PUT,OPTIONS",
  • "securityGeoAcl": false,
  • "securityIpAcl": false,
  • "securityReferrerAcl": false,
  • "originPullProtocol": "HTTP",
  • "originPullCompressed": false,
  • "originPullHostHeader": "test.invalid",
  • "originPullId": "or-r81jws",
  • "originPullGroupId": null,
  • "originPullXff": false,
  • "cacheQueryString": false,
  • "cacheDefaultTtl": 86400,
  • "cacheHonorOriginTtl": false,
  • "cacheStale": false,
  • "deliveryTtlInherit": false,
  • "deliveryTtlOverride": 0,
  • "deliveryCompress": false,
  • "deliveryForceHttps": false
}

Response samples

Content type
application/json
{
  • "securityToken": false,
  • "securityTokenVendor": null,
  • "securityTokenMethod": null,
  • "securityTokenSecret": null,
  • "securityTokenAesKey": null,
  • "securityTokenShaKey": null,
  • "securityTokenClientIp": false,
  • "securityTokenExpirationParam": null,
  • "securityTokenParam": null,
  • "securityTokenNumberOfPathComponents": -1,
  • "securityTokenEmbedIntoPath": false,
  • "securityGeoAcl": false,
  • "securityGeoAclDefault": null,
  • "securityIpAcl": true,
  • "securityIpAclDefault": null,
  • "securityReferrerAcl": false,
  • "securityReferrerAclDefault": null,
  • "originPullProtocol": "HTTP",
  • "originPullCompressed": false,
  • "originPullHostHeader": "test.invalid",
  • "originPullId": "or-r8n157f",
  • "originPullGroupId": null,
  • "originPullShieldId": null,
  • "originPullXff": false,
  • "originPullPassCookie": false,
  • "originPullPassVary": false,
  • "cacheQueryString": false,
  • "cacheDefaultTtl": 86400,
  • "cacheHonorOriginTtl": false,
  • "cacheStale": false,
  • "cacheByPass": false,
  • "cacheSegmented": true,
  • "deliveryTtlInherit": false,
  • "deliveryTtlOverride": 0,
  • "deliveryCompress": false,
  • "deliveryRateLimit": false,
  • "deliveryTransferRate": null,
  • "deliveryBurstSize": null,
  • "deliveryForceHttps": false,
  • "deliveryPassThroughAllHeaders": false,
  • "description": "test-policy-4",
  • "allowedMethods": "GET,POST,HEAD,PUT,OPTIONS",
  • "path": "/",
  • "id": "po-48nwon",
  • "customerId": "cu-a4c79393",
  • "created": "2024-08-06T08:55:37",
  • "updated": "2024-08-07T23:31:44"
}

Get All Policies

Get the list of policies for a distribution.

Note: Policies only exist for Volume and Shield distributions.

Authorizations:
None
path Parameters
distribution_id
required
string (Distribution Id)
query Parameters
limit
integer
Example: limit=20

Limit the number of results returned.

offset
integer
Example: offset=10

Return results starting from the given offset.

Responses

Response samples

Content type
application/json
{
  • "policies": [
    ],
  • "_metadata": {
    }
}

Get Policy By Id

Get the details of a policy using its ID.

Authorizations:
None
path Parameters
distribution_id
required
string (Distribution Id)
policy_id
required
string (Policy Id)

Responses

Response samples

Content type
application/json
{
  • "securityToken": false,
  • "securityTokenVendor": null,
  • "securityTokenMethod": null,
  • "securityTokenSecret": null,
  • "securityTokenAesKey": null,
  • "securityTokenShaKey": null,
  • "securityTokenClientIp": false,
  • "securityTokenExpirationParam": null,
  • "securityTokenParam": null,
  • "securityTokenNumberOfPathComponents": -1,
  • "securityTokenEmbedIntoPath": false,
  • "securityGeoAcl": false,
  • "securityGeoAclDefault": null,
  • "securityIpAcl": true,
  • "securityIpAclDefault": null,
  • "securityReferrerAcl": false,
  • "securityReferrerAclDefault": null,
  • "originPullProtocol": "HTTP",
  • "originPullCompressed": false,
  • "originPullHostHeader": "test.invalid",
  • "originPullId": "or-r8n157f",
  • "originPullGroupId": null,
  • "originPullShieldId": null,
  • "originPullXff": false,
  • "originPullPassCookie": false,
  • "originPullPassVary": false,
  • "cacheQueryString": false,
  • "cacheDefaultTtl": 86400,
  • "cacheHonorOriginTtl": false,
  • "cacheStale": false,
  • "cacheByPass": false,
  • "cacheSegmented": true,
  • "deliveryTtlInherit": false,
  • "deliveryTtlOverride": 0,
  • "deliveryCompress": false,
  • "deliveryRateLimit": false,
  • "deliveryTransferRate": null,
  • "deliveryBurstSize": null,
  • "deliveryForceHttps": false,
  • "deliveryPassThroughAllHeaders": false,
  • "description": "test-policy-4",
  • "allowedMethods": "GET,POST,HEAD,PUT,OPTIONS",
  • "path": "/",
  • "id": "po-48nwon",
  • "customerId": "cu-a4c79393",
  • "created": "2024-08-06T08:55:37",
  • "updated": "2024-08-07T23:31:44"
}

Update Policy By Id

Authorizations:
None
path Parameters
distribution_id
required
string (Distribution Id)
policy_id
required
string (Policy Id)
Request Body schema: application/json
required

Update the options available in each policy.

securityToken
boolean (Securitytoken)
Default: false
"LEASEWEB" (any) or Securitytokenvendor (null) (Securitytokenvendor)
Securitytokenmethod (string) or Securitytokenmethod (null) (Securitytokenmethod)
Securitytokensecret (string) or Securitytokensecret (null) (Securitytokensecret)
Securitytokenaeskey (string) or Securitytokenaeskey (null) (Securitytokenaeskey)
Securitytokenshakey (string) or Securitytokenshakey (null) (Securitytokenshakey)
securityTokenClientIp
boolean (Securitytokenclientip)
Default: false
Securitytokenexpirationparam (string) or Securitytokenexpirationparam (null) (Securitytokenexpirationparam)
Securitytokenparam (string) or Securitytokenparam (null) (Securitytokenparam)
securityTokenNumberOfPathComponents
integer (Securitytokennumberofpathcomponents) [ -1 .. 10 ]
Default: -1
securityTokenEmbedIntoPath
boolean (Securitytokenembedintopath)
Default: false
securityGeoAcl
boolean (Securitygeoacl)
Default: false
Securitygeoacldefault (string) or Securitygeoacldefault (null) (Securitygeoacldefault)
securityIpAcl
boolean (Securityipacl)
Default: false
Securityipacldefault (string) or Securityipacldefault (null) (Securityipacldefault)
securityReferrerAcl
boolean (Securityreferreracl)
Default: false
Securityreferreracldefault (string) or Securityreferreracldefault (null) (Securityreferreracldefault)
originPullProtocol
string (Originpullprotocol)
Default: "HTTP"
Enum: "HTTP" "HTTPS"
Originpullcompressed (boolean) or Originpullcompressed (null) (Originpullcompressed)
Originpullhostheader (string) or Originpullhostheader (null) (Originpullhostheader)
Originpullid (string) or Originpullid (null) (Originpullid)
Originpullgroupid (string) or Originpullgroupid (null) (Originpullgroupid)
Originpullshieldid (string) or Originpullshieldid (null) (Originpullshieldid)
originPullXff
boolean (Originpullxff)
Default: false
originPullPassCookie
boolean (Originpullpasscookie)
Default: false
originPullPassVary
boolean (Originpullpassvary)
Default: false
cacheQueryString
boolean (Cachequerystring)
Default: false
Cachedefaultttl (integer) or Cachedefaultttl (null) (Cachedefaultttl)
cacheHonorOriginTtl
boolean (Cachehonororiginttl)
Default: false
cacheStale
boolean (Cachestale)
Default: false
cacheByPass
boolean (Cachebypass)
Default: false
cacheSegmented
boolean (Cachesegmented)
Default: true
deliveryTtlInherit
boolean (Deliveryttlinherit)
Default: false
deliveryTtlOverride
integer (Deliveryttloverride)
Default: 0
deliveryCompress
boolean (Deliverycompress)
Default: false
deliveryRateLimit
boolean (Deliveryratelimit)
Default: false
Deliverytransferrate (integer) or Deliverytransferrate (null) (Deliverytransferrate)
Deliveryburstsize (integer) or Deliveryburstsize (null) (Deliveryburstsize)
deliveryForceHttps
boolean (Deliveryforcehttps)
Default: false
deliveryPassThroughAllHeaders
boolean (Deliverypassthroughallheaders)
Default: false
description
string (Description)
Allowedmethods (string) or Allowedmethods (null) (Allowedmethods)
Default: "GET,HEAD"
path
string (Path)
Default: "/"

Responses

Request samples

Content type
application/json
{
  • "securityToken": false,
  • "securityTokenVendor": null,
  • "securityTokenMethod": null,
  • "securityTokenSecret": null,
  • "securityTokenAesKey": null,
  • "securityTokenShaKey": null,
  • "securityTokenClientIp": false,
  • "securityTokenExpirationParam": null,
  • "securityTokenParam": null,
  • "securityTokenNumberOfPathComponents": -1,
  • "securityTokenEmbedIntoPath": false,
  • "securityGeoAcl": false,
  • "securityGeoAclDefault": null,
  • "securityIpAcl": true,
  • "securityIpAclDefault": null,
  • "securityReferrerAcl": false,
  • "securityReferrerAclDefault": null,
  • "originPullProtocol": "HTTP",
  • "originPullCompressed": false,
  • "originPullHostHeader": "test.invalid",
  • "originPullId": "or-r8n157f",
  • "originPullGroupId": null,
  • "originPullShieldId": null,
  • "originPullXff": false,
  • "originPullPassCookie": false,
  • "originPullPassVary": false,
  • "cacheQueryString": false,
  • "cacheDefaultTtl": 86400,
  • "cacheHonorOriginTtl": false,
  • "cacheStale": false,
  • "cacheByPass": false,
  • "cacheSegmented": true,
  • "deliveryTtlInherit": false,
  • "deliveryTtlOverride": 0,
  • "deliveryCompress": false,
  • "deliveryRateLimit": false,
  • "deliveryTransferRate": null,
  • "deliveryBurstSize": null,
  • "deliveryForceHttps": false,
  • "deliveryPassThroughAllHeaders": false,
  • "description": "test-policy-4-upated",
  • "allowedMethods": "GET,POST,HEAD,PUT",
  • "path": "/"
}

Response samples

Content type
application/json
{
  • "securityToken": false,
  • "securityTokenVendor": null,
  • "securityTokenMethod": null,
  • "securityTokenSecret": null,
  • "securityTokenAesKey": null,
  • "securityTokenShaKey": null,
  • "securityTokenClientIp": false,
  • "securityTokenExpirationParam": null,
  • "securityTokenParam": null,
  • "securityTokenNumberOfPathComponents": -1,
  • "securityTokenEmbedIntoPath": false,
  • "securityGeoAcl": false,
  • "securityGeoAclDefault": null,
  • "securityIpAcl": true,
  • "securityIpAclDefault": null,
  • "securityReferrerAcl": false,
  • "securityReferrerAclDefault": null,
  • "originPullProtocol": "HTTP",
  • "originPullCompressed": false,
  • "originPullHostHeader": "test.invalid",
  • "originPullId": "or-r8n157f",
  • "originPullGroupId": null,
  • "originPullShieldId": null,
  • "originPullXff": false,
  • "originPullPassCookie": false,
  • "originPullPassVary": false,
  • "cacheQueryString": false,
  • "cacheDefaultTtl": 86400,
  • "cacheHonorOriginTtl": false,
  • "cacheStale": false,
  • "cacheByPass": false,
  • "cacheSegmented": true,
  • "deliveryTtlInherit": false,
  • "deliveryTtlOverride": 0,
  • "deliveryCompress": false,
  • "deliveryRateLimit": false,
  • "deliveryTransferRate": null,
  • "deliveryBurstSize": null,
  • "deliveryForceHttps": false,
  • "deliveryPassThroughAllHeaders": false,
  • "description": "test-policy-4-updated",
  • "allowedMethods": "GET,POST,HEAD,PUT",
  • "path": "/",
  • "id": "po-48nwon",
  • "customerId": "cu-a4c79393",
  • "created": "2024-08-06T08:55:37",
  • "updated": "2024-08-07T23:31:44"
}

Delete Policy By Id

Authorizations:
None
path Parameters
distribution_id
required
string (Distribution Id)
policy_id
required
string (Policy Id)

Responses

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "400",
  • "errorDetails": { },
  • "errorMessage": "The API could not interpret your request correctly."
}

ACL

Create Acl

Create an ACL to control the traffic to a policy.

There are 3 types of ACLs:

  • IP_ACL: Reject or allow certain IP subnets.
  • GEO_ACL: Reject or allow certain countries.
  • REFERRER_ACL: Reject or allow certain referrers.
Authorizations:
None
path Parameters
distribution_id
required
string (Distribution Id)
policy_id
required
string (Policy Id)
Request Body schema: application/json
required
action
string (Action)
Default: "REJECT"
Enum: "REJECT" "ALLOW"
value
required
string (Value)
type
required
string (Type)
Enum: "IP_ACL" "GEO_ACL" "REFERRER_ACL"

Responses

Request samples

Content type
application/json
{
  • "action": "REJECT",
  • "value": "1.1.1.5/32",
  • "type": "IP_ACL"
}

Response samples

Content type
application/json
{
  • "action": "REJECT",
  • "value": "1.1.1.5/32",
  • "type": "IP_ACL",
  • "id": "iacl-2",
  • "policyId": "po-wk0ksi0x",
  • "created": "2024-08-06T08:55:37",
  • "updated": "2024-08-07T23:31:44"
}

Get All Acls

Get the list of active ACLs in a policy.

Authorizations:
None
path Parameters
distribution_id
required
string (Distribution Id)
policy_id
required
string (Policy Id)
query Parameters
limit
integer
Example: limit=20

Limit the number of results returned.

offset
integer
Example: offset=10

Return results starting from the given offset.

Responses

Response samples

Content type
application/json
{
  • "acls": [
    ],
  • "_metadata": {
    }
}

Get Acl By Id

Get an ACL by its ID.

Authorizations:
None
path Parameters
distribution_id
required
string (Distribution Id)
policy_id
required
string (Policy Id)
acl_id
required
string (Acl Id)

Responses

Response samples

Content type
application/json
{
  • "action": "REJECT",
  • "value": "1.1.1.5/32",
  • "type": "IP_ACL",
  • "id": "iacl-2",
  • "policyId": "po-wk0ksi0x",
  • "created": "2024-08-06T08:55:37",
  • "updated": "2024-08-07T23:31:44"
}

Delete Acl By Id

Authorizations:
None
path Parameters
distribution_id
required
string (Distribution Id)
policy_id
required
string (Policy Id)
acl_id
required
string (Acl Id)

Responses

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "400",
  • "errorDetails": { },
  • "errorMessage": "The API could not interpret your request correctly."
}

Statistics

Get Statistics For Reseller Customer

Query statistics for reseller customer This endpoint is intended to be used for getting various statistics from the reporting backend

It currently supports DATATRANSFER, BANDWIDTH, REQUESTS, STATUS_2XX, STATUS_4XX, STATUS_5XX, CACHEHIT and 95TH as a metric.

DATATRANSFER: used to get the consumed amount of traffic (in bytes) in the queried period.
BANDWIDTH: used to get the mean amount of bits per second in the queried period.
STATUS_2XX/4XX/5XX: used to get a percentage of the amount of response codes in the queried period.
CACHEHIT: used to get the mean cache-hit ratio in the queried period.
REQUESTS: used to get the total amount of serviced requests in the queried period.
95TH: used to get the 95th percentile in bits per second for the queried period.

The fromDt and toDt must use the format YYYY-MM-ddTHH:mm:ss eg.. 2024-07-14T13:40:00.

Using the 'groupBy' parameter will allow you to group results together. Supported groupings are PROVIDER, DISTRIBUTION, CUSTOMER and REGION.

By specifying the distributionId as an additional filter the query will run just for the specified distribution. The granularity of the data can be specified in 5MIN (5 minutes), 15MIN (15 minutes), HOUR (1 hour), DAY (1 day) and WEEK (1 Week).


Authorizations:
None
query Parameters
fromDt
required
string <date-time> (fromDt)
toDt
required
string <date-time> (toDt)
metric
required
string (metric)
Enum: "DATATRANSFER" "BANDWIDTH" "REQUESTS" "STATUS_2XX" "STATUS_4XX" "STATUS_5XX" "CACHEHIT" "95TH"
distributionId
string (distributionId)
groupBy
string (groupBy)
Enum: "PROVIDER" "DISTRIBUTION" "CUSTOMER" "REGION"
granularity
string (granularity)
Default: "5MIN"
Enum: "5MIN" "15MIN" "HOUR" "DAY" "WEEK"

Responses

Response samples

Content type
application/json
{
  • "fromTs": "2024-07-13T14:45:00",
  • "toTs": "2024-07-13T14:55:00",
  • "service": "cdn",
  • "granularity": "5MIN",
  • "groupBy": null,
  • "distributionId": null,
  • "series": [
    ]
}

Get Total Statistics For Reseller Customer

Query total statistics for reseller customer This endpoint is intended to be used for getting the summed (total) statistics from the reporting backend

It currently supports DATATRANSFER, BANDWIDTH, REQUESTS, STATUS_2XX, STATUS_4XX, STATUS_5XX, CACHEHIT and 95TH as a metric.

DATATRANSFER: used to get the consumed amount of traffic (in bytes) in the queried period.
BANDWIDTH: used to get the mean amount of bits per second in the queried period.
STATUS_2XX/4XX/5XX: used to get a percentage of the amount of response codes in the queried period.
CACHEHIT: used to get the mean cache-hit ratio in the queried period.
REQUESTS: used to get the total amount of serviced requests in the queried period.
95TH: used to get the 95th percentile in bits per second for the queried period.

The fromDt and toDt must use the format YYYY-MM-ddTHH:mm:ss eg.. 2024-07-14T13:40:00.

Using the 'groupBy' parameter will allow you to group results together. Supported groupings are PROVIDER, DISTRIBUTION, CUSTOMER and REGION. By specifying the distributionId as an additional filter the query will run just for the specified distribution.


Authorizations:
None
query Parameters
fromDt
required
string <date-time> (fromDt)
toDt
required
string <date-time> (toDt)
metric
required
string (metric)
Enum: "DATATRANSFER" "BANDWIDTH" "REQUESTS" "STATUS_2XX" "STATUS_4XX" "STATUS_5XX" "CACHEHIT" "95TH"
distributionId
string (distributionId)
groupBy
string (groupBy)
Enum: "PROVIDER" "DISTRIBUTION" "CUSTOMER" "REGION"

Responses

Response samples

Content type
application/json
{
  • "fromTs": "2024-07-13T14:45:00",
  • "toTs": "2024-07-13T14:55:00",
  • "service": "cdn",
  • "granularity": "5MIN",
  • "groupBy": "PROVIDER",
  • "distributionId": null,
  • "series": [
    ]
}

Get Statistics For Customer

Query statistics for customer This endpoint is intended to be used for getting various statistics from the reporting backend

It currently supports DATATRANSFER, BANDWIDTH, REQUESTS, STATUS_2XX, STATUS_4XX, STATUS_5XX, CACHEHIT and 95TH as a metric.

DATATRANSFER: used to get the consumed amount of traffic (in bytes) in the queried period.
BANDWIDTH: used to get the mean amount of bits per second in the queried period.
STATUS_2XX/4XX/5XX: used to get a percentage of the amount of response codes in the queried period.
CACHEHIT: used to get the mean cache-hit ratio in the queried period.
REQUESTS: used to get the total amount of serviced requests in the queried period.
95TH: used to get the 95th percentile in bits per second for the queried period.

The fromDt and toDt must use the format YYYY-MM-ddTHH:mm:ss eg.. 2024-07-14T13:40:00.

Using the 'groupBy' parameter will allow you to group results together. Supported groupings are PROVIDER, DISTRIBUTION, CUSTOMER and REGION.

By specifying the distributionId as an additional filter the query will run just for the specified distribution. The granularity of the data can be specified in 5MIN (5 minutes), 15MIN (15 minutes), HOUR (1 hour), DAY (1 day) and WEEK (1 Week).


Authorizations:
None
query Parameters
fromDt
required
string <date-time> (fromDt)
toDt
required
string <date-time> (toDt)
metric
required
string (metric)
Enum: "DATATRANSFER" "BANDWIDTH" "REQUESTS" "STATUS_2XX" "STATUS_4XX" "STATUS_5XX" "CACHEHIT" "95TH"
distributionId
string (distributionId)
groupBy
string (groupBy)
Enum: "PROVIDER" "DISTRIBUTION" "CUSTOMER" "REGION"
granularity
string (granularity)
Default: "5MIN"
Enum: "5MIN" "15MIN" "HOUR" "DAY" "WEEK"

Responses

Response samples

Content type
application/json
{
  • "fromTs": "2024-08-20T09:28:38",
  • "toTs": "2024-08-20T09:40:00",
  • "service": "cdn",
  • "granularity": "5MIN",
  • "groupBy": "REGION",
  • "distributionId": null,
  • "series": [
    ]
}

Get Total Statistics For Customer

Query total statistics for customer This endpoint is intended to be used for getting the summed (total) statistics from the reporting backend

It currently supports DATATRANSFER, BANDWIDTH, REQUESTS, STATUS_2XX, STATUS_4XX, STATUS_5XX, CACHEHIT and 95TH as a metric.

DATATRANSFER: used to get the consumed amount of traffic (in bytes) in the queried period.
BANDWIDTH: used to get the mean amount of bits per second in the queried period.
STATUS_2XX/4XX/5XX: used to get a percentage of the amount of response codes in the queried period.
CACHEHIT: used to get the mean cache-hit ratio in the queried period.
REQUESTS: used to get the total amount of serviced requests in the queried period.
95TH: used to get the 95th percentile in bits per second for the queried period.

The fromDt and toDt must use the format YYYY-MM-ddTHH:mm:ss eg.. 2024-07-14T13:40:00.

Using the 'groupBy' parameter will allow you to group results together. Supported groupings are PROVIDER, DISTRIBUTION, CUSTOMER and REGION. By specifying the distributionId as an additional filter the query will run just for the specified distribution.


Authorizations:
None
query Parameters
fromDt
required
string <date-time> (fromDt)
toDt
required
string <date-time> (toDt)
metric
required
string (metric)
Enum: "DATATRANSFER" "BANDWIDTH" "REQUESTS" "STATUS_2XX" "STATUS_4XX" "STATUS_5XX" "CACHEHIT" "95TH"
distributionId
string (distributionId)
groupBy
string (groupBy)
Enum: "PROVIDER" "DISTRIBUTION" "CUSTOMER" "REGION"

Responses

Response samples

Content type
application/json
{
  • "fromTs": "2024-07-13T14:45:00",
  • "toTs": "2024-07-13T14:55:00",
  • "service": "cdn",
  • "granularity": "5MIN",
  • "groupBy": "PROVIDER",
  • "distributionId": null,
  • "series": [
    ]
}