---
title: "Manage access control for organization codespaces"
method: PUT
path: "/orgs/{org}/codespaces/access"
tags: ["codespaces"]
deprecated: true
---

# Manage access control for organization codespaces

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

> **Deprecated.**

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.

## Path parameters

- `org` string, required

## Request body

- object
  - `visibility` 'disabled' | 'selected_members' | 'all_members' | 'all_members_and_outside_collaborators', required — Which users can access codespaces in the organization. `disabled` means that no users can access codespaces in the organization.
  - `selected_usernames` string[] — 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.

## Response `204`

Response when successfully modifying permissions.

## Other responses

- `304` — Not modified
- `400` — Users are neither members nor collaborators of this organization.
- `404` — Resource not found
- `422` — Validation failed, or the endpoint has been spammed.
- `500` — Internal Error

---

[API](https://skmtc.net/github/apis/github-v3-rest-api-2.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api-2/versions/8ae6d0c8716e/schema)
