Maton

Get Metric Data

POST/metrics

Authorization

bearerAuth
AuthorizationBearer <token>

Your Maton API key, sent as Authorization: Bearer <MATON_API_KEY>. Create one at https://maton.ai/settings.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.maton.ai/metrics" \  -H "Authorization: Bearer $MATON_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "from": "2026-11-18T12:00:00Z",    "to": "2026-11-18T18:00:00Z",    "interval": 3600000,    "queries": [      {"name": "errors", "compute": {"aggregation": "count"}, "search": {"query": "response_status_code:>=400"}, "group_by": [{"facet": "app", "limit": 5}]},      {"name": "total", "compute": {"aggregation": "count"}, "group_by": [{"facet": "app", "limit": 5}]}    ],    "formulas": [{"name": "error_rate", "formula": "errors / total * 100", "number_format": {"unit": {"type": "canonical_unit", "unit_name": "percent"}}}]  }'
{
  "columns": [
    {
      "name": "app",
      "type": "group",
      "values": [
        [
          "slack"
        ],
        [
          "hubspot"
        ]
      ]
    },
    {
      "name": "error_rate",
      "type": "number",
      "values": [
        2.5,
        0
      ],
      "meta": {
        "unit": [
          {
            "family": "percentage",
            "name": "percent",
            "plural": "percent",
            "scale_factor": 1,
            "short_name": "%"
          },
          null
        ]
      }
    }
  ],
  "series": [
    {
      "group_tags": [
        "app:slack"
      ],
      "query_index": 0,
      "unit": [
        {
          "family": "percentage",
          "name": "percent",
          "plural": "percent",
          "scale_factor": 1,
          "short_name": "%"
        },
        null
      ]
    },
    {
      "group_tags": [
        "app:hubspot"
      ],
      "query_index": 0,
      "unit": [
        {
          "family": "percentage",
          "name": "percent",
          "plural": "percent",
          "scale_factor": 1,
          "short_name": "%"
        },
        null
      ]
    }
  ],
  "times": [
    1795003200000,
    1795006800000,
    1795010400000,
    1795014000000,
    1795017600000,
    1795021200000
  ],
  "values": [
    [
      0,
      4,
      2.1,
      0,
      5.5,
      3.2
    ],
    [
      0,
      0,
      0,
      0,
      0,
      0
    ]
  ]
}
{
  "message": "Invalid app name.",
  "type": "Bad Request",
  "code": 400
}
{
  "message": "Invalid API key.",
  "type": "Unauthorized",
  "code": 401
}
{
  "message": "Too many requests.",
  "type": "Too Many Requests",
  "code": 429
}
{
  "message": "Internal server error.",
  "type": "Internal Server Error",
  "code": 500
}