Get historical cost across your account
GET {{baseUrl}}/api/v2/usage/historical_cost?view=<string>&start_month=<dateTime>&end_month=<dateTime>
Get historical cost across multi-org and single root-org accounts. Cost data for a given month becomes available no later than the 16th of the following month.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
view | string | String to specify whether cost is broken down at a parent-org level or at the sub-org level. Available views are summary and sub-org . Defaults to summary . | |
start_month | string | (Required) Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for cost beginning this month. | |
end_month | string | Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for cost ending this month. |
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Accept | string |
RESPONSES
status: OK
{"data":[{"attributes":{"charges":[{"charge_type":"\u003cstring\u003e","cost":"\u003cdouble\u003e","product_name":"\u003cstring\u003e"},{"charge_type":"\u003cstring\u003e","cost":"\u003cdouble\u003e","product_name":"\u003cstring\u003e"}],"date":"\u003cdateTime\u003e","org_name":"\u003cstring\u003e","public_id":"\u003cstring\u003e","region":"\u003cstring\u003e","total_cost":"\u003cdouble\u003e"},"id":"\u003cstring\u003e","type":"cost_by_org"},{"attributes":{"charges":[{"charge_type":"\u003cstring\u003e","cost":"\u003cdouble\u003e","product_name":"\u003cstring\u003e"},{"charge_type":"\u003cstring\u003e","cost":"\u003cdouble\u003e","product_name":"\u003cstring\u003e"}],"date":"\u003cdateTime\u003e","org_name":"\u003cstring\u003e","public_id":"\u003cstring\u003e","region":"\u003cstring\u003e","total_cost":"\u003cdouble\u003e"},"id":"\u003cstring\u003e","type":"cost_by_org"}]}