billing

Get a usage report export

Changed on

Gets the status and details of a usage report export by ID. Completed and failed report exports are available for 31 days after completion or failure. This retention period applies only to generated report records. New reports can include eligible usage data from up to 24 months ago, subject to the enterprise's creation or migration date and the report type's date-range limits. The authenticated user must be an enterprise admin or billing manager, or a custom role holder with fine-grained read access to enterprise billing. An installation access token for a GitHub App installed on the enterprise with write access to enterprise administration, or with read access to enterprise billing, can also get a usage report export.

[!NOTE] The "Enterprise administration" fine-grained permission is not available to callers. To use this API, you must use an OAuth app token or a personal access token (classic), or another supported fine-grained permission.

get/enterprises/{enterprise}/settings/billing/reports/{report_id}

Request

  • Base URL: https://api.github.com
  • URL: https://api.github.com/enterprises/{enterprise}/settings/billing/reports/{report_id}
  • Auth: none declared

Path parameters

enterprisestring required

The slug version of the enterprise name.

report_idstring uuid required

The unique identifier (UUID) for the usage report export.

Response

Usage report export details

idstring uuid required

Unique identifier for the usage report export

report_type'detailed' | 'summarized' | 'premium_request' | 'ai_credit' required

The type of usage report

start_datestring date required

The start date for the report

end_datestring date required

The end date for the report

status'processing' | 'completed' | 'failed' required

The current status of the report export

download_urlsstring[]

URLs to download the completed report. Only present when the report status is completed.

created_atstring date-time

When the report export was created

actorstring

The login of the user who requested the export

Example response

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "report_type": "detailed",
  "start_date": "2024-01-01",
  "end_date": "2024-01-31",
  "status": "completed",
  "download_urls": [
    "https://github.com/enterprises/github/metered_exports/1234"
  ],
  "created_at": "2024-01-15T10:30:00Z",
  "actor": "monalisa"
}

Changes

  • 2022-11-28783af1c7188bRevision changes
    • warning

      added the new ai_credit enum value to the response property for the response status