Skip to content

client.projects.team_grants

client.projects.team_grants — the projects.teamGrants operations.

On AsyncKindgi every method is the same, awaited.

list(
project_id: str | UUID,
/,
*,
limit: int | None = None,
cursor: str | None = None,
timeout: float | None = None,
) -> TeamProjectGrantCollectionPage

List the teams with a role on a project. GET /v1/projects/{projectId}/team-grants

Every member of a team holds its role on the project. For the project's editors and admins (write). Each grant names its team and project.

add(
project_id: str | UUID,
body: AddTeamProjectGrantBody | Mapping[str, Any] | None = None,
/,
*,
idempotency_key: str | None = None,
timeout: float | None = None,
**fields: Any,
) -> TeamProjectGrant

Give a team a role on a project. POST /v1/projects/{projectId}/team-grants

Every member of the team (its admins included) then holds the role on the project. Takes admin on the project and read on the team: a project is given only to a team you can read. A team's role is viewer, editor or admin: a team never owns a project. Adding a role the team already holds answers 201 with the existing grant; another role, 409 team-grant-exists naming the one it holds (details.role): use PATCH to change it.

update_role(
project_id: str | UUID,
team_id: str | UUID,
body: UpdateTeamProjectGrantBody | Mapping[str, Any] | None = None,
/,
*,
idempotency_key: str | None = None,
timeout: float | None = None,
**fields: Any,
) -> None

Change a team's role on a project. PATCH /v1/projects/{projectId}/team-grants/{teamId}

remove(
project_id: str | UUID,
team_id: str | UUID,
/,
*,
idempotency_key: str | None = None,
timeout: float | None = None,
) -> None

Take a team's role on a project away (idempotent). DELETE /v1/projects/{projectId}/team-grants/{teamId}