Skip to main content

Project members

List, add, update, and remove the members of a project.

Overview

A project member is a user with a role on a project. The role controls what they can do on that project. To add someone to a project, send them an invite. To learn more, see Project invites.

Listing and getting members need the Read role on the project. Updating and removing members need the Admin role.

To call these endpoints from the CLI, use the lk project member commands, for example lk project member list --user-auth.

Member removal and API keys

Removing a member also revokes the personal API keys they own. Service account and agent keys stay.

Removing a member who owns keys needs your confirmation:

  1. Remove the member with confirmedNumKeys set to 0.
  2. If the member owns keys, the request returns 400 and removes no one. Its MemberRemovalNotConfirmed detail in the error response gives the number of keys in numKeys.
  3. Send the request again with confirmedNumKeys set to that number.

The API also refuses a member removal that leaves a project with no API key. The detail lists the affected projects in lastKeyProjectNames. Generate another key in each of those projects first, such as a service account key.

The project member object

A user's membership on a project.

projectIdstring

The project the membership is on (p_...).

userIdstring

The user who holds the membership.

emailstring

The email address on the user account.

roleint32

The role of the user: 0 invited, 1 read, 2 write, 3 admin.

The project member object

{
"projectId": string,
"userId": string,
"email": string,
"role": int32
}

List members

GET
/v0/projects/{projectId}/members

Lists the project members, ordered by user ID.

Returns a list of ProjectMember objects, with a pageInfo cursor.

Path parameters

projectId
Required
string

The project ID (p_...).

Query parameters

page.cursorstring

The cursor of the page to return: the nextCursor of the previous page. When empty, the list starts at the first item.

page.pageSizeint32

The maximum number of items to return. When 0, the list uses its default page size.

Request

curl -X GET "https://beta-api.livekit.cloud/v0/projects/${PROJECT_ID}/members" \
-H "Authorization: Bearer $LIVEKIT_SESSION_TOKEN"

Response

{
"items": [
{
"projectId": "p_f9779j5lpvh",
"userId": "Dq7vXm3nKpR2sTwY5bZc4H",
"email": "kai@example.com",
"role": 2
}
],
"pageInfo": {
"nextCursor": "",
"hasMore": false
}
}

Get member

GET
/v0/projects/{projectId}/members/{userId}

Returns the ProjectMember object.

Path parameters

projectId
Required
string

The project ID (p_...).

userId
Required
string

The ID of the user.

Request

curl -X GET "https://beta-api.livekit.cloud/v0/projects/${PROJECT_ID}/members/${USER_ID}" \
-H "Authorization: Bearer $LIVEKIT_SESSION_TOKEN"

Response

{
"member": {
"projectId": "p_f9779j5lpvh",
"userId": "Dq7vXm3nKpR2sTwY5bZc4H",
"email": "kai@example.com",
"role": 2
}
}

Update member

PATCH
/v0/projects/{projectId}/members/{userId}

Returns the ProjectMember object.

Path parameters

projectId
Required
string

The project ID (p_...).

userId
Required
string

The ID of the user.

Request body

roleint32

Access level to set: 1 read, 2 write, 3 admin.

Request

curl -X PATCH "https://beta-api.livekit.cloud/v0/projects/${PROJECT_ID}/members/${USER_ID}" \
-H "Authorization: Bearer $LIVEKIT_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"role": 2
}'

Response

{
"member": {
"projectId": "p_f9779j5lpvh",
"userId": "Dq7vXm3nKpR2sTwY5bZc4H",
"email": "kai@example.com",
"role": 2
}
}

Remove member

DELETE
/v0/projects/{projectId}/members/{userId}

Path parameters

projectId
Required
string

The project ID (p_...).

userId
Required
string

The ID of the user.

Query parameters

confirmedNumKeysinteger

The number of the member's API keys that you agree to delete. Send 0 first. When the member owns API keys, the call fails with FailedPrecondition and a MemberRemovalNotConfirmed detail. Show its numKeys to the user, then send the request again with that number.

Response fields

numKeysinteger

The number of API keys that the removal deleted, not counting agent keys.

Request

curl -X DELETE "https://beta-api.livekit.cloud/v0/projects/${PROJECT_ID}/members/${USER_ID}" \
-G \
--data-urlencode "confirmedNumKeys=1" \
-H "Authorization: Bearer $LIVEKIT_SESSION_TOKEN"

Response

{
"numKeys": 1
}