Create a project's GitHub repository
curl --request POST \ --url https://example.com/api/v1/projects/example/repository \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "template": "example" }'Creates the project’s private repository in the organization’s GitHub, named name or, without one, from the project’s code (a taken name answers 409, never a changed name; no name and no code answers 422), from template (a repository of the organization marked as a template on GitHub; one that is missing or not a template answers 422), from the template chosen in Settings when template is omitted, or empty when it is null. It adds a develop branch, protects it for agents, gives access to the GitHub teams linked to the project’s Chelsea teams, and links it to the project with pull requests going to develop. The repository stays unlinked and the call answers 409 naming it when it cannot be verified as holding agents back. It runs once per project: a project that already has a repository answers it with 200 and isCreated: false, unless name names another repository, which answers 409; while another call is creating it, 409. The body is optional. A project the caller cannot reach answers 404. Requires github.manage and the App’s Administration and Members write access.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Project identifier (CUID2).
Project identifier (CUID2).
Request Body
Section titled “Request Body”object
The repository’s name inside the organization, such as acme-theme. Omit it to name the repository from the project’s code.
Example generated
{ "name": "example", "template": "example"}Responses
Section titled “Responses”The project already had a repository.
object
object
The branch pull requests go to; null means the repository’s default branch.
true when this call created the repository. false when the project already had one, which is returned as it is.
What did not go as planned without stopping the repository from working.
The slugs of the GitHub teams given access, from the Chelsea teams of the project that are linked to one.
Example generated
{ "data": { "baseBranch": "example", "fullName": "example", "isCreated": true, "notices": [ "example" ], "teamsGranted": [ "example" ] }}The repository was created and linked.
object
object
The branch pull requests go to; null means the repository’s default branch.
true when this call created the repository. false when the project already had one, which is returned as it is.
What did not go as planned without stopping the repository from working.
The slugs of the GitHub teams given access, from the Chelsea teams of the project that are linked to one.
Example generated
{ "data": { "baseBranch": "example", "fullName": "example", "isCreated": true, "notices": [ "example" ], "teamsGranted": [ "example" ] }}Validation error. Parse failures include field paths and expectations.
Validation error with safe field paths and expected values; submitted values are never returned.
object
object
Stable machine-readable error code.
object
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Unauthorized.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Forbidden.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Not found.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Conflict.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Invalid input.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}GitHub failed (GITHUB_API_ERROR), or Chelsea’s GitHub App or the organization has not granted the access this needs (GITHUB_ACCESS_MISSING; the message names the step in Settings, Integrations, GitHub).
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Rate limit exceeded. Wait for Retry-After before retrying.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Headers
Section titled “Headers”Maximum requests in the current quota window.
Quota policy in requests and window seconds, for example 60;w=60.
Requests left in this quota window (zero when blocked).
Seconds until the current quota window resets, when available from the rate-limit store.
Seconds until another request may be attempted.
Chelsea is operated by Arepa Labs LLC