Memberships

1 minute read

Use the Memberships API to retrieve a list of users belonging to an organization, including organization and team IDs.

Retrieve a list of memberships

Use this endpoint to retrieve all users defined in a specified organization’s team:

Endpoint
GET /v3/organizations/{organization_id}/memberships
Parameter name In Type Required? Description

organization_id

Path

String

Yes

The ID of the organization.

Responses

The following table outlines the possible responses for this endpoint, including status codes, their meanings, and the schemas that describe the returned data or errors:

Status Code Description Schema

200

Success. Returns a list of memberships for the specified organization.

api.auth.GetmembershipsResponse

Default

Error. Occurs when the org_id or team_id is missing, invalid, or the user lacks sufficient permissions.

google.rpc.Status

Response example
{ "memberships": [{ "id": "<1>", "user_id": "<1>", "team_id":”<1>", "active":”<true>", "audit": { “who”: ”<1>", “when”: ”<timestamp>", “why”: ”<reason for the update> } }] }

Remove user from team membership

Use the Remove Membership API to send a request to remove users from a team.

Endpoint
POST /v1/organizations/{organization_id}/memberships/{team_id}/remove
Parameter name In Type Required? Description

organization_id

Path

String

Yes

The ID of the organization.

team_id

Path

String

Yes

The ID of the team.

Responses

The following table outlines the possible responses for this endpoint, including status codes, their meanings, and the schemas that describe the returned data or errors:

Status Code Description Schema

200

Success. Requests user removal from membership.

api.RemoveUsersFromTeamRequest

Default

Error. Occurs when the org_id or team_id is missing, invalid, or the user lacks sufficient permissions.

google.rpc.Status