Manage your team with the API
Create a team from existing organization members.
Create a team with existing members through the GitBook API.
Before you begin
You need:
An API token that can read and manage organization members.
Your organization ID.
A terminal with
curl.
For OAuth, request organization:members:read and organization:members:write.
List organization members
Request your organization’s members to find the IDs you want to add:
curl --request GET \
--url "https://api.gitbook.com/v1/orgs/$ORGANIZATION_ID/members" \
--header "Authorization: Bearer $GITBOOK_TOKEN"Copy the id for each member you want in the team.
Create a team
Create an API documentation team and assign the member IDs:
curl --request PUT \
--url "https://api.gitbook.com/v1/orgs/$ORGANIZATION_ID/teams" \
--header "Authorization: Bearer $GITBOOK_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"title": "API documentation",
"members": [
"<memberId>"
]
}'The response includes the new team’s id.
Verify the team
List teams to confirm the new team:
Use the returned team ID to list its members:
See the Organization members reference to manage members and roles.
Last updated
Was this helpful?