Automations
Get automation metrics
Read lifetime activation and direct-message totals plus the trailing seven-day DM count for one Instagram automation.
GET
/
api
/
v1
/
automations
/
{automationId}
/
metrics
Get automation metrics
curl --request GET \
--url https://levios.app/api/v1/automations/{automationId}/metrics \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://levios.app/api/v1/automations/{automationId}/metrics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://levios.app/api/v1/automations/{automationId}/metrics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"error": {
"code": "api_invalid_content_length",
"message": "Invalid Content-Length.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_unauthorized",
"message": "Authentication required.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_account_not_granted",
"message": "This credential is not authorized for the request.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_automation_metrics_not_found",
"message": "The requested automation metrics were not found.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_body_too_large",
"message": "The JSON request body exceeds 1 MiB.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_unsupported_media_type",
"message": "Content-Type must be application/json.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_validation_error",
"message": "The request does not match the declared schema.",
"correlation_id": "<string>",
"details": {
"issues": [
{
"code": "<string>",
"path": [
1
]
}
]
}
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_internal_error",
"message": "The request could not be completed.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_metrics_read_unavailable",
"message": "The automation metrics could not be read.",
"correlation_id": "<string>"
}
}Use this endpoint to measure one automation. Pass the automation ID in the
path and an accessible
account_id in the query string. Your API key needs
the metrics:read scope.
The response contains:
automation_id: the automation whose metrics were read.activations_total: all-time successful automation activations.dms_total: all-time sent direct-message intents.dms_last_7d: sent direct-message intents in the trailing seven days.last_fired_at: the most recent successful event timestamp, ornullif the automation has never fired.
Example request
curl --get \
--url "https://levios.app/api/v1/automations/${LEVIOS_AUTOMATION_ID}/metrics" \
--header "Authorization: Bearer ${LEVIOS_API_KEY}" \
--data-urlencode "account_id=${LEVIOS_ACCOUNT_ID}"
Get automation metrics
curl --request GET \
--url https://levios.app/api/v1/automations/{automationId}/metrics \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://levios.app/api/v1/automations/{automationId}/metrics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://levios.app/api/v1/automations/{automationId}/metrics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"error": {
"code": "api_invalid_content_length",
"message": "Invalid Content-Length.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_unauthorized",
"message": "Authentication required.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_account_not_granted",
"message": "This credential is not authorized for the request.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_automation_metrics_not_found",
"message": "The requested automation metrics were not found.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_body_too_large",
"message": "The JSON request body exceeds 1 MiB.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_unsupported_media_type",
"message": "Content-Type must be application/json.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_validation_error",
"message": "The request does not match the declared schema.",
"correlation_id": "<string>",
"details": {
"issues": [
{
"code": "<string>",
"path": [
1
]
}
]
}
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_internal_error",
"message": "The request could not be completed.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_metrics_read_unavailable",
"message": "The automation metrics could not be read.",
"correlation_id": "<string>"
}
}
