PUT/users/{username}/copilot-spaces/{space_number}

Set a Copilot Space for a user

Updates a Copilot Space owned by a user. Only the authenticated user can update spaces for their own account.

Users can update their personal Copilot Spaces.

OAuth app tokens and personal access tokens (classic) need the read:user scope to use this endpoint.

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

2 parameters · 5 body fields
usernamestringrequired
The handle for the GitHub user account.
space_numberintegerrequired
The unique identifier of the Copilot Space.
namestringoptional
The name of the Copilot Space.
descriptionstringoptional
A description of the Copilot Space.
general_instructionsstringoptional
General instructions for the Copilot Space.
base_rolestringoptional
The base role that determines default permissions for the space. Changing this field requires admin permissions. - `no_access`: No default access (default) - `reader`: Makes the space publicly readable Note: User spaces do not support writer or admin base roles.
Allowed:readerno_access
resources_attributesarray<object>optional
Resources to attach to the space.

4 status codes
200Response
idintegerrequired
The unique identifier of the space.
numberintegerrequired
The number that identifies the space within its owner.
namestringrequired
The display name of the space.
descriptionstringoptional
A description of the space.
general_instructionsstringoptional
General instructions for the Copilot Space.
base_rolestringrequired
The base role that determines default permissions. - `no_access`: No default access - `reader`: Default read permissions - `writer`: Default write permissions (organization spaces only) - `admin`: Default admin permissions (organization spaces only)
Allowed:readerwriteradminno_access
ownerobjectrequired
The user or organization that owns this space.
creatorobjectrequired
A GitHub user.
created_atstringrequired
The date and time the space was created.
updated_atstringrequired
The date and time the space was last updated.
html_urlstringrequired
The HTML URL of the space.
api_urlstringrequired
The API URL of the space.
resources_attributesarray<object>optional
Resources attached to the space.
403Forbidden
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
404Resource not found
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
422Validation failed, or the endpoint has been spammed.
messagestringrequired
documentation_urlstringrequired
errorsarray<object>optional

Error handling

A 403 is returned: Forbidden. A 404 is returned: Resource not found. A 422 is returned: Validation failed, or the endpoint has been spammed.

Was this helpful?