enterprise-admin

Create an enterprise token inventory export

Starts an asynchronous CSV export of the enterprise token inventory and returns an opaque export id to poll. Limited to a small number of exports per enterprise per day.

The generated file is UTF-8 CSV with a header row, using RFC 4180 field quoting and escaping and LF (\n) line endings. Timestamps are ISO-8601 in UTC (for example, 2026-09-15T12:00:00Z). An empty cell means the value is null or unknown, never false. Multi-value cells join their entries with ; — this includes scopes and permissions, where each permission is encoded as a resource:action pair (for example, contents:write; issues:read). The file has one row per (credential, authorizing organization); the credential columns repeat while organization_id and organization vary, and a credential with no organization grant appears once with empty organization columns. authorization_count is the credential's total number of organization authorizations across the enterprise, plus one when enterprise_authorized is true, independent of any filters applied to the export. credential_id is a raw source-table id that can collide across credential types, so it is unique only together with credential_type, and only for the types that populate it (classic and fine-grained PATs, OAuth and GitHub App user tokens); SSH keys are keyed by fingerprint, while GitHub App installations and federated JTIs have no unique per-row column. owner_type (user, oauth_application, or github_app) disambiguates the id space of owner_id. expiry_status is expires, never, or unknown — unknown marks a credential whose expiration could not be determined, so a blank expires_at is never mistaken for one that never expires.

You must be an enterprise owner (or hold a role with the "View enterprise credentials" permission) to use this endpoint.

OAuth app tokens and personal access tokens (classic) require the read:enterprise scope to access this endpoint.

post/enterprises/{enterprise}/credentials/exports

Path parameters

enterprisestring required

The slug version of the enterprise name.

Request body

token_typesstring[]

The credential types to include.

authorization_state'currently_authorized' | 'member_owned_only'

Filter by enterprise-access status.

ownerstring

Filter to credentials owned by this user, given as a login.

organizationstring

Filter to credentials authorized to this organization in the enterprise, given as a login.

applicationstring

Filter to credentials for this application, given as a GitHub App slug or an OAuth App client id.

Response

Accepted

export_idstring required

Opaque id for the export, used to poll its status.

status'pending' | 'queued' | 'started' | 'success' | 'error' required

The state of the export job.

as_ofstring nullable

When the export was requested.

Changes