Sample - GitHub REST API
PUT/orgs/{org}/codespaces/accessDeprecated

Manage access control for organization codespaces

Sets which users can access codespaces in an organization. This is synonymous with granting or revoking codespaces access permissions for users according to the visibility. OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

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

1 parameter · 2 body fields
orgstringrequired
The organization name. The name is not case sensitive.
visibilitystringrequired
Which users can access codespaces in the organization. `disabled` means that no users can access codespaces in the organization.
Allowed:disabledselected_membersall_membersall_members_and_outside_collaborators
selected_usernamesarray<string>optional
The usernames of the organization members who should have access to codespaces in the organization. Required when `visibility` is `selected_members`. The provided list of usernames will replace any existing value.

6 status codes
204Response when successfully modifying permissions.
304Not modified
400Users are neither members nor collaborators of this organization.
404Resource not found
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
422Validation failed, or the endpoint has been spammed.
messagestringrequired
documentation_urlstringrequired
errorsarray<object>optional
500Internal Error
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional

Error handling

A 400 is returned: Users are neither members nor collaborators of this organization. A 404 is returned: Resource not found. A 422 is returned: Validation failed, or the endpoint has been spammed. A 500 is returned: Internal Error.