Skip to main content
POST
/
accounts
/
{accountId}
/
metrics
cURL
curl --request POST \
  --url https://api.checklyhq.com/accounts/{accountId}/metrics \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "startTime": "2023-12-25",
  "endTime": "2023-12-25",
  "query": "<string>",
  "step": 60
}'
"<string>"

Authorizations

Authorization
string
header
required

The Checkly Public API uses API keys to authenticate requests. You can get the API Key here. Your API key is like a password: keep it secure! Authentication to the API is performed using the Bearer auth method in the Authorization header and using the account ID. For example, set Authorization header while using cURL: curl -H "Authorization: Bearer [apiKey]" "X-Checkly-Account: [accountId]"

Path Parameters

accountId
string
required

Body

application/json
query
string
required

Prometheus query string

startTime
string<date>
endTime
string<date>
step
number
default:60

Query resolution step width in seconds

Response

default - application/json

Successful

The response is of type string.

I