HTTP API

Common infos

The base URL for all requests is https://supv.cloud/api/v1/.

You always need to send a valid API key in the Authorization header.

The job endpoint

POST to /job

The endpoint accepts JSON (content-type: application/json) or URI-encoded query params (?job=example).

Required fields:

fieldexpected typedescription
job(string)A name that you decide to identify a job. It is shown on the dashboard.

Optional fields:

fieldexpected typedescription
id(string)An identifier to update the event by another request.
rows(number)If you want to save how many rows an event created.
size(number)If you want to save the size of a file for instance.
errors(string)Errors you want to save with the event.

Result

The endpoint does not return a response object, but only a 204 status code, if the request was successful.

Possible errors are 400 for missing / invalid fields, 403 for an invalid authorization, 429 for the rate limit or 500 for internal errors.

Limits

There is a rate limit of 120 events per hour.

Number fields are saved as integers with a range of -+9007199254740991.

Request payload/body cannot be larger than 10KB.

Examples

Node.js with fetch:

123456789
fetch('https://supv.cloud/api/v1/job', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: 'xxxxxxxxx',
},
body: JSON.stringify({ job: 'backup.mysql' }),
});

Curl with query params:

1234
curl --request POST \
--url 'https://supv.cloud/api/v1/job?job=backup.mysql' \
--header 'Authorization: xxxxxxxx'

Curl sends a JSON body:

12345678
curl --request POST \
--url https://supv.cloud/api/v1/job \
--header 'Authorization: xxxxxxxxx' \
--header 'Content-Type: application/json' \
--data '{
"job": "backup.mysql"
}'

The metric endpoint

POST to /metric

The endpoint accepts JSON (content-type: application/json) or URI-encoded query params (?name=example).

Required fields:

fieldexpected typedescription
name(string)A name that you decide to identify the metric. Maximum length of 255 chars.
counter*(number)The integer that you want to count. It is used to increase the metrics sum.
value*(number)This number is treated as a value metric (hence the name). It is used to calculate a mean value.

Info: * You must send the counter OR the value field.

Optional fields:

fieldexpected typedescription
tags(string[])Send up to 2 tags for each data point. Maximum length of 255 chars per tag.
timestamp(string, number)UNIX timestamp to explicitly set the date for the event.

Result

The endpoint does not return a response object, but only a 204 status code, if the request was successful.

Possible errors are 400 for missing / invalid fields, 403 for an invalid authorization, 429 for the rate limit or 500 for internal errors.

Send more than 1 event at once

You can send multiple events in 1 request. Send all events in an array, set into the metrics field of the JSON body.

1234
{
"metrics": [ ... ]
}

If there is one item with an invalid field, none item is saved and a 400 error is returned.

Limits

There is a storage limit of 10k events per free account.

Number fields are saved as integers with a range of -+9007199254740991.

Value fields are saved as doubles with a precision range of 15 decimals (inexact).

Request payload/body cannot be larger than 10KB.

Examples

Node.js with fetch:

123456789
fetch('https://supv.cloud/api/v1/metric', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: 'xxxxxxxxx',
},
body: JSON.stringify({ name: 'load times', value: 453.3 }),
});

Curl with query params:

1234
curl --request POST \
--url 'https://supv.cloud/api/v1/metric?name=load%20times&value=453.3' \
--header 'Authorization: xxxxxxxx'