Sample - GitHub REST API
POST/orgs/{org}/codespaces/access/selected_usersDeprecated

Add users to Codespaces access for an organization

Codespaces for the specified users will be billed to the organization.

To use this endpoint, the access settings for the organization must be set to selected_members. For information on how to change this setting, see "Manage access control for organization codespaces."

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 · 1 body field
orgstringrequired
The organization name. The name is not case sensitive.
selected_usernamesarray<string>required
The usernames of the organization members and outside collaborators whose codespaces should be billed to the organization.

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.