Sample - GitHub REST API
PUT/orgs/{org}/copilot/content_exclusion

Set Copilot content exclusion rules for an organization

Replaces an organization's Copilot content exclusion path rules. Use org to identify the organization and submit an object whose values are arrays of supported exclusion entries; the authenticated user must be an organization owner using an OAuth app token or classic personal access token with the copilot scope. Existing comments are deleted, and duplicate keys overwrite earlier entries so only the final value is saved.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

1 parameter
orgstringrequired
The organization name whose Copilot content exclusion rules to replace. The name is not case sensitive.

7 status codes
200Returns an object containing a `message` confirming that the Copilot content exclusion rules were set.
messagestringoptional
401Returned when the request does not include valid authentication.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
403Returned when the authenticated user is not an organization owner or the token lacks the required `copilot` scope.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
404Returned when the specified organization cannot be found or accessed.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
413Returned when the request payload is too large.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
422Returned when validation fails or the endpoint determines that the request has been spammed.
messagestringrequired
documentation_urlstringrequired
errorsarray<string>optional
500Returned when an internal server error occurs.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional

Error handling

A 401 is returned when the request lacks valid authentication. A 403 is returned when the authenticated user is not an organization owner or the token lacks the copilot scope, and a 404 is returned when org does not identify an accessible organization. A 413 indicates that the request payload is too large, a 422 indicates validation failure or suspected spam, and a 500 indicates an internal server error; each rule value must be an array containing supported path strings or conditional rule objects.