Sample - GitHub REST API
DELETE/orgs/{org}/agents/variables/{name}/repositories/{repository_id}

Remove a selected repository from an organization variable

Deletes a repository from an organization agent variable that is available to selected repositories. Use org, name, and repository_id to identify the organization variable and repository, and ensure the variable visibility is set to selected. Use an OAuth app token or classic personal access token with the admin:org scope, and add the repo scope when the repository is private.

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

3 parameters
orgstringrequired
The organization name. The name is not case sensitive.
namestringrequired
The name of the organization agent variable.
repository_idintegerrequired
The numeric identifier of the repository to remove from the variable.

2 status codes
204Returns no content after removing the repository from the organization variable.
409Returned when the variable's visibility is not set to `selected`.

Error handling

A 409 is returned when the variable's visibility is not set to selected. The authenticated user must have collaborator access to the repository, and OAuth app tokens or classic personal access tokens must include admin:org; private repositories also require repo.