Sample - GitHub REST API
DELETE/orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}

Remove a repository from an organization secret

Removes a repository from an organization development environment secret's selected repository list. Use this operation when the secret's visibility is set to selected; OAuth app tokens and personal access tokens (classic) require the admin:org scope.

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

3 parameters
orgstringrequired
The organization name; matching is not case sensitive.
secret_namestringrequired
The name of the organization development environment secret.
repository_idintegerrequired
The unique integer identifier of the repository to remove from the secret's selected list.

4 status codes
204Returns no content when the repository is removed from the secret's selected repository list.
404Returned when the organization, secret, or repository cannot be found.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
409Returned when the secret's repository visibility is not set to `selected`.
422Returned when validation fails or the endpoint has been spammed.
messagestringrequired
documentation_urlstringrequired
errorsarray<object>optional

Error handling

A 404 is returned when the organization, secret, or repository cannot be found. A 409 is returned when the secret's repository visibility is not set to selected. A 422 is returned when validation fails or the endpoint has been spammed; provide valid org, secret_name, and repository_id values.