CacheFly API (2.5.0)

Download OpenAPI specification:Download

API Tokens

API tokens are intended to be used for automated user not present integrations, that is where requesting interactive authentication would not be possible/desirable.

Users may create API tokens (if they have permissions to do so). The created token may have the same set of permissions and services as the user that created it, or any subset thereof. Users are not permitted to create tokens which have more permissions than themselves.

API tokens do not expire, and are only returned from the API once. After the API token has been created it's permissions may be modified, which allows for granting additional permissions to an application without needing to reconfigure it.

List All Tokens

Authorizations:
BearerAuth
query Parameters
responseType
string
Default: "shallow"
Enum: "ids" "shallow" "selected" "full"
offset
integer >= 0
Default: 0

Number of results to skip

limit
integer [ 0 .. 1000 ]
Default: 10

Max number of results per page

Responses

Response samples

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

Create Token

Authorizations:
BearerAuth
Request Body schema: application/json
name
required
string
hideSecrets
boolean
services
Array of strings[^[a-fA-F0-9]+$]
permissions
Array of strings
Items Enum: "P_ADMIN_VIEW" "P_ADMIN_MANAGE" "P_ADMIN_BILLING" "P_ADMIN_STATS" "P_ACCOUNT_ADMIN" "P_ACCOUNT_VIEW" "P_ACCOUNT_MANAGE" "P_BILLING_VIEW" "P_BILLING_MANAGE" "P_USER_PROFILE_VIEW" "P_USER_PROFILE_MANAGE" "P_USER_VIEW" "P_USER_MANAGE" "P_USER_GRANT_ALL" "P_SAML_VIEW" "P_SAML_MANAGE" "P_SERVICE_ALL" "P_SERVICE_PURGE" "P_SERVICE_VIEW" "P_SERVICE_MANAGE" "P_ORIGIN_VIEW" "P_ORIGIN_MANAGE" "P_CERTIFICATE_VIEW" "P_CERTIFICATE_MANAGE" "P_API_TOKENS_VIEW" "P_API_TOKENS_MANAGE" "P_STATS_VIEW" "P_STATS_MANAGE" "P_OBJECT_STORAGE_VIEW" "P_OBJECT_STORAGE_MANAGE" "P_LOG_TARGET_VIEW" "P_LOG_TARGET_MANAGE" "P_SCRIPT_CONFIG_VIEW" "P_SCRIPT_CONFIG_MANAGE"

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "hideSecrets": true,
  • "services": [
    ],
  • "permissions": [
    ]
}

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "name": "string",
  • "services": [
    ],
  • "lastUsed": "2019-08-24T14:15:22Z",
  • "permissions": [
    ]
}

Get Token By Id

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "name": "string",
  • "services": [
    ],
  • "lastUsed": "2019-08-24T14:15:22Z",
  • "permissions": [
    ]
}

Update Token By Id

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Request Body schema: application/json
name
string
hideSecrets
boolean
services
Array of strings[^[a-fA-F0-9]+$]
permissions
Array of strings
Items Enum: "P_ADMIN_VIEW" "P_ADMIN_MANAGE" "P_ADMIN_BILLING" "P_ADMIN_STATS" "P_ACCOUNT_ADMIN" "P_ACCOUNT_VIEW" "P_ACCOUNT_MANAGE" "P_BILLING_VIEW" "P_BILLING_MANAGE" "P_USER_PROFILE_VIEW" "P_USER_PROFILE_MANAGE" "P_USER_VIEW" "P_USER_MANAGE" "P_USER_GRANT_ALL" "P_SAML_VIEW" "P_SAML_MANAGE" "P_SERVICE_ALL" "P_SERVICE_PURGE" "P_SERVICE_VIEW" "P_SERVICE_MANAGE" "P_ORIGIN_VIEW" "P_ORIGIN_MANAGE" "P_CERTIFICATE_VIEW" "P_CERTIFICATE_MANAGE" "P_API_TOKENS_VIEW" "P_API_TOKENS_MANAGE" "P_STATS_VIEW" "P_STATS_MANAGE" "P_OBJECT_STORAGE_VIEW" "P_OBJECT_STORAGE_MANAGE" "P_LOG_TARGET_VIEW" "P_LOG_TARGET_MANAGE" "P_SCRIPT_CONFIG_VIEW" "P_SCRIPT_CONFIG_MANAGE"

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "hideSecrets": true,
  • "services": [
    ],
  • "permissions": [
    ]
}

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "name": "string",
  • "services": [
    ],
  • "lastUsed": "2019-08-24T14:15:22Z",
  • "permissions": [
    ]
}

Delete Token By Id

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "name": "string",
  • "services": [
    ],
  • "lastUsed": "2019-08-24T14:15:22Z",
  • "permissions": [
    ]
}

List Of Allowed Permissions For Token

List of permissions that currently logged in user (or token) can assign to token with given id.

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{
  • "permissions": [
    ]
}

Login

Logging in is intended to be used only when the user is present and actively interacting with the application. Logging in issues a new temporary API token which shares the same permission set as the authenticated user. The token should be discarded when the interactive session ends.

As the token is temporary it has an expiry date which is enforced by the API. The validity time for the token is typically one hour, but may be shorter. If needed the token can be renewed by exchanging it for a new temporary token.

See API Tokens for tokens which are to be used when the user is not present.

Login With Username/Password

Request Body schema: application/json
username
required
string
password
required
string
string or object

Responses

Request samples

Content type
application/json
{
  • "username": "string",
  • "password": "string",
  • "otp": "string"
}

Response samples

Content type
application/json
{
  • "expiresAt": "2019-08-24T14:15:22Z",
  • "token": "string"
}

Renew current token

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "expiresAt": "2019-08-24T14:15:22Z",
  • "token": "string"
}

Account Recovery

The Account Recovery endpoints allows a user to recover access to their account when they have forgotten their authentication credentials.

Send Password Reset Email

If valid loginName (email or username) is provided an email with account recovery code will be sent.

Request Body schema: application/json
required
string or string

Responses

Request samples

Content type
application/json
{
  • "loginName": "user@example.com"
}

Response samples

Content type
application/json
{
  • "hash": "string"
}

Verify Email To Reset Password

To verify your email address and proceed with account recovery a hash string from previous step is required as well as recovery code from email sent to user address.

Request Body schema: application/json
hash
required
string = 40 characters ^[a-fA-F0-9]+$
code
required
string = 6 characters ^[a-fA-F0-9]+$

Responses

Request samples

Content type
application/json
{
  • "hash": "stringstringstringstringstringstringstri",
  • "code": "string"
}

Response samples

Content type
application/json
{
  • "token": "string",
  • "users": [
    ]
}

Reset User Password

Request Body schema: application/json
user
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

password
required
string >= 8 characters
token
required
string

Responses

Request samples

Content type
application/json
{
  • "user": "stringstringstringstring",
  • "password": "stringst",
  • "token": "string"
}

Response samples

Content type
application/json
{
  • "message": "string"
}

Accounts

A CacheFly account is a representation of the entity who will be invoiced for provided services. All other API objects are contained within an account either directly or indirectly.

It is expected that most companies will need only one account. The concept of sub accounts found in the older version 1 API has been directly replaced by the concept of services. Opening multiple accounts is only required to separate invoicing concerns.

Get Current Account

A shortcut endpoint to update account for currently logged in user

Authorizations:
BearerAuth
query Parameters
responseType
string
Default: "shallow"
Enum: "ids" "shallow" "selected" "full"

Responses

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "companyName": "string",
  • "website": "string",
  • "address1": "string",
  • "address2": "string",
  • "city": "string",
  • "country": "string",
  • "state": "string",
  • "phone": "string",
  • "zip": "string",
  • "twoFactorAuthEnabled": true,
  • "twoFactorAuthGracePeriod": 0,
  • "users": [
    ],
  • "services": [
    ],
  • "origins": [
    ],
  • "certificates": [
    ]
}

Update Current Account

A shortcut endpoint to update account for currently logged in user

Authorizations:
BearerAuth
Request Body schema: application/json
companyName
string
string or string
address1
string
address2
string
city
string
country
string
state
string
phone
string
zip
string
twoFactorAuthGracePeriod
integer [ 1 .. 30 ]
samlRequired
boolean
defaultDeliveryRegion
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Request samples

Content type
application/json
{
  • "companyName": "string",
  • "website": "http://example.com",
  • "address1": "string",
  • "address2": "string",
  • "city": "string",
  • "country": "string",
  • "state": "string",
  • "phone": "string",
  • "zip": "string",
  • "twoFactorAuthGracePeriod": 1,
  • "samlRequired": true,
  • "defaultDeliveryRegion": "stringstringstringstring"
}

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "companyName": "string",
  • "website": "string",
  • "address1": "string",
  • "address2": "string",
  • "city": "string",
  • "country": "string",
  • "state": "string",
  • "phone": "string",
  • "zip": "string",
  • "twoFactorAuthEnabled": true,
  • "twoFactorAuthGracePeriod": 0,
  • "users": [
    ],
  • "services": [
    ],
  • "origins": [
    ],
  • "certificates": [
    ]
}

Enable 2FA For Current Account

Two factor authentication will be enabled for the account of the current logged in user

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "companyName": "string",
  • "website": "string",
  • "address1": "string",
  • "address2": "string",
  • "city": "string",
  • "country": "string",
  • "state": "string",
  • "phone": "string",
  • "zip": "string",
  • "twoFactorAuthEnabled": true,
  • "twoFactorAuthGracePeriod": 0,
  • "users": [
    ],
  • "services": [
    ],
  • "origins": [
    ],
  • "certificates": [
    ]
}

Disable 2FA For Current Account

Two factor authentication will be disabled for the account of the current logged in user

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "companyName": "string",
  • "website": "string",
  • "address1": "string",
  • "address2": "string",
  • "city": "string",
  • "country": "string",
  • "state": "string",
  • "phone": "string",
  • "zip": "string",
  • "twoFactorAuthEnabled": true,
  • "twoFactorAuthGracePeriod": 0,
  • "users": [
    ],
  • "services": [
    ],
  • "origins": [
    ],
  • "certificates": [
    ]
}

List Accounts

List accounts available to logged in user

Authorizations:
BearerAuth
query Parameters
isChild
boolean

Filter by child accounts

isParent
boolean

Filter by parent accounts

status
string
Enum: "ACTIVE" "DEACTIVATED"
offset
integer >= 0
Default: 0

Number of results to skip

limit
integer [ 0 .. 1000 ]
Default: 10

Max number of results per page

responseType
string
Default: "shallow"
Enum: "ids" "shallow" "selected" "full"

Responses

Response samples

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

Create A New Child Account

Create a new child account under the parent account, only available for parent accounts.

Authorizations:
BearerAuth
Request Body schema: application/json
companyName
required
string
username
required
string [ 8 .. 32 ] characters ^(?!d+$)[a-z0-9]+(-[a-z0-9]+)*
password
required
string >= 8 characters
fullName
required
string >= 2 characters
email
required
string <email>
string or string
address1
string
address2
string
city
string
country
string
state
string
phone
string
zip
string

Responses

Request samples

Content type
application/json
{
  • "companyName": "string",
  • "username": "stringst",
  • "password": "stringst",
  • "fullName": "string",
  • "email": "user@example.com",
  • "website": "http://example.com",
  • "address1": "string",
  • "address2": "string",
  • "city": "string",
  • "country": "string",
  • "state": "string",
  • "phone": "string",
  • "zip": "string"
}

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "companyName": "string",
  • "website": "string",
  • "address1": "string",
  • "address2": "string",
  • "city": "string",
  • "country": "string",
  • "state": "string",
  • "phone": "string",
  • "zip": "string",
  • "twoFactorAuthEnabled": true,
  • "twoFactorAuthGracePeriod": 0,
  • "users": [
    ],
  • "services": [
    ],
  • "origins": [
    ],
  • "certificates": [
    ]
}

Get Account By Id

Fetch account by id

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

query Parameters
responseType
string
Default: "shallow"
Enum: "ids" "shallow" "selected" "full"

Responses

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "companyName": "string",
  • "website": "string",
  • "address1": "string",
  • "address2": "string",
  • "city": "string",
  • "country": "string",
  • "state": "string",
  • "phone": "string",
  • "zip": "string",
  • "twoFactorAuthEnabled": true,
  • "twoFactorAuthGracePeriod": 0,
  • "users": [
    ],
  • "services": [
    ],
  • "origins": [
    ],
  • "certificates": [
    ]
}

Update Account By Id

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Request Body schema: application/json
companyName
string
string or string
address1
string
address2
string
city
string
country
string
state
string
phone
string
zip
string
twoFactorAuthGracePeriod
integer [ 1 .. 30 ]
samlRequired
boolean
defaultDeliveryRegion
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Request samples

Content type
application/json
{
  • "companyName": "string",
  • "website": "http://example.com",
  • "address1": "string",
  • "address2": "string",
  • "city": "string",
  • "country": "string",
  • "state": "string",
  • "phone": "string",
  • "zip": "string",
  • "twoFactorAuthGracePeriod": 1,
  • "samlRequired": true,
  • "defaultDeliveryRegion": "stringstringstringstring"
}

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "companyName": "string",
  • "website": "string",
  • "address1": "string",
  • "address2": "string",
  • "city": "string",
  • "country": "string",
  • "state": "string",
  • "phone": "string",
  • "zip": "string",
  • "twoFactorAuthEnabled": true,
  • "twoFactorAuthGracePeriod": 0,
  • "users": [
    ],
  • "services": [
    ],
  • "origins": [
    ],
  • "certificates": [
    ]
}

Activate Account By Id

Activate an account by id, only available for parent accounts.

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "companyName": "string",
  • "website": "string",
  • "address1": "string",
  • "address2": "string",
  • "city": "string",
  • "country": "string",
  • "state": "string",
  • "phone": "string",
  • "zip": "string",
  • "twoFactorAuthEnabled": true,
  • "twoFactorAuthGracePeriod": 0,
  • "users": [
    ],
  • "services": [
    ],
  • "origins": [
    ],
  • "certificates": [
    ]
}

Deactivate Account By Id

Deactivate an account by id, only available for parent accounts.

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "companyName": "string",
  • "website": "string",
  • "address1": "string",
  • "address2": "string",
  • "city": "string",
  • "country": "string",
  • "state": "string",
  • "phone": "string",
  • "zip": "string",
  • "twoFactorAuthEnabled": true,
  • "twoFactorAuthGracePeriod": 0,
  • "users": [
    ],
  • "services": [
    ],
  • "origins": [
    ],
  • "certificates": [
    ]
}

Get Child Account Auth Token

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{
  • "expiresAt": "2019-08-24T14:15:22Z",
  • "token": "string"
}

Services

Accounts may contain multiple services which can be organised and configured according to your own needs. Each service provides an aggregation point for configuration, logging, statistics, etc.

It is reasonable to think of a service as being similar to the virtual host concept from a typical web server configuration.

When applying changes to a service there may, or may not, be a propagation delay. This is to ensure that a high frequency of changes by a small number of users does not negatively impact the performance of the network as a whole. As such, although we endeavour to make this as fast as possible, and immediate in most cases, the only guarantee is that it will occur eventually.

Service configurationMode enumeration that defines which type of configuration is going to be applied, it can be changed on upon request per service. Following configuration modes are available:

  • API_OPTIONS - Simple set of configuration parameters, more details are available in Service Options section.
  • API_RULES - Service rules offer more advanced configuration, more details are available in Service Rules section.
  • API_RULES_AND_OPTIONS - Use service rules as main configuration set and service options as fallback.
  • MANUAL - Custom configuration available upon request.

Note that in failure scenarios we will continue to serve traffic using the last working configuration.

List Services

Authorizations:
BearerAuth
query Parameters
responseType
string
Default: "shallow"
Enum: "ids" "shallow" "selected" "full"
includeFeatures
boolean
Default: false
status
string
Enum: "ACTIVE" "DEACTIVATED"
search
string >= 2 characters
string or Array of strings
offset
integer >= 0
Default: 0

Number of results to skip

limit
integer [ 0 .. 1000 ]
Default: 1000

Max number of results per page

Responses

Response samples

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

Create Service

Authorizations:
BearerAuth
Request Body schema: application/json
name
required
string [ 1 .. 32 ] characters
uniqueName
required
string [ 3 .. 32 ] characters ^[a-zA-Z0-9]+$
description
string

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "uniqueName": "string",
  • "description": "string"
}

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "name": "string",
  • "uniqueName": "string",
  • "autoSsl": true,
  • "configurationMode": "MANUAL",
  • "status": "ACTIVE"
}

Get Service By Id

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

query Parameters
responseType
string
Default: "shallow"
Enum: "ids" "shallow" "selected" "full"
includeFeatures
boolean
Default: false

Responses

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "name": "string",
  • "uniqueName": "string",
  • "autoSsl": true,
  • "configurationMode": "MANUAL",
  • "status": "ACTIVE"
}

Update Service By Id

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Request Body schema: application/json
description
string
tlsProfile
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

autoSsl
boolean
deliveryRegion
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Request samples

Content type
application/json
{
  • "description": "string",
  • "tlsProfile": "stringstringstringstring",
  • "autoSsl": true,
  • "deliveryRegion": "stringstringstringstring"
}

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "name": "string",
  • "uniqueName": "string",
  • "autoSsl": true,
  • "configurationMode": "MANUAL",
  • "status": "ACTIVE"
}

Activate Service By Id

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "name": "string",
  • "uniqueName": "string",
  • "autoSsl": true,
  • "configurationMode": "MANUAL",
  • "status": "ACTIVE"
}

Deactivate Service By Id

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "name": "string",
  • "uniqueName": "string",
  • "autoSsl": true,
  • "configurationMode": "MANUAL",
  • "status": "ACTIVE"
}

Enable Access Logging

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Request Body schema: application/json
logTarget
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Request samples

Content type
application/json
{
  • "logTarget": "stringstringstringstring"
}

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "name": "string",
  • "uniqueName": "string",
  • "autoSsl": true,
  • "configurationMode": "MANUAL",
  • "status": "ACTIVE"
}

Disable Access Logging

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "name": "string",
  • "uniqueName": "string",
  • "autoSsl": true,
  • "configurationMode": "MANUAL",
  • "status": "ACTIVE"
}

Enable Origin Logging

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Request Body schema: application/json
logTarget
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Request samples

Content type
application/json
{
  • "logTarget": "stringstringstringstring"
}

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "name": "string",
  • "uniqueName": "string",
  • "autoSsl": true,
  • "configurationMode": "MANUAL",
  • "status": "ACTIVE"
}

Disable Origin Logging

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "name": "string",
  • "uniqueName": "string",
  • "autoSsl": true,
  • "configurationMode": "MANUAL",
  • "status": "ACTIVE"
}

Service Domains

Each service has a set of domains. Depending on available features, one or more defaults will be added to the service when it is created, including <uniqueName>.cachefly.net.

Adding a domain to a service will configure the CacheFly edge servers to route all traffic received for that name through the configuration for that service. Each domain name must be a fully qualified hostname. If you wish to serve traffic for both www.example.com and example.com then you will need to add both names.

Once created domains are automatically related to TLS certificates if there are any that matches the name. You do not need to maintain the relationship between domains and certificates.

Please note that the propagation delay mentioned in the description of a service also applies to service domains.

Configuring DNS

You should configure the DNS for your custom domains to alias one of the default service domain names that you are given.

A time to live (TTL) of 86400 seconds (24 hours) is recommended to gain a performance advantage from shared DNS caching. Note that setting your TTL lower than 2400 seconds (1 hour) is suboptimal for performance.

DNS Example:

www.example.com.    IN    86400    CNAME    <uniqueName>.cachefly.net

You should never place a CacheFly IP address in your DNS configuration as that prevents us from applying early geographic performance optimisations, and may prevent us from ensuring continued uptime during maintenance or unscheduled outages.

If you are unable to use a CNAME, you should look into using provider specific equivalents (e.g. ANAME, ALIAS, RECORD LINKING, etc).

List Service Domains

Authorizations:
BearerAuth
path Parameters
sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

query Parameters
search
string >= 2 characters
offset
integer >= 0
Default: 0

Number of results to skip

limit
integer [ 0 .. 1000 ]
Default: 10

Max number of results per page

responseType
string
Default: "shallow"
Enum: "ids" "shallow" "selected" "full"

Responses

Response samples

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

Create Service Domain

Authorizations:
BearerAuth
path Parameters
sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Request Body schema: application/json
name
required
string^(\*\.)?([\w\d-]+\.)+[\w\d]+$
description
string
validationMode
string
Default: "NONE"
Enum: "NONE" "MANUAL" "HTTP" "DNS" "EMAIL"

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "validationMode": "NONE"
}

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "name": "example.com",
  • "description": "string",
  • "service": "stringstringstringstring",
  • "certificates": [
    ],
  • "validationMode": "NONE",
  • "validationTarget": "string",
  • "validationStatus": "string"
}

Get Service Domain By Id

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

query Parameters
responseType
string
Default: "shallow"
Enum: "ids" "shallow" "selected" "full"

Responses

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "name": "example.com",
  • "description": "string",
  • "service": "stringstringstringstring",
  • "certificates": [
    ],
  • "validationMode": "NONE",
  • "validationTarget": "string",
  • "validationStatus": "string"
}

Update Service Domain By Id

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Request Body schema: application/json
name
string^(\*\.)?([\w\d-]+\.)+[\w\d]+$
description
string
validationMode
string
Enum: "NONE" "DNS" "HTTP"

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "validationMode": "NONE"
}

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "name": "example.com",
  • "description": "string",
  • "service": "stringstringstringstring",
  • "certificates": [
    ],
  • "validationMode": "NONE",
  • "validationTarget": "string",
  • "validationStatus": "string"
}

Delete Service Domain By Id

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "name": "example.com",
  • "description": "string",
  • "service": "stringstringstringstring",
  • "certificates": [
    ],
  • "validationMode": "NONE",
  • "validationTarget": "string",
  • "validationStatus": "string"
}

Service Rules (beta)

Each service has a set of rules. Rules define how the service should behave when serving traffic.

Please note that the propagation delay mentioned in the description of a service also applies to service rules.

How rules work

Each service contains a list of rules. Each rule contains a list of conditions and a list of actions.

When handling a request for one of the configured service domains each rule is considered in order. If all of the conditions for that rule are true, then the actions on that rule are performed. If they are not true then the next rule in the list is considered.

Incomplete example (YAML format):

---
- conditions: []    # Rule 1
  actions: []
- conditions: []    # Rule 2
  actions: []

By convention the list of rules is written in YAML format when it is presented for humans to read, and in JSON format for machines/software to read. For comparison here is the above example in JSON format.

Incomplete example (JSON format):

[
  { "conditions": [], "actions": [] },
  { "conditions": [], "actions": [] }
]

Branches

Special attention should be given to the BRANCH action which contains within itself a rules list. When the conditions guarding this action are true processing moves into the rules list that it contains. This allows for the configuration of a rules in a tree like structure.

Example (YAML format):

---
- conditions: []           # Rule 1
  actions:
  - type: BRANCH
    terminal: false
    rules:
      - conditions: []     # Nested Rule 1.1
        actions: []
      - conditions: []     # Nested Rule 1.2
        actions: []
- conditions: []           # Rule 2
  actions: []

By convention the list of rules is written in YAML format when it is presented for humans to read, and in JSON format for machines/software to read. For comparison here is the above example in JSON format.

Incomplete example (JSON format):

[
  { "conditions": [], "actions": [] },
  {
    "type": "BRANCH",
    "terminal": false,
    "rules": [
      { "conditions": [], "actions": [] },
      { "conditions": [], "actions": [] }
    ]
  },
  { "conditions": [], "actions": [] }
]

Conditions

Conditions allow you to specify when a list of actions should be taken, or not. Please refer to the list service rules examples for a definition of the properties available for each condition.

type description
SCHEME Distinguish between HTTPS (secure) and HTTP (insecure)
HOST Compare with the HTTP Host header
PATH Compare with the HTTP request path
QUERY Compare with a HTTP query parameter

Many more conditions are planned for addition during and after beta.

Actions

Actions describe what is possible to do when a list of conditions is met. Please refer to the list service rules examples for a definition of the properties available for each action.

type description terminal
CACHED_REVERSE_PROXY Serve content from cache or origin ✓ true
DIRECT_REVERSE_PROXY Proxy directly to origin (i.e. websockets, file uploads, etc.) ✓ true
BRANCH Process a nested set of rules (see above) ✗ false
SET_HEADER Set the value of a HTTP header ✗ false
DELETE_HEADER Remove a HTTP header ✗ false
SET_QUERY Set the value of a HTTP query parameter ✗ false
DELETE_QUERY Remove a HTTP query parameter ✗ false
CORS Add standard CORS headers ✗ false

Many more actions are planned for addition during and after beta.

The following actions are reserved for internal use only, they may be visible to you in a rules list if added by the CacheFly engineering team.

type description terminal
FALLBACK Route to version 1 backend ✓ true

Restrictions

During beta, restrictions may change prior to those changes being documented. Please pay attention to the text of the API error messages.

Service rules are flexible by design. This has resulted in the possibility of combinations of configurations which are illogical or impractical. As such the API applies restrictions to the rules list to reduce the changes of it being rejected by the backend systems. You should always endeavour to comply with these restrictions when generating a rules list.

  • The actions list on a rule must not be empty.
  • The rules list on a BRANCH action must not be empty.
  • No action may follow an action which has the terminal property.
  • Must not mix multiple PATH condition modes in a single rule.
  • The PATH condition mode EXACT prohibits any other PATH condition within any nested rule.
  • The PATH condition mode REGEX requires that any other PATH condition within any nested rule is of the same mode.
  • The PATH condition mode PREFIX requires that any other PATH condition within any nested rule starts with its prefix value.

For clarity conditions list on a rule is permitted to be empty.

List Service Rules

Authorizations:
BearerAuth
path Parameters
sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

query Parameters
responseFormat
string
Default: "json"
Enum: "json" "yaml"

Responses

Response samples

Content type
application/json
{
  • "rules": [
    ]
}

Update Service Rules

NOTICE Body validation JSON schema for this endpoint is dynamically generated according to available plugins for the account, it can be fetched for every services via /service/{sid}/rules/schema.

Authorizations:
BearerAuth
path Parameters
sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{
  • "rules": [
    ]
}

Fetch Service Rules JSON Schema

Authorizations:
BearerAuth
path Parameters
sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{ }

Service Options

Service options represents a simple way to configure a service comparing to service rules. Service options are available if the service configurationMode enumeration is set to API_OPTIONS or API_RULES_AND_OPTIONS, which can be enabled on request per service or as default configuration for an account.

Get Basic Service Options

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{
  • "cors": true,
  • "autoRedirect": true,
  • "reverseProxy": {
    },
  • "mimeTypesOverrides": [
    ],
  • "expiryHeaders": [
    ],
  • "apiKeyEnabled": true,
  • "protectServeKeyEnabled": true
}

Save Basic Service Options

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Request Body schema: application/json
object or object or object
object or object
cors
boolean
autoRedirect
boolean

Enable Auto Redirect HTTP to HTTPS.

Array of objects
Array of objects or objects
property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "reverseProxy": {
    },
  • "rawLogs": {
    },
  • "cors": true,
  • "autoRedirect": true,
  • "mimeTypesOverrides": [
    ],
  • "expiryHeaders": [
    ]
}

Response samples

Content type
application/json
{
  • "cors": true,
  • "autoRedirect": true,
  • "reverseProxy": {
    },
  • "mimeTypesOverrides": [
    ],
  • "expiryHeaders": [
    ],
  • "apiKeyEnabled": true,
  • "protectServeKeyEnabled": true
}

Get Service Legacy Apikey

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{
  • "apiKey": "string"
}

Re-generate Service Legacy Apikey

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{
  • "apiKey": "string"
}

Delete Service Legacy Apikey

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "name": "string",
  • "uniqueName": "string",
  • "autoSsl": true,
  • "configurationMode": "MANUAL",
  • "status": "ACTIVE"
}

Get Service ProtectServe Key

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

query Parameters
hideSecrets
boolean
Default: false

Responses

Response samples

Content type
application/json
{
  • "protectServeKey": "string",
  • "forceProtectserve": "OPTIONAL"
}

Recreate Service ProtectServe Key

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

query Parameters
action
string
Default: "REGENERATE"
Enum: "REGENERATE" "REVERT"

Responses

Response samples

Content type
application/json
{
  • "protectServeKey": "string",
  • "forceProtectserve": "OPTIONAL"
}

Update Service ProtectServe Key Options

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Request Body schema: application/json
forceProtectServe
string
Enum: "OPTIONAL" "REQUIRED" "MANDATORY" "DISABLED"
protectServeKey
string [ 1 .. 32 ] characters ^[A-Za-z0-9+/=]+$

Responses

Request samples

Content type
application/json
{
  • "forceProtectServe": "OPTIONAL",
  • "protectServeKey": "string"
}

Response samples

Content type
application/json
{
  • "protectServeKey": "string",
  • "forceProtectserve": "OPTIONAL"
}

Delete Service ProtectServe Key

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{
  • "message": "string"
}

Get Ftp Settings

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

query Parameters
hideSecrets
boolean
Default: false

Responses

Response samples

Content type
application/json
{
  • "ftpPassword": "string"
}

Regenerate Ftp Password

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

query Parameters
hideSecrets
boolean
Default: false

Responses

Response samples

Content type
application/json
{
  • "ftpPassword": "string"
}

Service Options - Referer Rules

List Service Referer Rules

Authorizations:
BearerAuth
path Parameters
sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

query Parameters
offset
integer >= 0
Default: 0

Number of results to skip

limit
integer [ 0 .. 1000 ]
Default: 10

Max number of results per page

Responses

Response samples

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

Create Service Referer Rules

Authorizations:
BearerAuth
path Parameters
sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Request Body schema: application/json
directory
required
string non-empty ^/[^*]*$

Match Directory

"" (string) or string
Array of strings or "none" (string) or "nohttp" (string)

Exceptions

defaultAction
required
string
Enum: "ALLOW" "DENY"

Default Action

Responses

Request samples

Content type
application/json
{
  • "directory": "string",
  • "extension": "",
  • "exceptions": [
    ],
  • "defaultAction": "ALLOW"
}

Response samples

Content type
application/json
null

Get Service Referer Rules By Id

Authorizations:
BearerAuth
path Parameters
id
required
string <uuid>

Service Options Referer Rule Id

sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
null

Update Service Referer Rules By Id

Authorizations:
BearerAuth
path Parameters
id
required
string <uuid>

Service Options Referer Rule Id

sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Request Body schema: application/json
directory
string non-empty ^/[^*]*$

Match Directory

"" (string) or string
Array of strings or "none" (string) or "nohttp" (string)

Exceptions

defaultAction
string
Enum: "ALLOW" "DENY"

Default Action

order
number

New order value

Responses

Request samples

Content type
application/json
{
  • "directory": "string",
  • "extension": "",
  • "exceptions": [
    ],
  • "defaultAction": "ALLOW",
  • "order": 0
}

Response samples

Content type
application/json
null

Delete Service Referer Rules By Id

Authorizations:
BearerAuth
path Parameters
id
required
string <uuid>

Service Options Referer Rule Id

sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
null

Service Options - FTP children

List Service FTP Children

Authorizations:
BearerAuth
path Parameters
sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

query Parameters
offset
integer >= 0
Default: 0

Number of results to skip

limit
integer [ 0 .. 1000 ]
Default: 10

Max number of results per page

Responses

Response samples

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

Create Service FTP Child

Authorizations:
BearerAuth
path Parameters
sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Request Body schema: application/json
root
required
string

Root path for ftp child

username
required
string [ 8 .. 16 ] characters

Username for ftp child

password
required
string [ 8 .. 32 ] characters

Password for ftp child

Responses

Request samples

Content type
application/json
{
  • "root": "string",
  • "username": "stringst",
  • "password": "stringst"
}

Response samples

Content type
application/json
null

Get Service FTP Child By Id

Authorizations:
BearerAuth
path Parameters
id
required
number

Service Options Ftp Children Id

sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
null

Update Service FTP Child By Id

Authorizations:
BearerAuth
path Parameters
id
required
number

Service Options Ftp Children Id

sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Request Body schema: application/json
root
string

Root path for ftp child

username
string [ 8 .. 16 ] characters

Username for ftp child

password
string [ 8 .. 32 ] characters

Password for ftp child

status
string
Enum: "ACTIVE" "DEACTIVATED"

Status for ftp child

Responses

Request samples

Content type
application/json
{
  • "root": "string",
  • "username": "stringst",
  • "password": "stringst",
  • "status": "ACTIVE"
}

Response samples

Content type
application/json
null

Delete Service FTP Child By Id

Authorizations:
BearerAuth
path Parameters
id
required
number

Service Options Ftp Children Id

sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
null

Service Purge

For objects which have been cached by a reverse proxy configuration, purge allows you to invalidate the cache and instructs the us to attempt to fetch an updated copy of the object from the origin. The fetch will occur the next time that the object is requested. Please note that if the origin is unavailable an error is served (not stale/invalidated objects).

You can specify a list of paths which are to be purged. These can be complete paths (e.g. /images/backgrounds/sky.jpg), or they can be the path to a directory (e.g. /images/backgrounds/). Directory paths must end with a forward slash. When a directory is specified all objects within that directory are purged.

Alternatively you can request that all of the objects cached for a service are purged. If you have a large number of objects you should avoid purging all of the objects in one go like this, as it may overload your origin.

When purging a list of paths, the paths field is required and the all field should be absent (or set to false).

When purging all objects, the all field must be set to true and the paths field should be absent. Please note that the all field overrides the paths field, so setting it to true will always purge all objects regardless of what is placed in the paths field.

Purge

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{
  • "message": "string"
}

Service Image Optimization

CacheFly Smart Image Optimization allows you to transform and optimize your images on the fly. You must configure the optimization with details of image transformations that you want to be performed. These endpoints allow you to manage that image optimization configuration.

Format

You may choose to use either YAML or JSON for your image optimization configuration. As we expect the majority of edits to be done by hand, we use YAML by default. If you are automating the configuration you may wish to choose to use JSON instead.

Details

The specific details of the configuration are detailed in the dedicated CacheFly Smart Image Optimization documenation.

Fetch Configuration

The image optimization configuration for this service is returned when calling this API endpoint. If there is no configuration a 404 status is returned and you may use create configuration to make a new one.

The Content-Type header in the response details which format you are receiving. This endpoint may return either YAML or JSON, depending on the format in which the configuration is stored. See the details endpoint for a list of the valid MIME types.

Authorizations:
BearerAuth
path Parameters
sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
"string"

Create Configuration

When no image optimization configuration exists for this service you may create a new one by using this endpoint. If a configuration already exists a 400 status is returned.

You may choose the format for your configuration. The Content-Type header must be set correctly in your request. See the details endpoint for a list of the valid MIME types.

Your configuration will be checked to see if it is valid before it is saved. Invalid configurations will be rejected. See the validation schema endpoint for more details.

Note that if you just wish to view the default configuration you can fetch that without first creating a new configuration.

Authorizations:
BearerAuth
path Parameters
sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Request Body schema: application/json
Any of
object

It is possible to choose between YAML and JSON format, please check CacheFly Smart Image Optimization documentation for more details on configuration formats and parameters.

Responses

Request samples

Content type
application/json
"string"

Response samples

Content type
application/json
"string"

Update Configuration

After an image optimization configuration exists for this service you may update it using this endpoint. If there is no configuration a 404 status is returned and you may use create configuration to make a new one.

You may choose the format for your configuration, and it may be different from the format in which it is currently saved. The Content-Type header must be set correctly in your request. See the details endpoint for a list of the valid MIME types.

Authorizations:
BearerAuth
path Parameters
sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Request Body schema: application/json
Any of
object

It is possible to choose between YAML and JSON format, please check CacheFly Smart Image Optimization documentation for more details on configuration formats and parameters.

Responses

Request samples

Content type
application/json
"string"

Response samples

Content type
application/json
"string"

Fetch Default Configuration

The default configuration can be fetched from this endpoint. This always returns the latest version of the default which may change infrequently (i.e. as new features are added).

The default configuration is in the YAML format, as this allows us to include helpful comments.

Authorizations:
BearerAuth
path Parameters
sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
"string"

Fetch Validation Schema

All configurations are checked for validity before being saved and processed. This is done using a schema written in the JSON Schema format.

This endpoint returns the latest version of the schema being used for validation. You may use this schema to check for mistakes or problems in your configuration before attempting to upload it.

If you are automating the generation of your configuration we highly recommend including a validation step in your own software.

The schema will change infrequently (i.e. as new features are added). If using a locally cached copy, you should ensure that check for an updated version every so often.

Authorizations:
BearerAuth
path Parameters
sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{ }

Fetch Configuration Details

Various metadata about the image optimisation configuration can be obtained from this endpoint.

Note that the helpText and docsLink fields are exist so that tooling can point end users towards the help they need when editing the configuration.

Authorizations:
BearerAuth
path Parameters
sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{
  • "_id": "stringstringstringstring",
  • "name": "string",
  • "readOnly": true,
  • "status": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "mimeType": [
    ],
  • "defaultMimeType": "string",
  • "docsLink": "string",
  • "helpText": "string"
}

Activate

The image optimization configuration is only used when active. This endpoint switches the configuration into the active status and enables the system to start performing image transformations.

Authorizations:
BearerAuth
path Parameters
sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{
  • "_id": "stringstringstringstring",
  • "name": "string",
  • "readOnly": true,
  • "status": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z"
}

Deactivate

The image optimization configuration is only used when active. This endpoint essentially disables the configuration and prevents any transformations from being executed.

Authorizations:
BearerAuth
path Parameters
sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{
  • "_id": "stringstringstringstring",
  • "name": "string",
  • "readOnly": true,
  • "status": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z"
}

Certificates

TLS / SSL Certificates are stored within an account, and are not specific to an any one service. Certificates will be automatically configured to any/all relevant services from the same account, based on service domains.

Certificates managed by the user can be uploaded and deleted. Certificates managed by CacheFly can only be viewed. Please contact sales to purchase managed TLS certificates.

Uploaded keys are stored encrypted and are not available for retrieval and distribution outside of our internal network. If you need to retrieve your keys from us please contact our support team to discuss your requirements.

List All Certificates

Authorizations:
BearerAuth
query Parameters
responseType
string
Default: "shallow"
Enum: "ids" "shallow" "selected" "full"
search
string >= 2 characters
offset
integer >= 0
Default: 0

Number of results to skip

limit
integer [ 0 .. 1000 ]
Default: 10

Max number of results per page

Responses

Response samples

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

Create Certificate

Authorizations:
BearerAuth
Request Body schema: application/json
certificate
required
string non-empty
certificateKey
required
string non-empty
password
string

Responses

Request samples

Content type
application/json
{
  • "certificate": "string",
  • "certificateKey": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "_id": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "subjectCommonName": "string",
  • "subjectNames": [
    ],
  • "expired": true,
  • "expiring": true,
  • "inUse": true,
  • "managed": true,
  • "services": [
    ],
  • "domains": [
    ],
  • "notBefore": "2019-08-24T14:15:22Z",
  • "notAfter": "2019-08-24T14:15:22Z"
}

Get Certificate By Id

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

query Parameters
responseType
string
Default: "shallow"
Enum: "ids" "shallow" "selected" "full"

Responses

Response samples

Content type
application/json
{
  • "_id": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "subjectCommonName": "string",
  • "subjectNames": [
    ],
  • "expired": true,
  • "expiring": true,
  • "inUse": true,
  • "managed": true,
  • "services": [
    ],
  • "domains": [
    ],
  • "notBefore": "2019-08-24T14:15:22Z",
  • "notAfter": "2019-08-24T14:15:22Z"
}

Delete Certificate By Id

Deleting certificate will remove it from matching domains and services.

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{
  • "_id": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "subjectCommonName": "string",
  • "subjectNames": [
    ],
  • "expired": true,
  • "expiring": true,
  • "inUse": true,
  • "managed": true,
  • "services": [
    ],
  • "domains": [
    ],
  • "notBefore": "2019-08-24T14:15:22Z",
  • "notAfter": "2019-08-24T14:15:22Z"
}

Origins

Origin objects are the representation of origin of your content. Origins become associated to services via the use of rules which instruct the service to reverse proxy traffic to a specific origin.

Origins are typically either your own server, a cloud server, or a cloud storage solution. These can all be configured via this API by setting the appropriate hostname for the HTTP interface of the origin.

Other types of origins are also available on request, such as CacheFly provided storage solutions, or CacheFly managed edge application servers.

List All Account Origins

Authorizations:
BearerAuth
query Parameters
type
string
offset
integer >= 0
Default: 0

Number of results to skip

limit
integer [ 0 .. 1000 ]
Default: 10

Max number of results per page

responseType
string
Default: "shallow"
Enum: "ids" "shallow" "selected" "full"

Responses

Response samples

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

Create Origin

Authorizations:
BearerAuth
Request Body schema: application/json
Any of
type
required
string
Value: "WEB"
name
string
hostname
required
string <hostname> [.]
gzip
boolean
Default: false
cacheByQueryParam
boolean
Default: false
scheme
string
Default: "FOLLOW"
Enum: "HTTP" "HTTPS" "FOLLOW"
ttl
integer [ 1 .. 7776000 ]
Default: 2678400
missedTtl
integer [ 1 .. 7776000 ]
Default: 86400
connectionTimeout
integer [ 1 .. 15 ]
Default: 3
timeToFirstByteTimeout
integer [ 1 .. 15 ]
Default: 3

Responses

Request samples

Content type
application/json
{
  • "type": "S3_BUCKET",
  • "name": "string",
  • "scheme": "HTTP",
  • "host": "example.com",
  • "ttl": 2678400,
  • "missedTtl": 86400,
  • "connectionTimeout": 3,
  • "timeToFirstByteTimeout": 3,
  • "accessKey": "string",
  • "secretKey": "string",
  • "region": "string",
  • "signatureVersion": "v4"
}

Response samples

Content type
application/json
{
  • "type": "FAILOVER",
  • "name": "string",
  • "origins": [
    ]
}

Get Origin By Id

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

query Parameters
responseType
string
Default: "shallow"
Enum: "ids" "shallow" "selected" "full"

Responses

Response samples

Content type
application/json
{
  • "type": "FAILOVER",
  • "name": "string",
  • "origins": [
    ]
}

Update Origin By Id

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Request Body schema: application/json
Any of
type
string
Value: "WEB"
name
string
hostname
string <hostname> [.]
gzip
boolean
cacheByQueryParam
boolean
scheme
string
Enum: "HTTP" "HTTPS" "FOLLOW"
ttl
integer [ 1 .. 7776000 ]
missedTtl
integer [ 1 .. 2678400 ]
connectionTimeout
integer [ 1 .. 15 ]
timeToFirstByteTimeout
integer [ 1 .. 15 ]

Responses

Request samples

Content type
application/json
{
  • "type": "S3_BUCKET",
  • "name": "string",
  • "scheme": "HTTP",
  • "host": "example.com",
  • "ttl": 1,
  • "missedTtl": 1,
  • "connectionTimeout": 1,
  • "timeToFirstByteTimeout": 1,
  • "accessKey": "string",
  • "secretKey": "string",
  • "region": "string",
  • "signatureVersion": "v4"
}

Response samples

Content type
application/json
{
  • "type": "FAILOVER",
  • "name": "string",
  • "origins": [
    ]
}

Delete Origin By Id

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{
  • "type": "FAILOVER",
  • "name": "string",
  • "origins": [
    ]
}

Reports

Reports are a collection of entities which allow access to the statistical data collected by the CDN. Statistics are usually aggregated to the service level. You can easily see these endpoints in action by logging in to our statistics and reporting dashboard, which itself is a consumer of these endpoints.

name description
rps Real time requests rer second
chr Cache hit ratio statistics
hod Statistics aggregated by Hour Of Day
country Statistics aggregated by Country
pop Statistics aggregated by CacheFly geographical POP
file Statistics aggregated by HTTP path
referer Statistics aggregated by HTTP referer
refererTld Statistics aggregated by HTTP referer TLD
track95 Statistics summarised to 95th percentile

Generate spreadsheet for report

Generate spreadsheet for report

path Parameters
spreadsheetToken
required
string

Responses

Response samples

Content type
application/json
null

Get account reports for entity

Get account reports for entity

Authorizations:
BearerAuth
path Parameters
entity
required
string
Enum: "rps" "pop" "country" "hod" "file" "chr" "referer" "refererTld" "isp" "track95" "ftp"

Report Entity

query Parameters
string or string
string or string
string or string
sortBy
string^([-]?[a-zA-Z0-9]+,?s*)+$
Default: "thedate"
interval
string^[0-9]+[h|d|m|s]{1}$
offset
integer >= 0
Default: 0

Number of results to skip

limit
integer [ 0 .. 10000 ]
Default: 1000

Max number of results per page

Responses

Response samples

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

Get account reports export token for entity

Get account reports export token for entity

Authorizations:
BearerAuth
path Parameters
entity
required
any
query Parameters
string or string
string or string
string or Array of strings
string or Array of strings
interval
string^[0-9]+[h|d|m|s]{1}$
Default: "1d"
filename
string^[a-zA-Z0-9-_]+\.[a-zA-Z0-9]+$
Default: "report.csv"

Report Export Filename

Responses

Response samples

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

Get service reports for entity

Get service reports for entity

Authorizations:
BearerAuth
path Parameters
sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

entity
required
string
Enum: "rps" "pop" "country" "hod" "file" "chr" "referer" "refererTld" "isp" "track95" "ftp"

Report Entity

query Parameters
string or string
string or string
string or string
sortBy
string^([-]?[a-zA-Z0-9]+,?s*)+$
Default: "thedate"
interval
string^[0-9]+[h|d|m|s]{1}$
offset
integer >= 0
Default: 0

Number of results to skip

limit
integer [ 0 .. 10000 ]
Default: 1000

Max number of results per page

Responses

Response samples

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

Get service reports export token for entity

Get service reports export token for entity

Authorizations:
BearerAuth
path Parameters
sid
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

entity
required
any
query Parameters
string or string
string or string
string or Array of strings
string or Array of strings
interval
string^[0-9]+[h|d|m|s]{1}$
Default: "1d"
filename
string^[a-zA-Z0-9-_]+\.[a-zA-Z0-9]+$
Default: "report.csv"

Report Export Filename

Responses

Response samples

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

Users

User objects describe people who are permitted to login to an account. Each user as a set of permissions and a list of services. The user is unable to access any service which has not been assigned to them.

Get User (currently logged in user)

Fetch info about currently logged in user. This endpoint is only executable with tokens acquired via regular login.

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "username": "stringst",
  • "passwordChangeRequired": true,
  • "email": "user@example.com",
  • "fullName": "string",
  • "phone": "string",
  • "permissions": [
    ],
  • "services": [
    ],
  • "status": "ACTIVE"
}

Update User (currently logged in user)

Update info about currently logged in user. This endpoint is only executable with tokens acquired via regular login.

Authorizations:
BearerAuth
Request Body schema: application/json
password
string >= 8 characters
services
Array of strings[^[a-fA-F0-9]+$]
passwordChangeRequired
boolean
email
string <email>
fullName
string >= 2 characters
phone
string
walkthroughVisible
boolean
showDeactivatedServices
boolean

Responses

Request samples

Content type
application/json
{
  • "password": "stringst",
  • "services": [
    ],
  • "passwordChangeRequired": true,
  • "email": "user@example.com",
  • "fullName": "string",
  • "phone": "string",
  • "walkthroughVisible": true,
  • "showDeactivatedServices": true
}

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "username": "stringst",
  • "passwordChangeRequired": true,
  • "email": "user@example.com",
  • "fullName": "string",
  • "phone": "string",
  • "permissions": [
    ],
  • "services": [
    ],
  • "status": "ACTIVE"
}

List Users

Authorizations:
BearerAuth
query Parameters
search
string >= 2 characters
offset
integer >= 0
Default: 0

Number of results to skip

limit
integer [ 0 .. 1000 ]
Default: 10

Max number of results per page

Responses

Response samples

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

Create User

Authorizations:
BearerAuth
Request Body schema: application/json
password
required
string >= 8 characters
services
Array of strings[^[a-fA-F0-9]+$]
passwordChangeRequired
boolean
email
string <email>
fullName
string >= 2 characters
phone
string
permissions
Array of strings
Items Enum: "P_ADMIN_VIEW" "P_ADMIN_MANAGE" "P_ADMIN_BILLING" "P_ADMIN_STATS" "P_ACCOUNT_ADMIN" "P_ACCOUNT_VIEW" "P_ACCOUNT_MANAGE" "P_BILLING_VIEW" "P_BILLING_MANAGE" "P_USER_PROFILE_VIEW" "P_USER_PROFILE_MANAGE" "P_USER_VIEW" "P_USER_MANAGE" "P_USER_GRANT_ALL" "P_SAML_VIEW" "P_SAML_MANAGE" "P_SERVICE_ALL" "P_SERVICE_PURGE" "P_SERVICE_VIEW" "P_SERVICE_MANAGE" "P_ORIGIN_VIEW" "P_ORIGIN_MANAGE" "P_CERTIFICATE_VIEW" "P_CERTIFICATE_MANAGE" "P_API_TOKENS_VIEW" "P_API_TOKENS_MANAGE" "P_STATS_VIEW" "P_STATS_MANAGE" "P_OBJECT_STORAGE_VIEW" "P_OBJECT_STORAGE_MANAGE" "P_LOG_TARGET_VIEW" "P_LOG_TARGET_MANAGE" "P_SCRIPT_CONFIG_VIEW" "P_SCRIPT_CONFIG_MANAGE"
username
required
string [ 8 .. 32 ] characters ^(?!d+$)[a-z0-9]+(-[a-z0-9]+)*

Responses

Request samples

Content type
application/json
{
  • "password": "stringst",
  • "services": [
    ],
  • "passwordChangeRequired": true,
  • "email": "user@example.com",
  • "fullName": "string",
  • "phone": "string",
  • "permissions": [
    ],
  • "username": "stringst"
}

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "username": "stringst",
  • "passwordChangeRequired": true,
  • "email": "user@example.com",
  • "fullName": "string",
  • "phone": "string",
  • "permissions": [
    ],
  • "services": [
    ],
  • "status": "ACTIVE"
}

Get User By Id

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "username": "stringst",
  • "passwordChangeRequired": true,
  • "email": "user@example.com",
  • "fullName": "string",
  • "phone": "string",
  • "permissions": [
    ],
  • "services": [
    ],
  • "status": "ACTIVE"
}

Update User By Id

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Request Body schema: application/json
password
string >= 8 characters
services
Array of strings[^[a-fA-F0-9]+$]
passwordChangeRequired
boolean
email
string <email>
fullName
string >= 2 characters
phone
string
permissions
Array of strings
Items Enum: "P_ADMIN_VIEW" "P_ADMIN_MANAGE" "P_ADMIN_BILLING" "P_ADMIN_STATS" "P_ACCOUNT_ADMIN" "P_ACCOUNT_VIEW" "P_ACCOUNT_MANAGE" "P_BILLING_VIEW" "P_BILLING_MANAGE" "P_USER_PROFILE_VIEW" "P_USER_PROFILE_MANAGE" "P_USER_VIEW" "P_USER_MANAGE" "P_USER_GRANT_ALL" "P_SAML_VIEW" "P_SAML_MANAGE" "P_SERVICE_ALL" "P_SERVICE_PURGE" "P_SERVICE_VIEW" "P_SERVICE_MANAGE" "P_ORIGIN_VIEW" "P_ORIGIN_MANAGE" "P_CERTIFICATE_VIEW" "P_CERTIFICATE_MANAGE" "P_API_TOKENS_VIEW" "P_API_TOKENS_MANAGE" "P_STATS_VIEW" "P_STATS_MANAGE" "P_OBJECT_STORAGE_VIEW" "P_OBJECT_STORAGE_MANAGE" "P_LOG_TARGET_VIEW" "P_LOG_TARGET_MANAGE" "P_SCRIPT_CONFIG_VIEW" "P_SCRIPT_CONFIG_MANAGE"

Responses

Request samples

Content type
application/json
{
  • "password": "stringst",
  • "services": [
    ],
  • "passwordChangeRequired": true,
  • "email": "user@example.com",
  • "fullName": "string",
  • "phone": "string",
  • "permissions": [
    ]
}

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "username": "stringst",
  • "passwordChangeRequired": true,
  • "email": "user@example.com",
  • "fullName": "string",
  • "phone": "string",
  • "permissions": [
    ],
  • "services": [
    ],
  • "status": "ACTIVE"
}

Delete User By Id

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "username": "stringst",
  • "passwordChangeRequired": true,
  • "email": "user@example.com",
  • "fullName": "string",
  • "phone": "string",
  • "permissions": [
    ],
  • "services": [
    ],
  • "status": "ACTIVE"
}

List of allowed permissions for user

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{
  • "permissions": [
    ]
}

Activate User By Id

Authorizations:
BearerAuth
path Parameters
id
required
string = 24 characters ^[a-fA-F0-9]+$

Id is a hex string of 24 characters

Responses

Response samples

Content type
application/json
{
  • "_id": "string",
  • "updateAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "username": "stringst",
  • "passwordChangeRequired": true,
  • "email": "user@example.com",
  • "fullName": "string",
  • "phone": "string",
  • "permissions": [