ByCloud Docs
GuidesCLIAPISDK
post/v1/iam/users

Add user to organization

Add a user to the organization by email. If the user already exists in the platform, they are added immediately. If not, an invitation email is sent and the user will be added upon accepting the invitation. Optionally specify groups to add the user to.

Request Body

required

Content-Type: application/json

email

string<email>required

Email of the user to add

group_ids

arrayoptional

IDs of groups to add the user to

Responses

201

User added or invitation sent

Content-Type: application/json

user

objectoptional

A platform user linked to this organization for IAM

invitation

objectoptional

status

stringoptional

Whether the user was added directly or an invitation was sent

Enum: "added", "invited"

400

Invalid request parameters

Content-Type: application/json

error

objectrequired
401

Authentication required or token invalid

Content-Type: application/json

error

objectrequired
403

Insufficient permissions

Content-Type: application/json

error

objectrequired
409

User is already a member or has a pending invitation

Content-Type: application/json

error

objectrequired
500

Internal server error

Content-Type: application/json

error

objectrequired
curl -X POST "https://api.spo1.mycloud.com/v1/iam/users" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "john.doe@acme.com",
"group_ids": [
"550e8400-e29b-41d4-a716-446655440000"
]
}'

Response

User added or invitation sent

{
"user": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"crn": "crn::iam:user:550e8400-e29b-41d4-a716-446655440000",
"email": "john.doe@acme.com",
"name": "John Doe",
"groups": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "string"
}
],
"added_at": "2024-01-15T10:30:00Z"
},
"invitation": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "jane.doe@example.com",
"groups": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "string"
}
],
"invited_by": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "string",
"email": "user@example.com"
},
"status": "pending",
"expires_at": "2024-01-15T10:30:00Z",
"created_at": "2024-01-15T10:30:00Z"
},
"status": "added"
}