Skip to content
UneeqUneeqUneeq Docs

Add users to a team

POST
/external/v1/organization/{organizationID}/teams/{teamID}/users
curl --request POST \
--url "$UNEEQ_API_URL/external/v1/organization/$UNEEQ_ORG_ID/teams/{teamID}/users" \
--header "Authorization: Bearer $UNEEQ_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"user_ids": [
"3fa85f64-5717-4562-b3fc-2c963f66afa6",
"7c9e6679-7425-40de-944b-e07fc1f90ae7"
]
}'

Adds the listed users to the team with the team role member. Every user must belong to this organization with a role; a user may be active, inactive or invited, but not deleted and not holding an expired invitation. If any user fails that check nothing is added and the call returns 400. Users already in the team are left unchanged (their team role is kept), so the call is safe to repeat. An empty array is a no-op that returns 204. No notification is sent to the users.

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.

Media typeapplication/json
object
user_ids
required

IDs of the organization users to add. Must not be null; an empty array is a no-op.

Array<string>

Example

{
"user_ids": [
"3fa85f64-5717-4562-b3fc-2c963f66afa6",
"7c9e6679-7425-40de-944b-e07fc1f90ae7"
]
}

All listed users are members of the team.

teamID is not a lowercase UUID, or user_ids is missing, null or contains a non-UUID (message invalid request); or one or more users are not members of this organization with a role (message invalid user_ids). 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, or the team could not be looked up (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 body is empty, not valid JSON, or has a field of the wrong type (message unable to decode request body); the membership check failed (message unable to get user status for the requested organization); or the users could not be added (message unable to apply add user lits to 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"
}