GitHub Copilot Copilot Content Exclusion API

Manage content exclusion path rules for organizations

Operations 2

GET /orgs/{org}/copilot/content_exclusion Github Copilot Get Copilot Content Exclusion Rules for an Organization #
PUT /orgs/{org}/copilot/content_exclusion Github Copilot Set Copilot Content Exclusion Rules for an Organization #

Documentation

Specifications

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/github-copilot-copilot-content-exclusion-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

github-copilot-copilot-content-exclusion-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: GitHub Copilot REST Copilot Billing Copilot Content Exclusion API
  description: REST API for managing GitHub Copilot seat assignments, billing, usage metrics, content exclusion rules, and organizational settings. Covers user management, aggregated metrics, usage reports, and content governance across organizations and enterprises.
  version: 1.0.0
  contact:
    name: GitHub Support
    url: https://support.github.com
    email: support@github.com
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  x-logo:
    url: https://github.githubassets.com/images/modules/site/copilot/copilot-logo.png
servers:
- url: https://api.github.com
  description: GitHub REST API
security:
- BearerToken: []
- OAuthToken: []
tags:
- name: Copilot Content Exclusion
  description: Manage content exclusion path rules for organizations
paths:
  /orgs/{org}/copilot/content_exclusion:
    get:
      operationId: getCopilotContentExclusionRules
      summary: Github Copilot Get Copilot Content Exclusion Rules for an Organization
      description: Gets information about an organization's Copilot content exclusion path rules. These rules define which files and directories Copilot is prevented from accessing.
      tags:
      - Copilot Content Exclusion
      parameters:
      - $ref: '#/components/parameters/Org'
      responses:
        '200':
          description: Content exclusion rules
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentExclusionRules'
              examples:
                Getcopilotcontentexclusionrules200Example:
                  summary: Default getCopilotContentExclusionRules 200 response
                  x-microcks-default: true
                  value: {}
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    put:
      operationId: setCopilotContentExclusionRules
      summary: Github Copilot Set Copilot Content Exclusion Rules for an Organization
      description: Sets Copilot content exclusion path rules for an organization. Replaces existing rules with the provided set.
      tags:
      - Copilot Content Exclusion
      parameters:
      - $ref: '#/components/parameters/Org'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContentExclusionRules'
            examples:
              SetcopilotcontentexclusionrulesRequestExample:
                summary: Default setCopilotContentExclusionRules request
                x-microcks-default: true
                value: {}
      responses:
        '200':
          description: Content exclusion rules updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Content exclusion rules updated successfully.
              examples:
                Setcopilotcontentexclusionrules200Example:
                  summary: Default setCopilotContentExclusionRules 200 response
                  x-microcks-default: true
                  value:
                    message: example_value
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '413':
          description: Payload too large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Setcopilotcontentexclusionrules413Example:
                  summary: Default setCopilotContentExclusionRules 413 response
                  x-microcks-default: true
                  value:
                    message: example_value
                    documentation_url: https://www.example.com
        '422':
          $ref: '#/components/responses/ValidationFailed'
        '500':
          $ref: '#/components/responses/InternalError'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  responses:
    Forbidden:
      description: Forbidden - insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Requires authentication
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ValidationFailed:
      description: Validation failed or endpoint has been spammed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    ContentExclusionRules:
      type: object
      description: Content exclusion rules mapping repository names to arrays of file path patterns that Copilot is prevented from accessing.
      additionalProperties:
        type: array
        items:
          type: string
        description: List of file path patterns to exclude for this repository.
      example:
        octo-repo:
        - /src/some-dir/kernel.rs
        - /secrets/**
    Error:
      type: object
      properties:
        message:
          type: string
          description: Human-readable error message
          example: example_value
        documentation_url:
          type: string
          format: uri
          description: Link to relevant API documentation
          example: https://www.example.com
      required:
      - message
  parameters:
    Org:
      name: org
      in: path
      required: true
      description: The organization name. Case-insensitive.
      schema:
        type: string
      example: octo-org
  securitySchemes:
    BearerToken:
      type: http
      scheme: bearer
      description: Personal access token (classic) with manage_billing:copilot, read:org, or read:enterprise scopes; or fine-grained token with GitHub Copilot Business (read) or Administration (read) permissions.
    OAuthToken:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://github.com/login/oauth/authorize
          tokenUrl: https://github.com/login/oauth/access_token
          scopes:
            manage_billing:copilot: Manage Copilot billing settings
            read:org: Read organization membership and settings
            read:enterprise: Read enterprise data
            copilot: Manage Copilot content exclusion settings
externalDocs:
  description: GitHub Copilot REST API Documentation
  url: https://docs.github.com/en/rest/copilot