Get Started with API Keys

To create an API Key, navigate to your Account Settings by clicking your name in the portal navigation and selecting "Account Settings" or going to accounts.cyxtera.com.

The API Keys section allows you to create and revoke API Keys and their associated secrets. API Keys provide you the ability to automate actions on behalf of your account while keeping your password and other login information secure. In the future, you will be able to create keys with a reduced scope of access so a key is only able to access and update certain types of account information. For example, only contact information but no billing or colocation asset information.

Keys and Secrets

API Keys and their Key ID may be thought of as the username for the account. This ID can be viewed and copied at any time. Each key may have multiple "shared secrets" which serve as the "password" for the key. These shared secrets are only visible at the time they are created for security purposes.

Each shared secret created after the initial default secret may have a description added and a time for its expiration set automatically. Secrets may also be revoked at any time or the entire key may be deleted, revoking its secrets with it.

Retrieving a Bearer Token

API Keys are used to retrieve a bearer token from Cyxtera's bearer token endpoint. Bearer tokens are used to authenticate any of the Portal APIs and are valid for 1 hour after their creation. To retrieve a bearer token, provide an API Key ID and an active shared secret associated with the key as the client_id and client_secret, respectively to the following endpoint. https://accounts.cyxtera.com/connect/token

See example below, replacing KEYID and SHAREDSECRET with your credentials.

curl --location --request POST 'https://accounts.cyxtera.com/connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=KEYID' \
--data-urlencode 'client_secret=SHAREDSECRET'
curl --location --request POST 'https://accounts.cyxtera.com/connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=KEYID' \
--data-urlencode 'client_secret=SHAREDSECRET'

The returned response will be JSON, with the bearer token returned in the access_token key.

{
    "access_token": "BEARER_TOKEN",
    "expires_in": 3600,
    "token_type": "Bearer",
    "scope": "https://api.cyxtera.com/accounts"
}
{
    "access_token": "BEARER_TOKEN",
    "expires_in": 3600,
    "token_type": "Bearer",
    "scope": "https://api.cyxtera.com/accounts"
}

With the Bearer Token saved, future API requests can be authenticated by providing a request header in the form of authorization: Bearer BEARER_TOKEN, replacing BEARER_TOKEN with the token provided earlier. Note that the expiration for the token is also provided in the request. Tokens currently expire one hour after they are provided.