Team Members

The /team-members endpoint represents a user's affiliation with a team. Any user with an active LionDesk subscription may be part of a team.

Limitations

Creation (sending invitations) and removal (removing team members or cancelling invitations) must be accomplished through the V1 interface.

The following fields relate to the Team Members endpoint.

AcceptedPendingDeclined
FieldLimitsRequired?Writeable?
id
NoNo

The team-member resource ID. Use this to PATCH the user's request status

request_status
YesYes

The status of the invitation request sent to the given user to join the given team

Possible values:
team.id
NoNo

The team's ID

team.name
NoNo

The name of the team

user.id
NoNo

The team member's user ID

user.first_name
NoNo

The user's first name

user.last_name
NoNo

The user's last name

user.email
NoNo

The user's email

user.username
NoNo

The user's username

user.phone
NoNo

The user's phone number

Permissions

  • Users must accept a team's invitation before seeing that team's members.
  • Users belonging to an existing team can see all team members, regardless of their status (Accepted, Pending, or Declined).
  • A user may only patch their own request_status. The creator of a team may not patch on behalf of a team member.
  • If the creator of a team deletes their account, the team members lose visibility of each other.

Be careful! Team members who have Pending or Declined invitations typically can't be interacted with until they have Accepted. You'll often want to filter by request_status=Accepted.

Update one Team Member

To update some attributes on one team member:

PATCH https://api-v2.liondesk.com//team-members/10 headers: { Authorization: "Bearer [access token]", Content-Type: "application/json" }

data: {
request_status: "Accepted"
}

Get One Team Member

To get one team member:

GET https://api-v2.liondesk.com//team-members/1 headers: { Authorization: "Bearer [access token]", Content-Type: "application/json" }

The response object will have this form:{ "id": 1, "request_status": "Accepted", "team": { "id": 3, "name": "BestTeamEver" }, "user": { "id": 1, "first_name": "Samuel", "last_name": "Jackson", "email": "samueljackson@me.com", "username": "samueljackson@me.com", "phone": "+1 (123) 555-5434" } }

Find All Team Members

You find/search team members by issuing a GET request to the base endpoint:

GET https://api-v2.liondesk.com//team-members headers: { Authorization: "Bearer [access token]", Content-Type: "application/json" }

The response will contain an array of team member objects, like so:

{ "total": 2, "limit": 10, "skip": 0, "data": [ { "id": 1, "request_status": "Accepted", "team": { "id": 3, "name": "BestTeamEver" }, "user": { "id": 1, "first_name": "Samuel", "last_name": "Jackson", "email": "samueljackson@me.com", "username": "samueljackson@me.com", "phone": "+1 (123) 555-5434" } }, { "id": 9, "request_status": "Pending", "team": { "id": 4, "name": "Tiger Chair" }, "user": { "id": 2, "first_name": "Scarlett", "last_name": "Brown", "email": "scarlettbrown@me.com", "username": "scarlettbrown@me.com", "phone": "+1 (604) 555-9087" } } ] }

Filtering Team Members

The /team-members endpoint provides nested filtering capabilities, using dot-notation to target nested fields (see below).

Note that this capability is currently in trial and is not yet available on other endpoints.

Equality

You may query team member fields directly by specifying equality parameters in the request URI:GET /team-members?team.id=4&request_status=Accepted&user.id=1&id=2

You may wish to exclude results having some value with $ne:GET /team-members?team.id[$ne]=1

Limiting and Pagination

$limit will return only the number of results you specify: GET /team-members?$limit=2

$skip will skip the specified number of results, useful for paginating:GET /team-members?team.id=1&$limit=2&$skip=2

Sorting

$sort will order results based on the field given.

Use 1 for ascending order, and -1 for descending order:GET /team-members?$limit=10&$sort[user.id]=-1