get usage report.md

Get usage report

Management API · Reports

POST https://app.mk.io/api/v1/organization/reports/usage

Returns meter-level usage aggregated by set granularity over the specified date range.

RBAC Capability Required: core.customer.get

Authentication

Request body

Content type: application/json

Example request

curl -X POST "https://app.mk.io/api/v1/organization/reports/usage" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
  "download": true,
  "endDate": "2025-04-01",
  "filterOnReportedDate": true,
  "format": "csv",
  "granularity": "hour",
  "paymentMethodIds": [
    "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  ],
  "startDate": "2025-03-01"
}'

Responses

200 — OK

Example:

{
  "supplemental": {
    "download": true,
    "end": "2024-01-01",
    "filters": {
      "meterNames": [
        "string"
      ],
      "paymentMethodIds": [
        "00000000-0000-0000-0000-000000000000"
      ],
      "projectNames": [
        "string"
      ]
    },
    "format": "string",
    "granularity": "string",
    "groupBy": [
      "string"
    ],
    "records": 0,
    "start": "2024-01-01"
  },
  "value": [
    {
      "cost": "string",
      "currency": "string",
      "date": "2024-01-01T00:00:00Z",
      "dateProcessed": "2024-01-01T00:00:00Z",
      "entitlement": "00000000-0000-0000-0000-000000000000",
      "entitlementType": "string",
      "family": "string",
      "meterName": "string",
      "meterSku": "string",
      "paymentMethod": "00000000-0000-0000-0000-000000000000",
      "paymentMethodName": "string",
      "price": 0,
      "project": "string",
      "quantity": 0,
      "solution": "string",
      "unit": "string"
    }
  ]
}

400 — Bad Request

Example:

{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}

401 — Unauthorized

Example:

{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}

403 — Forbidden

Example:

{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}

404 — Not Found

Example:

{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}

409 — Conflict

Example:

{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}

429 — Too Many Requests

Example:

{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}

500 — Internal Server Error

Example:

{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}

Source spec: management-api · operationId: [post]_/api/v1/organization/reports/usage