Skip to content

POST /organization/token/{profile}

The POST /organization/token/{profile} endpoint returns GitHub installation tokens in JSON 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.

HeaderRequiredDescription
AuthorizationYesBearer token containing JWT
Content-TypeYesapplication/json

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

org:{profile-name}

Example: POST /organization/token/org:deploy

The request body is expected to be empty.

{
"token": "ghs_...",
"expiresAt": "2025-01-15T10:30:00Z"
}

When the requested repository is not in the profile’s repository list, the endpoint returns a successful empty response. This allows credential helpers to fall through to other authentication methods.

Status codeConditionResponse
400 Bad RequestInvalid profile formatJSON error
401 UnauthorizedMissing or invalid JWTJSON error
403 ForbiddenInsufficient JWT claimsJSON error
404 Not FoundProfile does not existJSON error
500 Server ErrorToken vending or GitHub errorJSON error