Preview — pending review
This reference is generated from the platform API contract and is still under review. Operations, fields, and descriptions can change before publication.
Download the cost report as a CSV export
Streams a CSV export of the referenced Cost Report — the synchronous CSV twin of the
GET .../cost-reports read: one row per time bucket, one column per resolved dimension, built
from the same groupBy/period/granularity query dimensions as the report itself. The
download does not mutate any resource.
Validation: scopeId must be accessible and costReportId must reference a cost report
within that scope (else 404 NOT_FOUND); groupBy, period and granularity must be valid enum
members when supplied (defaults: service/30d/daily) — otherwise 422 VALIDATION_FAILED; the
caller must hold a billing-capable role (owner|admin|contributor|reader|billing), else 403.
Async & state: Synchronous read; no state change. The CSV is rebuilt from the live cost
dataset and streamed inline; no Operation is created and no resource.updated SSE frames are
emitted.
Errors: 401 unauthenticated; 403 insufficient role; 404 unknown scope or cost report; 422
malformed query dimensions; 500 internal failure.
Idempotency/Concurrency: Safe, cacheable; no idempotency key required. Repeated downloads
with the same dimensions return byte-identical CSVs for an unchanged dataset.
bearerTokenAuthorizationBearer <token>An API token (pc_live_…) or a service-account key (sak_live_…), created in Identity & Access Management and sent as Authorization: Bearer <token>. Requests are rate limited per credential and per tenant: every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset, and a refused request gets 429 RATE_LIMITED with Retry-After.
scopeId*stringOpaque ownership+authorization scope resolving to tenant + subscription + project.
costReportId*stringIdentifier of the cost report within the active scope.
groupBy?stringDimension to group spend by (defaults to service, matching the report read).
"service""project""region""tag"tagKey?stringTag key to group by when groupBy=tag (see the report read's tagKey).
1 <= length <= 128period?stringReporting period (defaults to 30d, matching the report read). Ignored when an explicit
from/to range is supplied.
"7d""30d""90d""mtd"from?stringInclusive start of an arbitrary reporting window (UTC, ISO 8601). Supplied together with
to it REPLACES period; both must be provided together with from strictly before
to, else 422 VALIDATION_FAILED.
date-timeto?stringExclusive end of an arbitrary reporting window (UTC, ISO 8601). See from.
date-timesort?stringServer-side sort direction of the breakdown items by current-period spend.
"asc""desc"granularity?stringBucket granularity (defaults to daily, matching the report read).
"daily""monthly"Wide-format CSV export of the cost report (one row per bucket, one column per dimension).
response?unknowntext/csvcurl -X GET "https://example.com/scopes/string/billing/cost-reports/string/exports/download"null