Set a project's repo connection
const url = 'https://example.com/v1/projects/example/repo-connection';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"connectionId":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/v1/projects/example/repo-connection \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "connectionId": "example" }'The company-wide GitHub connection the project opens its block changes’ pull requests through. For the project’s admins (admin on it). It replaces any connection set before; setting the one already set answers 200 unchanged. The connection must be the workspace’s, made through the GitHub app entry, and owned by the company: 404 connection-not-found for one that isn’t there or was removed, and 400 repo-connection-not-company-github for any other. The project keeps only the id: a connection removed later reads as none. 501 repo-connection-unsupported from a runtime that can’t keep one, or has no connections.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Examplegenerated
{ "connectionId": "example"}Responses
Section titled “Responses”The connection is set.
object
Examplegenerated
{ "projectId": "example", "repoConnectionId": "example"}Malformed request body (bad-input), or the connection isn’t a company-wide GitHub connection (repo-connection-not-company-github, details.connectionId, details.app, details.owner).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}No project with that id under this workspace (project-not-found), or no connection with that id (connection-not-found).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Idempotency-Key was reused with a different body, or resource-state conflict. Or idempotency-key-in-flight (with Retry-After): a request with the same Idempotency-Key still runs, so this one wasn’t run; send it again after Retry-After to get that request’s answer.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”The request body is over the API’s limit (request-too-large; details.maxBytes says how much).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}rate-limit-exceeded with details.limit: "api-requests", on a runtime that sets workspace limits (Kindgi Cloud): this workspace’s limit on API requests a minute is reached, so the request wasn’t run; Retry-After says when to send it again.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”Server error (unmapped domain code or framework crash).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The runtime can’t connect a project to a repo (repo-connection-unsupported).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The Idempotency-Key store (idempotency-store-unavailable) or the authorization store (authz-backend-unavailable) couldn’t be reached before the request ran, or the database was too busy for its authorization check (database-busy), so nothing was changed; Retry-After (whole seconds) says when to try again with the same key. Or tenant-state-unavailable (with Retry-After), on a runtime serving many workspaces: the workspace’s state couldn’t be read, so nothing was changed.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”See also
DELETE /v1/projects/{projectId}/repo-connection: Clear a project's repo connectionGET /v1/projects/{projectId}: Fetch a project by idPATCH /v1/projects/{projectId}: Partially update a projectDELETE /v1/projects/{projectId}: Delete a project (idempotent)- Kindgi 0.4.0
- Error code
authz-backend-unavailable - Error code
bad-input - Error code
connection-not-found - Error code
database-busy - Error code
idempotency-key-in-flight - Error code
idempotency-store-unavailable - Error code
project-not-found - Error code
rate-limit-exceeded - Error code
repo-connection-not-company-github - Error code
repo-connection-unsupported - Error code
request-too-large - Error code
tenant-state-unavailable - Every error code