Skip to content

POST /organization/git-credentials/{profile}

The POST /organization/git-credentials/{profile} endpoint returns GitHub installation tokens in Git’s credential helper format, using token permissions granted by a specified organization profile.

This endpoint provides explicit control over which organization profile is used when vending GitHub tokens. Profiles allow configuring different sets of repositories and permissions for different use cases.

This endpoint serves the same underlying function as POST /organization/token/{profile} (vending GitHub installation tokens), however its request and response format follows Git’s credential helper protocol. This allows Chinmina Bridge to act as a Git credential helper, enabling transparent authentication for Git operations without requiring separate credential extraction and configuration steps.

HeaderRequiredDescription
AuthorizationYesBearer token containing Buildkite OIDC JWT
Content-TypeRecommendedShould be text/plain

The {profile} path parameter specifies which organization profile to use, in the format:

org:{profile-name}

Example: POST /organization/git-credentials/org:deploy

The request body follows Git’s credential helper input format:

protocol=https
host=github.com
path=owner/repository

When a token is successfully vended:

username=x-access-token
password=ghs_...
password_expiry_utc=1705320600

The response body is plain text with newline-separated key-value pairs. Git parses this and uses the credentials for the requested operation.

When the requested repository is not in the profile’s allowed repository list, the endpoint returns a successful but empty response. See Git credentials format for details. This allows Git credential helpers to fall through to other credential sources.

Status codeConditionResponse body
400 Bad RequestInvalid profile format or parameterJSON error message
401 UnauthorizedMissing or invalid JWTJSON error message
403 ForbiddenJWT valid but claims insufficientJSON error message
404 Not FoundProfile does not existJSON error message
500 Internal Server ErrorToken vending failure, GitHub API errorJSON error message

Error responses are returned in JSON format. Any response that Git does not recognize as valid for the format is regarded as an error and discarded.