DELETE/user/codespaces/secrets/{secret_name}/repositories/{repository_id}

Remove a repository from a user secret

Removes a repository from the selected repositories for an authenticated user's Codespaces secret. Use this operation to revoke the secret's access to a specific repository. The authenticated user must have Codespaces access, and OAuth app tokens and personal access tokens (classic) must include the codespace or codespace:secrets scope.

2 parameters
secret_namestringrequired
The name of the Codespaces secret to update.
repository_idintegerrequired
The unique identifier of the repository to remove from the secret's selected repositories.

5 status codes
204Returns no content after removing the repository from the secret's selected repositories.
401Returned when authentication is required but missing or invalid.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
403Returned when the authenticated user is forbidden from using this endpoint.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
404Returned when the requested resource is not found.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
500Returned when an internal error occurs.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional

Error handling

A 401 is returned when authentication is missing or invalid. A 403 is returned if the authenticated user lacks Codespaces access or the token lacks the codespace or codespace:secrets scope. A 404 indicates the secret or repository could not be found; a 500 indicates an internal error.