Add users to a team
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" ]}'const url = `${process.env.UNEEQ_API_URL}/external/v1/organization/${process.env.UNEEQ_ORG_ID}/teams/{teamID}/users`;const response = await fetch(url, { method: 'POST', headers: { Authorization: `Bearer ${process.env.UNEEQ_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "user_ids": [ "3fa85f64-5717-4562-b3fc-2c963f66afa6", "7c9e6679-7425-40de-944b-e07fc1f90ae7" ] }),});console.log(response.status, await response.text());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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”ID of the organization the API key belongs to, for example org_HYPCX67vaupjhdTn.
Example
org_HYPCX67vaupjhdTnID of a live team in the organization. Must be a lowercase hyphenated UUID.
Request Bodyrequired
Section titled “Request Bodyrequired”object
IDs of the organization users to add. Must not be null; an empty array is a no-op.
Example
{ "user_ids": [ "3fa85f64-5717-4562-b3fc-2c963f66afa6", "7c9e6679-7425-40de-944b-e07fc1f90ae7" ]}Responses
Section titled “Responses”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.
The body of an error returned by an endpoint.
object
Human-readable explanation of what went wrong.
Stable machine-readable cause. Present only for errors that have one.
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.
The body of an error returned before the request reaches an endpoint (authentication and rate limiting).
object
Human-readable explanation of what went wrong.
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).
The body of an error returned by an endpoint.
object
Human-readable explanation of what went wrong.
Stable machine-readable cause. Present only for errors that have one.
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.
The body of an error returned before the request reaches an endpoint (authentication and rate limiting).
object
Human-readable explanation of what went wrong.
Example generated
{ "error": "example"}Headers
Section titled “Headers”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.
The body of an error returned by an endpoint.
object
Human-readable explanation of what went wrong.
Stable machine-readable cause. Present only for errors that have one.
Example generated
{ "message": "example", "error_code": "example"}
