Skip to content

Get who can use a project's repository

GET
/projects/{projectId}/repository/access
Code sample: Shell / cURL
curl --request GET \
--url https://example.com/api/v1/projects/example/repository/access \
--header 'Authorization: Bearer <token>'

Returns the teams and people who can use the repository linked to the project, whether it holds agents back, the project’s teams that cannot use it yet and, for a caller with github.manage, who can be added. Read live from GitHub. A project the caller cannot reach answers 404; a project with no linked repository, or one outside the managed organization, answers 409. Requires github.view.

projectId
required

Project identifier (CUID2).

string
>= 1 characters

Project identifier (CUID2).

Who can use the repository.

Media typeapplication/json
object
data
required
object
choices
required

Who can be added; null for a caller without github.manage.

Any of:
object
people
required
Array<object>
object
label
required
string
login
required
string
teams
required
Array<object>
object
defaultPermission
required
string
label
required
string
slug
required
string
people
required

People with direct access, such as outside collaborators.

Array<object>
object
avatarUrl
required
string
login
required
string
memberName
required

The team member who connected this GitHub account, when there is one.

string | null
permission
required
string
profileUrl
required
string
repository
required
object
defaultBranch
required
string
fullName
required
string
name
required
string
profileUrl
required
string
rules
required
Any of:
object
branch
required
string
isProtectedForAgents
required

Whether the repository holds the App back the way a code agent’s token requires: the default branch restricts updates and every branch outside agent/ restricts creations, updates and deletions, through rules the App cannot bypass.

boolean
reason
required

What is missing when it is not.

string | null
teams
required
Array<object>
object
chelseaTeamName
required

The Chelsea team linked to this GitHub team, when there is one.

string | null
name
required
string
permission
required
string
slug
required
string
teamsWithoutAccess
required

Teams assigned to the project and linked to a GitHub team that cannot use the repository yet.

Array<object>
object
defaultPermission
required
string
slug
required
string
teamId
required
string
teamName
required
string
unavailable
required

The parts that could not be read; the rest is still returned.

Array<string>
Allowed values: teams collaborators rules

Example

{
"data": {
"unavailable": [
"teams"
]
}
}

Unauthorized.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Forbidden.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Not found.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Conflict.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

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).

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Rate limit exceeded. Wait for Retry-After before retrying.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}
RateLimit-Limit
string
/^\d+$/

Maximum requests in the current quota window.

RateLimit-Policy
string

Quota policy in requests and window seconds, for example 60;w=60.

RateLimit-Remaining
string
/^\d+$/

Requests left in this quota window (zero when blocked).

RateLimit-Reset
string
/^\d+$/

Seconds until the current quota window resets, when available from the rate-limit store.

Retry-After
string
/^\d+$/

Seconds until another request may be attempted.