GitHub Billing API

Monitor charges and usage from Actions and Packages.

Documentation

📖
Documentation
https://docs.github.com/en/rest/apps
📖
Documentation
https://docs.github.com/en/rest/codes-of-conduct/codes-of-conduct
📖
Documentation
https://docs.github.com/en/rest/emojis
📖
Documentation
https://docs.github.com/en/rest/gitignore
📖
Documentation
https://docs.github.com/en/rest/apps/installations
📖
Documentation
https://docs.github.com/en/rest/enterprise-admin
📖
Documentation
https://docs.github.com/en/rest/activity/events
📖
Documentation
https://docs.github.com/en/rest/orgs
📖
Documentation
https://docs.github.com/en/rest/rate-limit
📖
Documentation
https://docs.github.com/en/enterprise-cloud@latest/rest/scim
📖
Documentation
https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api
📖
Documentation
https://docs.github.com/en/rest/teams
📖
Documentation
https://docs.github.com/en/rest/meta/meta
📖
Documentation
https://docs.github.com/en/rest/actions
📖
Documentation
https://docs.github.com/en/rest/branches
📖
Documentation
https://docs.github.com/en/rest/code-scanning
📖
Documentation
https://docs.github.com/en/rest/collaborators
📖
Documentation
https://docs.github.com/en/rest/dependabot
📖
Documentation
https://docs.github.com/en/rest/webhooks
📖
Documentation
https://docs.github.com/en/rest/pulls
📖
Documentation
https://docs.github.com/en/rest/git/tags
📖
Documentation
https://docs.github.com/en/rest/repos/autolinks
📖
Documentation
https://docs.github.com/en/rest/collaborators/invitations

Specifications

Other Resources

OpenAPI Specification

github-billing-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  version: 1.1.4
  title: GitHub v3 REST Billing API
  description: GitHub's v3 REST API.
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
  termsOfService: https://docs.github.com/articles/github-terms-of-service
  contact:
    name: Support
    url: https://support.github.com/contact?tags=dotcom-rest-api
  x-github-plan: ghes
  x-github-release: 3.9
servers:
- url: '{protocol}://{hostname}/api/v3'
  variables:
    hostname:
      description: Self-hosted Enterprise Server hostname
      default: HOSTNAME
    protocol:
      description: Self-hosted Enterprise Server protocol
      default: http
tags:
- name: Billing
  description: Monitor charges and usage from Actions and Packages.
paths:
  /enterprises/{enterprise}/settings/billing/advanced-security:
    get:
      summary: GitHub Get GitHub Advanced Security Active Committers for an Enterprise
      description: 'Gets the GitHub Advanced Security active committers for an enterprise per repository.


        Each distinct user login across all repositories is counted as a single Advanced Security seat, so the `total_advanced_security_committers` is not the sum of active_users for each repository.


        The total number of repositories with committer information is tracked by the `total_count` field.'
      tags:
      - Billing
      operationId: billing/get-github-advanced-security-billing-ghe
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/enterprise-admin/billing#get-github-advanced-security-active-committers-for-an-enterprise
      parameters:
      - $ref: '#/components/parameters/enterprise'
      - $ref: '#/components/parameters/per-page'
      - $ref: '#/components/parameters/page'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/advanced-security-active-committers'
              examples:
                default:
                  $ref: '#/components/examples/advanced-security-active-committers'
        '403':
          $ref: '#/components/responses/code_scanning_forbidden_read'
      x-github:
        githubCloudOnly: true
        enabledForGitHubApps: false
        category: enterprise-admin
        subcategory: billing
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /orgs/{org}/settings/billing/advanced-security:
    get:
      summary: GitHub Get GitHub Advanced Security Active Committers for an Organization
      description: 'Gets the GitHub Advanced Security active committers for an organization per repository.


        Each distinct user login across all repositories is counted as a single Advanced Security seat, so the `total_advanced_security_committers` is not the sum of advanced_security_committers for each repository.


        If this organization defers to an enterprise for billing, the `total_advanced_security_committers` returned from the organization API may include some users that are in more than one organization, so they will only consume a single Advanced Security seat at the enterprise level.


        The total number of repositories with committer information is tracked by the `total_count` field.'
      tags:
      - Billing
      operationId: billing/get-github-advanced-security-billing-org
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/billing/billing#get-github-advanced-security-active-committers-for-an-organization
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/per-page'
      - $ref: '#/components/parameters/page'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/advanced-security-active-committers'
              examples:
                default:
                  $ref: '#/components/examples/advanced-security-active-committers'
        '403':
          $ref: '#/components/responses/code_scanning_forbidden_read'
      x-github:
        githubCloudOnly: true
        enabledForGitHubApps: true
        category: billing
        subcategory: billing
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  examples:
    advanced-security-active-committers:
      value:
        total_advanced_security_committers: 2
        total_count: 2
        repositories:
        - name: octocat-org/Hello-World
          advanced_security_committers: 2
          advanced_security_committers_breakdown:
          - user_login: octocat
            last_pushed_date: '2021-11-03'
          - user_login: octokitten
            last_pushed_date: '2021-10-25'
        - name: octocat-org/server
          advanced_security_committers: 1
          advanced_security_committers_breakdown:
          - user_login: octokitten
            last_pushed_date: '2021-10-26'
  schemas:
    advanced-security-active-committers:
      type: object
      properties:
        total_advanced_security_committers:
          type: integer
          example: 25
        total_count:
          type: integer
          example: 2
        repositories:
          type: array
          items:
            $ref: '#/components/schemas/advanced-security-active-committers-repository'
      required:
      - repositories
    advanced-security-active-committers-user:
      type: object
      properties:
        user_login:
          type: string
          example: octocat
        last_pushed_date:
          type: string
          example: '2021-11-03'
      required:
      - user_login
      - last_pushed_date
    basic-error:
      title: Basic Error
      description: Basic Error
      type: object
      properties:
        message:
          type: string
          example: Example body text
        documentation_url:
          type: string
          example: https://api.github.com/repos/octocat/Hello-World
        url:
          type: string
          example: https://api.github.com/repos/octocat/Hello-World
        status:
          type: string
          example: open
    advanced-security-active-committers-repository:
      type: object
      properties:
        name:
          type: string
          example: octocat/Hello-World
        advanced_security_committers:
          type: integer
          example: 25
        advanced_security_committers_breakdown:
          type: array
          items:
            $ref: '#/components/schemas/advanced-security-active-committers-user'
      required:
      - name
      - advanced_security_committers
      - advanced_security_committers_breakdown
  parameters:
    per-page:
      name: per_page
      description: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.9/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
      in: query
      schema:
        type: integer
        default: 30
    enterprise:
      name: enterprise
      description: The slug version of the enterprise name. You can also substitute this value with the enterprise id.
      in: path
      required: true
      schema:
        type: string
    org:
      name: org
      description: The organization name. The name is not case sensitive.
      in: path
      required: true
      schema:
        type: string
    page:
      name: page
      description: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.9/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
      in: query
      schema:
        type: integer
        default: 1
  responses:
    code_scanning_forbidden_read:
      description: Response if GitHub Advanced Security is not enabled for this repository
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/basic-error'
externalDocs:
  description: GitHub Enterprise Developer Docs
  url: https://docs.github.com/enterprise-server@3.9/rest/