GitBook API API reference TeamsTeam members Control membership at the team level for cohesive role management.
Easily add or remove users from teams, as well as fine-tune their specific roles within a team to ensure secure, well-organized collaboration.
role string · enum required "The role of a team member.
"owner": Can manage team members.
"member": Is a member of the team.
Available options: owner
member
List all team members
get
https://api.gitbook.com/v1 /orgs/ {organizationId} /teams/ {teamId} /members Lists members, and their roles, for the specified organization team.
organizationId string required The unique id of the organization
teamId string required The unique ID of the Team
page string optional Identifier of the page results to fetch.
limit number · max: 1000 optional The number of results per page
Copy GET /v1/orgs/{organizationId}/teams/{teamId}/members HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Updates members of a team
put
https://api.gitbook.com/v1 /orgs/ {organizationId} /teams/ {teamId} /members Updates members of an organization team, either adding or removing them. If a the same user is included as both an add and a remove, they will be removed from the team.
organizationId string required The unique id of the organization
teamId string required The unique ID of the Team
add string[] optional A user to add. It can either be a user ID or an email.
memberships object optional
remove string[] optional A user to remove. It can either be a user ID or an email.
Copy PUT /v1/orgs/{organizationId}/teams/{teamId}/members HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 93
{
"add": [
"text"
],
"memberships": {
"ANY_ADDITIONAL_PROPERTY": {
"role": "owner"
}
},
"remove": [
"text"
]
}
Add a team member
put
https://api.gitbook.com/v1 /orgs/ {organizationId} /teams/ {teamId} /members/ {userId} Add or updates member in the specified organization team.
organizationId string required The unique id of the organization
teamId string required The unique ID of the Team
userId string required The unique ID of the User
role string · enum optional "The role of a team member.
"owner": Can manage team members.
"member": Is a member of the team.
Available options: owner
member
Copy PUT /v1/orgs/{organizationId}/teams/{teamId}/members/{userId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 16
{
"role": "owner"
}
Delete a team member
delete
https://api.gitbook.com/v1 /orgs/ {organizationId} /teams/ {teamId} /members/ {userId} Deletes member from the specified organization team.
organizationId string required The unique id of the organization
teamId string required The unique ID of the Team
userId string required The unique ID of the User
Copy DELETE /v1/orgs/{organizationId}/teams/{teamId}/members/{userId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*