Billing & FinOps

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

GET
/scopes/{scopeId}/billing/cost-reports/{costReportId}/exports/download

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.

Authorization

bearerToken
headerAuthorizationBearer <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.

Path Parameters

scopeId*string

Opaque ownership+authorization scope resolving to tenant + subscription + project.

costReportId*string

Identifier of the cost report within the active scope.

Query Parameters

groupBy?string

Dimension to group spend by (defaults to service, matching the report read).

Value in"service""project""region""tag"
tagKey?string

Tag key to group by when groupBy=tag (see the report read's tagKey).

Length1 <= length <= 128
period?string

Reporting period (defaults to 30d, matching the report read). Ignored when an explicit from/to range is supplied.

Value in"7d""30d""90d""mtd"
from?string

Inclusive 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.

Formatdate-time
to?string

Exclusive end of an arbitrary reporting window (UTC, ISO 8601). See from.

Formatdate-time
sort?string

Server-side sort direction of the breakdown items by current-period spend.

Value in"asc""desc"
granularity?string

Bucket granularity (defaults to daily, matching the report read).

Value in"daily""monthly"

Response Body

Wide-format CSV export of the cost report (one row per bucket, one column per dimension).

response?unknowntext/csv
curl -X GET "https://example.com/scopes/string/billing/cost-reports/string/exports/download"
null