POST/user/codespaces/{codespace_name}/exports

Export a codespace for the authenticated user

Triggers an export of the specified codespace and returns a URL and ID where the status of the export can be monitored.

If changes cannot be pushed to the codespace's repository, they will be pushed to a new or previously-existing fork instead.

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

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

1 parameter
codespace_namestringrequired
The name of the codespace.

6 status codes
202Response
statestringoptional
State of the latest export
completed_atstringoptional
Completion time of the last export operation
branchstringoptional
Name of the exported branch
shastringoptional
Git commit SHA of the exported branch
idstringoptional
Id for the export details
export_urlstringoptional
Url for fetching export details
html_urlstringoptional
Web url for the exported branch
401Requires authentication
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
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
500Internal Error
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional

Error handling

A 401 is returned: Requires authentication. A 403 is returned: Forbidden. 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.

Was this helpful?