Skip to content
UneeqUneeqUneeq Docs

Set a team member's role

PUT
/external/v1/organization/{organizationID}/teams/{teamID}/users/{userID}/role
curl --request PUT \
--url "$UNEEQ_API_URL/external/v1/organization/$UNEEQ_ORG_ID/teams/{teamID}/users/{userID}/role" \
--header "Authorization: Bearer $UNEEQ_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"role": "manager"
}'

Sets the user’s role within the team to member or manager. A team manager can see the training data of the team’s members. The user must already be in the team; add them first. Setting the role a user already has succeeds.

organizationID
required
string

ID of the organization the API key belongs to, for example org_HYPCX67vaupjhdTn.

Example

org_HYPCX67vaupjhdTn
teamID
required
string format: uuid

ID of a live team in the organization. Must be a lowercase hyphenated UUID.

userID
required
string format: uuid

ID of a user who is already a member of the team. Must be a lowercase hyphenated UUID.

Media typeapplication/json
object
role
required

The user’s role within the team.

string
Allowed values: member manager

Example

{
"role": "manager"
}

The role was set.

teamID or userID is not a lowercase UUID (message invalid request); the body is empty, not valid JSON or has a field of the wrong type (message invalid request body); or role is missing or not member/manager (message invalid request). No error_code.

Media typeapplication/json

The body of an error returned by an endpoint.

object
message
required

Human-readable explanation of what went wrong.

string
error_code

Stable machine-readable cause. Present only for errors that have one.

string

Example generated

{
"message": "example",
"error_code": "example"
}

The Authorization header is missing, or the API key is not valid for this organization. A key check that fails on the server is also reported as 401.

Media typeapplication/json

The body of an error returned before the request reaches an endpoint (authentication and rate limiting).

object
error
required

Human-readable explanation of what went wrong.

string

Example generated

{
"error": "example"
}

The team does not exist, was deleted, or is not in this organization (message team does not belong to the requested organization, no error_code).

Media typeapplication/json

The body of an error returned by an endpoint.

object
message
required

Human-readable explanation of what went wrong.

string
error_code

Stable machine-readable cause. Present only for errors that have one.

string

Example generated

{
"message": "example",
"error_code": "example"
}

The API key has sent too many requests. Wait for the number of seconds in Retry-After, then retry.

Media typeapplication/json

The body of an error returned before the request reaches an endpoint (authentication and rate limiting).

object
error
required

Human-readable explanation of what went wrong.

string

Example generated

{
"error": "example"
}
Retry-After
integer
>= 1

Seconds to wait before retrying.

The user is not a member of the team, or the role could not be stored (message unable to updates a requested team, no error_code).

Media typeapplication/json

The body of an error returned by an endpoint.

object
message
required

Human-readable explanation of what went wrong.

string
error_code

Stable machine-readable cause. Present only for errors that have one.

string

Example generated

{
"message": "example",
"error_code": "example"
}