GitHub Setup API

The Setup API from GitHub — 2 operation(s) for setup.

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-setup-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Github Setup API
  version: 1.1.4
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
  termsOfService: https://docs.github.com/articles/github-terms-of-service
  description: 'Operations tagged Setup across 2 of this provider''s published API definitions: github-auth-api-openapi.yml, github-repo-code-scanning-api-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: '{protocol}://{hostname}/api/v3'
  variables:
    hostname:
      description: Self-hosted Enterprise Server hostname
      default: api.github.com
    protocol:
      description: Self-hosted Enterprise Server protocol
      default: https
- url: '{protocol}://{hostname}'
  variables:
    hostname:
      description: Self-hosted Enterprise Server hostname
      default: api.github.com
    protocol:
      description: Self-hosted Enterprise Server protocol
      default: https
tags:
- name: Setup
paths:
  /setup/api/settings/authorized-keys:
    get:
      summary: GitHub Get All Authorized Ssh Keys
      description: The GET endpoint at /setup/api/settings/authorized-keys in the GitHub Authorization API retrieves a complete list of all authorized SSH keys that have been configured for the system. This endpoint is typically used during setup or administrative operations to audit and review which SSH public keys have been granted access to the GitHub instance, allowing administrators to manage and verify authorized access points for secure shell connections.
      operationId: getAllAuthorizedSshKeys
      tags:
      - Setup
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/enterprise-admin/management-console#get-all-authorized-ssh-keys
      servers:
      - url: '{protocol}://{hostname}'
        variables:
          hostname:
            default: HOSTNAME
            description: Self-hosted Enterprise Server hostname
          protocol:
            default: http
            description: Self-hosted Enterprise Server protocol
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ssh-key'
              examples:
                default:
                  $ref: '#/components/examples/ssh-key-items'
        '401':
          description: Unauthorized
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: false
        category: enterprise-admin
        subcategory: management-console
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: '{protocol}://{hostname}/api/v3'
      variables:
        hostname:
          description: Self-hosted Enterprise Server hostname
          default: api.github.com
        protocol:
          description: Self-hosted Enterprise Server protocol
          default: https
  /repos/{owner}/{repo}/code-scanning/default-setup:
    get:
      summary: GitHub Get Code Scanning Default Setup Configuration
      description: 'Gets a code scanning default setup configuration.


        OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.'
      tags:
      - Setup
      operationId: getCodeScanningDefaultSetupConfiguration
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/code-scanning/code-scanning#get-a-code-scanning-default-setup-configuration
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/code-scanning-default-setup'
              examples:
                default:
                  $ref: '#/components/examples/code-scanning-default-setup'
        '403':
          $ref: '#/components/responses/code_scanning_forbidden_read'
        '404':
          $ref: '#/components/responses/not_found'
        '503':
          $ref: '#/components/responses/service_unavailable'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: code-scanning
        subcategory: code-scanning
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    patch:
      summary: GitHub Update Code Scanning Default Setup Configuration
      description: 'Updates a code scanning default setup configuration.


        OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.'
      tags:
      - Setup
      operationId: updateCodeScanningDefaultSetupConfiguration
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/code-scanning-default-setup-update'
            examples:
              default:
                $ref: '#/components/examples/code-scanning-default-setup-update'
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/empty-object'
              examples:
                default:
                  value: {}
        '202':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/code-scanning-default-setup-update-response'
              examples:
                default:
                  $ref: '#/components/examples/code-scanning-default-setup-update-response'
        '403':
          $ref: '#/components/responses/code_scanning_forbidden_write'
        '404':
          $ref: '#/components/responses/not_found'
        '409':
          $ref: '#/components/responses/code_scanning_conflict'
        '503':
          $ref: '#/components/responses/service_unavailable'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: code-scanning
        subcategory: code-scanning
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: '{protocol}://{hostname}'
      variables:
        hostname:
          description: Self-hosted Enterprise Server hostname
          default: api.github.com
        protocol:
          description: Self-hosted Enterprise Server protocol
          default: https
components:
  examples:
    ssh-key-items:
      value:
      - key: ssh-rsa AAAAB3NzaC1yc2EAAAAB...
        pretty-print: ssh-rsa 01:14:0f:f2:0f:e2:fe:e8:f4:72:62:af:75:f7:1a:88:3e:04:92:64
      - key: ssh-rsa AAAAB3NzaC1yc2EAAAAB...
        pretty-print: ssh-rsa 01:14:0f:f2:0f:e2:fe:e8:f4:72:62:af:75:f7:1a:88:3e:04:92:64
      - key: ssh-rsa AAAAB3NzaC1yc2EAAAAB...
        pretty-print: ssh-rsa 01:14:0f:f2:0f:e2:fe:e8:f4:72:62:af:75:f7:1a:88:3e:04:92:64
    code-scanning-default-setup-update:
      value:
        state: configured
    code-scanning-default-setup-update-response:
      value:
        run_id: 42
        run_url: https://api.github.com/repos/octoorg/octocat/actions/runs/42
    code-scanning-default-setup:
      value:
        state: configured
        languages:
        - ruby
        - python
        query_suite: default
        updated_at: '2023-01-19T11:21:34Z'
  schemas:
    ssh-key:
      type: object
      properties:
        key:
          type: string
          example: example_value
        pretty-print:
          type: string
          example: example_value
    empty-object:
      title: Empty Object
      description: An object without any properties.
      type: object
      additionalProperties: false
    code-scanning-default-setup:
      description: Configuration for code scanning default setup.
      type: object
      properties:
        state:
          description: Code scanning default setup has been configured or not.
          type: string
          enum:
          - configured
          - not-configured
          example: configured
        languages:
          description: Languages to be analyzed.
          type: array
          items:
            type: string
            enum:
            - c-cpp
            - csharp
            - go
            - java-kotlin
            - javascript-typescript
            - javascript
            - python
            - ruby
            - typescript
            - swift
        query_suite:
          description: CodeQL query suite to be used.
          type: string
          enum:
          - default
          - extended
          example: default
        updated_at:
          description: Timestamp of latest configuration update.
          type: string
          format: date-time
          example: '2023-12-06T14:20:20.000Z'
    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
    code-scanning-default-setup-update:
      description: Configuration for code scanning default setup.
      type: object
      properties:
        state:
          description: The desired state of code scanning default setup.
          type: string
          enum:
          - configured
          - not-configured
          example: configured
        query_suite:
          description: CodeQL query suite to be used.
          type: string
          enum:
          - default
          - extended
          example: default
      additionalProperties: true
      required:
      - state
    code-scanning-default-setup-update-response:
      description: 'You can use `run_url` to track the status of the run. This includes a property status and conclusion.

        You should not rely on this always being an actions workflow run object.'
      type: object
      properties:
        run_id:
          description: ID of the corresponding run.
          type: integer
          example: 42
        run_url:
          description: URL of the corresponding run.
          type: string
          example: https://api.github.com/repos/octocat/Hello-World
  responses:
    code_scanning_forbidden_write:
      description: Response if the repository is archived or if GitHub Advanced Security is not enabled for this repository
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/basic-error'
    service_unavailable:
      description: Service unavailable
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
              message:
                type: string
              documentation_url:
                type: string
    not_found:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/basic-error'
    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'
    code_scanning_conflict:
      description: Response if there is already a validation run in progress with a different default setup configuration
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/basic-error'
  parameters:
    repo:
      name: repo
      description: The name of the repository without the `.git` extension. The name is not case sensitive.
      in: path
      required: true
      schema:
        type: string
    owner:
      name: owner
      description: The account owner of the repository. The name is not case sensitive.
      in: path
      required: true
      schema:
        type: string
  securitySchemes:
    bearerHttpAuthentication:
      description: Bearer Token
      type: http
      scheme: Bearer
externalDocs:
  description: GitHub Enterprise Developer Docs
  url: https://docs.github.com/enterprise-server@3.9/rest/
x-refined-from:
- github-auth-api-openapi.yml
- github-repo-code-scanning-api-openapi.yml