Get started with the Chronosphere API
The Chronosphere API is an HTTP/JSON REST API, where the HTTP method and the URL path define endpoints. To access the Chronosphere API, you need an API token.
Create an API token
A service can access the Chronosphere API by authenticating with its API token. Many Chronosphere API requests require an unrestricted service account. For details, see Service accounts.
A user with sufficient permissions can access the Chronosphere API by creating a temporary personal access token. For details, see Personal access tokens.
Send requests
Send requests to your Chronosphere domain, which must include your Chronosphere
API token in an API-Token
HTTP header.
For example, you can pass the token and domain using environment variables to the
curl
command:
export CHRONOSPHERE_API_TOKEN="TOKEN"
export CHRONOSPHERE_DOMAIN="INSTANCE.chronosphere.io"
curl -H "API-Token: ${CHRONOSPHERE_API_TOKEN}" \
-X METHOD \
"https://${CHRONOSPHERE_DOMAIN}/ENDPOINT_PATH"
Replace the following:
TOKEN
: Your API token.INSTANCE
: The subdomain name for your organization's Chronosphere instance.METHOD
: The HTTP method to use with the request, such asGET
orPOST
.ENDPOINT_PATH
: The specific endpoint you want to access.
Chronoctl also uses the environment variable CHRONOSPHERE_API_TOKEN
.
For example, to list all collections:
curl -H "API-Token: ${CHRONOSPHERE_API_TOKEN}" \
-X GET \
"https://${CHRONOSPHERE_DOMAIN}/api/v1/config/collections"
To create a collection, send a POST request with JSON body:
curl -H "API-Token: ${CHRONOSPHERE_API_TOKEN}" \
-X POST \
--data '{"collection": {"name": "My Test Collection"}}' \
"https://${CHRONOSPHERE_DOMAIN}/api/v1/config/collections"
Available endpoints
For a full list of Chronosphere API endpoints, see:
- Config V1 reference (opens in a new tab): Endpoints for creating, reading, updating, deleting, and listing configurable Chronosphere resources.
- Data V1 reference (opens in a new tab): Endpoints for reading and writing data to the Chronosphere system.
- State V1 reference (opens in a new tab): Endpoints for accessing the runtime state of the Chronosphere system.