GitHub Labels API

The Labels API from GitHub — 9 operation(s) for labels.

Documentation

📖
Documentation
https://docs.github.com/en/rest/apps
📖
Documentation
https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/ https://docs.github.com/en/rest/authentication/authenticating-to-the-rest-api
📖
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-labels-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  version: 1.1.4
  title: GitHub Application About Labels API
  description: 'Use the REST API to retrieve information about GitHub Apps and GitHub App

    installations.'
  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: Labels
paths:
  /repos/{owner}/{repo}/issues/{issue_number}/labels:
    get:
      summary: GitHub List Labels for an Issue
      description: This GET endpoint retrieves all labels currently assigned to a specific issue in a GitHub repository. By providing the repository owner, repository name, and issue number in the URL path, the API returns an array of label objects associated with that issue. Each label object contains properties such as the label's name, color, description, and other metadata. This operation is useful for applications that need to display, filter, or process issues based on their categorization, as labels are commonly used in GitHub workflows to organize and classify issues by type, priority, status, or other custom criteria.
      tags:
      - Labels
      operationId: listLabelsForAnIssue
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/issues/labels#list-labels-for-an-issue
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/issue-number'
      - $ref: '#/components/parameters/per-page'
      - $ref: '#/components/parameters/page'
      - 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:
                type: array
                items:
                  $ref: '#/components/schemas/label'
              examples:
                default:
                  $ref: '#/components/examples/label-items'
          headers:
            Link:
              $ref: '#/components/headers/link'
        '301':
          $ref: '#/components/responses/moved_permanently'
        '404':
          $ref: '#/components/responses/not_found'
        '410':
          $ref: '#/components/responses/gone'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: issues
        subcategory: labels
      x-api-evangelist-certified: '2025-07-18'
      x-api-naftiko-published: '2025-07-18'
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      summary: GitHub Add Labels to an Issue
      description: This POST endpoint adds one or more labels to a specific issue in a GitHub repository by specifying the repository owner, repository name, and issue number in the URL path. The request body should contain an array of label names to be added to the issue. Labels help categorize and organize issues for better project management and filtering. The authenticated user must have push access to the repository to add labels. Upon successful execution, the API returns a 200 status code with an array of all labels currently assigned to the issue, including both the newly added labels and any existing ones. This operation is idempotent, meaning adding a label that already exists on the issue will not create a duplicate.
      tags:
      - Labels
      operationId: addLabelsToAnIssue
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/issues/labels#add-labels-to-an-issue
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/issue-number'
      - 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: false
        content:
          application/json:
            schema:
              oneOf:
              - type: object
                properties:
                  labels:
                    type: array
                    minItems: 1
                    description: The names of the labels to add to the issue's existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also replace all of the labels for an issue. For more information, see "[Set labels for an issue](https://docs.github.com/enterprise-server@3.9/rest/issues/labels#set-labels-for-an-issue)."
                    items:
                      type: string
              - type: array
                minItems: 1
                items:
                  type: string
              - type: object
                properties:
                  labels:
                    type: array
                    minItems: 1
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                      required:
                      - name
              - type: array
                minItems: 1
                items:
                  type: object
                  properties:
                    name:
                      type: string
                  required:
                  - name
              - type: string
            examples:
              default:
                value:
                  labels:
                  - bug
                  - enhancement
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/label'
              examples:
                default:
                  $ref: '#/components/examples/label-items'
        '301':
          $ref: '#/components/responses/moved_permanently'
        '404':
          $ref: '#/components/responses/not_found'
        '410':
          $ref: '#/components/responses/gone'
        '422':
          $ref: '#/components/responses/validation_failed'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: issues
        subcategory: labels
      x-api-evangelist-certified: '2025-07-18'
      x-api-naftiko-published: '2025-07-18'
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    put:
      summary: GitHub Set Labels for an Issue
      description: The PUT operation on the /repos/{owner}/{repo}/issues/{issue_number}/labels endpoint replaces all existing labels on a specific GitHub issue with a new set of labels provided in the request body. This is part of the GitHub Issues API and requires authentication with appropriate permissions to modify issues in the specified repository. Unlike PATCH operations that might add labels, this PUT method performs a complete replacement, removing any labels not included in the request. The operation takes the repository owner, repository name, and issue number as path parameters, and accepts an array of label names or objects in the request body to set as the complete label set for that issue.
      tags:
      - Labels
      operationId: setLabelsForAnIssue
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/issues/labels#set-labels-for-an-issue
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/issue-number'
      - 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: false
        content:
          application/json:
            schema:
              oneOf:
              - type: object
                properties:
                  labels:
                    type: array
                    minItems: 1
                    description: The names of the labels to set for the issue. The labels you set replace any existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also add labels to the existing labels for an issue. For more information, see "[Add labels to an issue](https://docs.github.com/enterprise-server@3.9/rest/issues/labels#add-labels-to-an-issue)."
                    items:
                      type: string
              - type: array
                minItems: 1
                items:
                  type: string
              - type: object
                properties:
                  labels:
                    type: array
                    minItems: 1
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                      required:
                      - name
              - type: array
                minItems: 1
                items:
                  type: object
                  properties:
                    name:
                      type: string
                  required:
                  - name
              - type: string
            examples:
              default:
                value:
                  labels:
                  - bug
                  - enhancement
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/label'
              examples:
                default:
                  $ref: '#/components/examples/label-items'
        '301':
          $ref: '#/components/responses/moved_permanently'
        '404':
          $ref: '#/components/responses/not_found'
        '410':
          $ref: '#/components/responses/gone'
        '422':
          $ref: '#/components/responses/validation_failed'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: issues
        subcategory: labels
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      summary: GitHub Remove All Labels from an Issue
      description: This API operation removes all labels that have been applied to a specific issue in a GitHub repository. By sending a DELETE request to the endpoint with the repository owner, repository name, and issue number, all existing labels associated with that issue will be cleared in a single operation. This is useful when you need to reset an issue's categorization or when reorganizing your labeling system, allowing you to start fresh without having to remove labels individually. The operation requires appropriate authentication and write access to the repository's issues.
      tags:
      - Labels
      operationId: removeAllLabelsFromAnIssue
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/issues/labels#remove-all-labels-from-an-issue
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/issue-number'
      - 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:
        '204':
          description: Response
        '301':
          $ref: '#/components/responses/moved_permanently'
        '404':
          $ref: '#/components/responses/not_found'
        '410':
          $ref: '#/components/responses/gone'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: issues
        subcategory: labels
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}:
    delete:
      summary: GitHub Remove Label from an Issue
      description: Removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a `404 Not Found` status if the label does not exist.
      tags:
      - Labels
      operationId: removeLabelFromAnIssue
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/issues/labels#remove-a-label-from-an-issue
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/issue-number'
      - name: name
        in: path
        required: true
        schema:
          type: string
        example: octocat
      - 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:
                type: array
                items:
                  $ref: '#/components/schemas/label'
              examples:
                default:
                  $ref: '#/components/examples/label-items-2'
        '301':
          $ref: '#/components/responses/moved_permanently'
        '404':
          $ref: '#/components/responses/not_found'
        '410':
          $ref: '#/components/responses/gone'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: issues
        subcategory: labels
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /orgs/{org}/actions/runners/{runner_id}/labels:
    get:
      summary: GitHub List Labels for Self-hosted Runner for an Organization
      description: 'Lists all labels for a self-hosted runner configured in an organization.


        Authenticated users must have admin access to the organization to use this endpoint.


        OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.'
      tags:
      - Labels
      operationId: listLabelsForSelfhostedRunnerForAnOrganization
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-an-organization
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/runner-id'
      responses:
        '200':
          $ref: '#/components/responses/actions_runner_labels'
        '404':
          $ref: '#/components/responses/not_found'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: self-hosted-runners
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      summary: GitHub Add Custom Labels to Self-hosted Runner for an Organization
      description: 'Adds custom labels to a self-hosted runner configured in an organization.


        Authenticated users must have admin access to the organization to use this endpoint.


        OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.'
      tags:
      - Labels
      operationId: addCustomLabelsToSelfhostedRunnerForAnOrganization
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-an-organization
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/runner-id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - labels
              properties:
                labels:
                  type: array
                  minItems: 1
                  maxItems: 100
                  description: The names of the custom labels to add to the runner.
                  items:
                    type: string
            examples:
              default:
                value:
                  labels:
                  - gpu
                  - accelerated
      responses:
        '200':
          $ref: '#/components/responses/actions_runner_labels'
        '404':
          $ref: '#/components/responses/not_found'
        '422':
          $ref: '#/components/responses/validation_failed_simple'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: self-hosted-runners
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    put:
      summary: GitHub Set Custom Labels for Self-hosted Runner for an Organization
      description: 'Remove all previous custom labels and set the new custom labels for a specific

        self-hosted runner configured in an organization.


        Authenticated users must have admin access to the organization to use this endpoint.


        OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.'
      tags:
      - Labels
      operationId: setCustomLabelsForSelfhostedRunnerForAnOrganization
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-an-organization
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/runner-id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - labels
              properties:
                labels:
                  type: array
                  minItems: 0
                  maxItems: 100
                  description: The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels.
                  items:
                    type: string
            examples:
              default:
                value:
                  labels:
                  - gpu
                  - accelerated
      responses:
        '200':
          $ref: '#/components/responses/actions_runner_labels'
        '404':
          $ref: '#/components/responses/not_found'
        '422':
          $ref: '#/components/responses/validation_failed_simple'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: self-hosted-runners
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      summary: GitHub Remove All Custom Labels from Self-hosted Runner for an Organization
      description: 'Remove all custom labels from a self-hosted runner configured in an

        organization. Returns the remaining read-only labels from the runner.


        Authenticated users must have admin access to the organization to use this endpoint.


        OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.'
      tags:
      - Labels
      operationId: removeAllCustomLabelsFromSelfhostedRunnerForAnOrganization
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-an-organization
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/runner-id'
      responses:
        '200':
          $ref: '#/components/responses/actions_runner_labels_readonly'
        '404':
          $ref: '#/components/responses/not_found'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: self-hosted-runners
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /orgs/{org}/actions/runners/{runner_id}/labels/{name}:
    delete:
      summary: GitHub Remove Custom Label from Self-hosted Runner for an Organization
      description: 'Remove a custom label from a self-hosted runner configured

        in an organization. Returns the remaining labels from the runner.


        This endpoint returns a `404 Not Found` status if the custom label is not

        present on the runner.


        Authenticated users must have admin access to the organization to use this endpoint.


        OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.'
      tags:
      - Labels
      operationId: removeCustomLabelFromSelfhostedRunnerForAnOrganization
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-an-organization
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/runner-id'
      - $ref: '#/components/parameters/runner-label-name'
      responses:
        '200':
          $ref: '#/components/responses/actions_runner_labels'
        '404':
          $ref: '#/components/responses/not_found'
        '422':
          $ref: '#/components/responses/validation_failed_simple'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: self-hosted-runners
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /repos/{owner}/{repo}/actions/runners/{runner_id}/labels:
    get:
      summary: GitHub List Labels for Self-hosted Runner for Repository
      description: 'Lists all labels for a self-hosted runner configured in a repository.


        Authenticated users must have admin access to the repository to use this endpoint.


        OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.'
      tags:
      - Labels
      operationId: listLabelsForSelfhostedRunnerForRepository
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-a-repository
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/runner-id'
      - 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':
          $ref: '#/components/responses/actions_runner_labels'
        '404':
          $ref: '#/components/responses/not_found'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: self-hosted-runners
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      summary: GitHub Add Custom Labels to Self-hosted Runner for Repository
      description: 'Adds custom labels to a self-hosted runner configured in a repository.


        Authenticated users must have admin access to the organization to use this endpoint.


        OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.'
      tags:
      - Labels
      operationId: addCustomLabelsToSelfhostedRunnerForRepository
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-a-repository
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/runner-id'
      - 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:
              type: object
              required:
              - labels
              properties:
                labels:
                  type: array
                  minItems: 1
                  maxItems: 100
                  description: The names of the custom labels to add to the runner.
                  items:
                    type: string
            examples:
              default:
                value:
                  labels:
                  - gpu
                  - accelerated
      responses:
        '200':
          $ref: '#/components/responses/actions_runner_labels'
        '404':
          $ref: '#/components/responses/not_found'
        '422':
          $ref: '#/components/responses/validation_failed_simple'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: self-hosted-runners
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    put:
      summary: GitHub Set Custom Labels for Self-hosted Runner for Repository
      description: 'Remove all previous custom labels and set the new custom labels for a specific

        self-hosted runner configured in a repository.


        Authenticated users must have admin access to the repository to use this endpoint.


        OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.'
      tags:
      - Labels
      operationId: setCustomLabelsForSelfhostedRunnerForRepository
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-a-repository
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/runner-id'
      - 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:
              type: object
              required:
              - labels
              properties:
                labels:
                  type: array
                  maxItems: 100
                  description: The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels.
                  items:
                    type: string
            examples:
              default:
                value:
                  labels:
                  - gpu
                  - accelerated
      responses:
        '200':
          $ref: '#/components/responses/actions_runner_labels'
        '404':
          $ref: '#/components/responses/not_found'
        '422':
          $ref: '#/components/responses/validation_failed_simple'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: self-hosted-runners
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      summary: GitHub Remove All Custom Labels from Self-hosted Runner for Repository
      description: 'Remove all custom labels from a self-hosted runner configured in a

        repository. Returns the remaining read-only labels from the runner.


        Authenticated users must have admin access to the repository to use this endpoint.


        OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.'
      tags:
      - Labels
      operationId: removeAllCustomLabelsFromSelfhostedRunnerForRepository
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-a-repository
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/runner-id'
      - 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
        exam

# --- truncated at 32 KB (661 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/openapi/github-labels-api-openapi.yml