Team member

Add and remove users to and from teams.

Part of the API reference collection

This page is part of the Crunchy Bridge API reference, and primarily meant to act as an exhaustive guide for technical integrations which are already in progress. To understand the basics of using the API, see API concepts and getting started.

The TeamMember API resource

A team member.

Content type: application/json

NameNullableTypeDescription
idstring in EID format

Primary ID of the specific team member record. This may be null for an invited team member who hasn't set up an account yet.

accountobject of type AccountTeamMemberobject

Properties of the account associated with the team member.

May be null for an invited team member who doesn't have an account yet.

roleenum string

The role assigned to the team member.

Enum admin, manager, or member.

team_idstring in EID format

The ID of the team that the team member belongs to.

account_idstring in EID format

The ID of the account that's a team member.

May be null for an invited team member who doesn't have an account yet.

Deprecated Prefer the use of id in the account subobject.

emailstring

The email address of the account that's a team member.

Deprecated Prefer the use of email in the account subobject.

namestring

Full name associated with the team member account.

May be null for an invited team member who doesn't have an account yet.

Deprecated Prefer the use of name in the account subobject.

Example

{
    "account": {
        "email": "[email protected]",
        "has_password": true,
        "has_sso": false,
        "id": "qvcw4hylovgyzbwzp53bmmlhga",
        "multi_factor_enabled": true,
        "name": "Cheshire Cat"
    },
    "account_id": "qvcw4hylovgyzbwzp53bmmlhga",
    "email": "[email protected]",
    "id": "agjjwkkw56toyhxu7xw3nt56ti",
    "name": "Cheshire Cat",
    "role": "member",
    "team_id": "eaevtjiudzeq7bsqbbpiscund4"
}

The AccountTeamMember object

A smaller, constrained set of an account's properties suitable for returning in a list of team accounts.

NameNullableTypeDescription
idstring in EID format

Primary ID of the account.

emailstring

Email associated with the account.

has_passwordboolean

Indicates that the account has a password set, as opposed to being SSO-only with no usable password. It's possible for an account to have both a password and a federated identity through a provider like Google or Microsoft.

has_ssoboolean

Indicates that the account has a federated identity for single sign-on through an identity provider like Google or Microsoft.

multi_factor_enabledboolean

Whether the account has at least one activated multi-factor source.

namestring

Full name associated with the account.

List team members

List members on a team.

This endpoint's pagination may be ordered through the order_field parameter by id and email.

GET /teams/{team_id}/members

Request

Path parameters

  • team_id: ID of the team for which to list members.

Query parameters

NameRequiredTypeDescription
cursorstring

Return only items starting after this cursor ID. When paginating, pass the value of next_cursor from the last page into this field to get the next one.

Cursor values depend on the field in order_field. Cursors will often be the primary IDs of object, but when ordering on another field like name, they'll be names (or another value) instead.

limitinteger

The maximum number of items to return on the page. Defaults to 100 with a minimum of 1 and a maximum of 200.

orderstring

The order of pagination. asc for ascending or desc for descending. Defaults to asc.

Enum asc, or desc.

order_fieldstring

The name of the field on which to paginate like id or name. Supported fields are specific to each endpoint, and it's not possible to specify any arbitrary name. See the documentation for each specific list endpoint to see which fields it supports. Defaults to id for most resources.

cURL example

curl -X GET https://api.crunchybridge.com/teams/{team_id}/members
    -H "Authorization: Bearer $CRUNCHY_API_KEY"

Response

Status: 200

Response for a team member list request.

Content type: application/json

NameNullableTypeDescription
has_moreboolean

Indicates whether or not there are more resources to page through in the collection.

next_cursorstring

A cursor value to pass to the endpoint to get the next page.

team_membersarray of array

List of team members on this team.

Example

{
    "has_more": false,
    "next_cursor": null,
    "team_members": [
        {
            "account": {
                "email": "[email protected]",
                "has_password": true,
                "has_sso": false,
                "id": "qvcw4hylovgyzbwzp53bmmlhga",
                "multi_factor_enabled": true,
                "name": "Cheshire Cat"
            },
            "account_id": "qvcw4hylovgyzbwzp53bmmlhga",
            "email": "[email protected]",
            "id": "agjjwkkw56toyhxu7xw3nt56ti",
            "name": "Cheshire Cat",
            "role": "member",
            "team_id": "eaevtjiudzeq7bsqbbpiscund4"
        }
    ]
}

Create team member

Add a user to team.

POST /teams/{team_id}/members

Request

Path parameters

  • team_id: ID of the team to which the new member will be added.

Request body schema

Content type: application/json

NameRequiredTypeDescription
access_group_idstring in EID format

ID of the access group which the new team member should be assigned to.

Should be left blank in the case where the caller is trying to automatically join a team (i.e. email is blank).

emailstring

Email is the email address of the new team member.

If left empty and the account is authenticated with SSO (single sign-on) with the right identity provider and domain, a new team member for the authenticated account is created if the team is configured to allow it.

roleenum string

Role assigned to the new team member.

Should be left blank in the case where the caller is trying to automatically join a team (i.e. email is blank).

Deprecated: This property is still supported, but access_group_id should generally be favored because it allows more specific access groups.

Enum admin, manager, or member.

Example request body

{
    "access_group_id": null,
    "email": "[email protected]",
    "role": "member"
}

cURL example

curl -X POST https://api.crunchybridge.com/teams/{team_id}/members
    -H "Authorization: Bearer $CRUNCHY_API_KEY"
    -H "Content-Type: application/json"
    -d '{"access_group_id":null,"email":"[email protected]","role":"member"}'

Response

Status: 201

Responds with the standard TeamMember API resource.

Get team member

Get a specific team member.

GET /teams/{team_id}/members/{account_id}

Request

Path parameters

  • account_id: ID of the account associated with the team member to retrieve.
  • team_id: ID of the team associated with the team member to retrieve.

cURL example

curl -X GET https://api.crunchybridge.com/teams/{team_id}/members/{account_id}
    -H "Authorization: Bearer $CRUNCHY_API_KEY"

Response

Status: 200

Responds with the standard TeamMember API resource.

Update team member

Add a team member to a team, or update a team member's role if they're already on the team.

PUT /teams/{team_id}/members/{account_id}

Request

Path parameters

  • account_id: ID of the account that will be added to the team or updated.
  • team_id: ID of the team to which the new member will be added or updated on.

Request body schema

Content type: application/json

NameRequiredTypeDescription
roleenum string

Role assigned to the team member.

Enum admin, manager, or member.

cURL example

curl -X PUT https://api.crunchybridge.com/teams/{team_id}/members/{account_id}
    -H "Authorization: Bearer $CRUNCHY_API_KEY"

Response

Status: 200

Responds with the standard TeamMember API resource.

Remove team member

Remove a user from a team.

DELETE /teams/{team_id}/members/{account_id}

Request

Path parameters

  • account_id: ID of the account who will be removed from the team.
  • team_id: ID of the team from which to remove the user.

cURL example

curl -X DELETE https://api.crunchybridge.com/teams/{team_id}/members/{account_id}
    -H "Authorization: Bearer $CRUNCHY_API_KEY"

Response

Status: 200

Responds with the standard TeamMember API resource.