Skip to content

Manage access control for organization codespaces

Deprecated
PUT
/orgs/{org}/codespaces/access

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.

API method documentation

org
required
string

The organization name. The name is not case sensitive.

Media type application/json
object
visibility
required

Which users can access codespaces in the organization. disabled means that no users can access codespaces in the organization.

string
Allowed values: disabled selected_members all_members all_members_and_outside_collaborators
selected_usernames

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.

Array<string>
<= 100 items
Examples
Example default
{
"visibility": "selected_members",
"selected_usernames": [
"johnDoe",
"atomIO"
]
}

Response when successfully modifying permissions.

Not modified

Users are neither members nor collaborators of this organization.

Resource not found

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

Validation failed, or the endpoint has been spammed.

Media type application/json
Validation Error

Validation Error

object
message
required
string
documentation_url
required
string
errors
Array<object>
object
resource
string
field
string
message
string
code
required
string
index
integer
value
One of:
string
nullable
Example generated
{
"message": "example",
"documentation_url": "example",
"errors": [
{
"resource": "example",
"field": "example",
"message": "example",
"code": "example",
"index": 1,
"value": [
"example"
]
}
]
}

Internal Error

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}