Skip to content
Product Docs

Add Users To Organization

PUT/api/v1/organizations/{organization_id}/users

Add a user to an organization.

Path ParametersExpand Collapse
organization_id: string
Cookie ParametersExpand Collapse
session: optional string
Body ParametersJSONExpand Collapse
body: array of object { project_ids, email, role_id, user_id }
project_ids: array of string

The project IDs to add the user to.

email: optional string

The user’s email address.

formatemail
role_id: optional string

The role ID to assign to the user.

formatuuid
user_id: optional string

The user’s ID.

ReturnsExpand Collapse
id: string

Unique identifier

formatuuid
organization_id: string

The organization’s ID.

formatuuid
roles: array of UserOrganizationRole { id, organization_id, role, 4 more }

The roles of the user in the organization.

id: string

Unique identifier

formatuuid
organization_id: string

The organization’s ID.

formatuuid
role: Role { id, name, permissions, 2 more }

The role.

id: string

Unique identifier

formatuuid
name: string

A name for the role.

maxLength3000
minLength1
permissions: array of object { id, access, description, 3 more }

The actual permissions of the role.

id: string

Unique identifier

formatuuid
access: boolean

Whether the permission is granted or not.

description: string

A description for the permission.

name: string

A name for the permission.

maxLength3000
minLength1
created_at: optional string

Creation datetime

formatdate-time
updated_at: optional string

Update datetime

formatdate-time
created_at: optional string

Creation datetime

formatdate-time
updated_at: optional string

Update datetime

formatdate-time
user_id: string

The user’s ID.

created_at: optional string

Creation datetime

formatdate-time
project_ids: optional array of string

The project ID scope.

updated_at: optional string

Update datetime

formatdate-time
created_at: optional string

Creation datetime

formatdate-time
email: optional string

The user’s email address.

formatemail
Deprecatedinvited_by_user_email: optional string

The email address of the user who added the user to the organization.

formatemail
invited_by_user_id: optional string

The user ID of the user who added the user to the organization.

pending: optional boolean

Whether the user’s membership is pending account signup.

updated_at: optional string

Update datetime

formatdate-time
user_id: optional string

The user’s ID.

Add Users To Organization

curl https://api.cloud.llamaindex.ai/api/v1/organizations/$ORGANIZATION_ID/users \
    -X PUT \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \
    -d '[
          {
            "project_ids": [
              "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
            ],
            "email": "dev@stainless.com",
            "role_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            "user_id": "user_id"
          }
        ]'
[
  {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "roles": [
      {
        "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "role": {
          "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
          "name": "x",
          "permissions": [
            {
              "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              "access": true,
              "description": "description",
              "name": "x",
              "created_at": "2019-12-27T18:11:19.117Z",
              "updated_at": "2019-12-27T18:11:19.117Z"
            }
          ],
          "created_at": "2019-12-27T18:11:19.117Z",
          "updated_at": "2019-12-27T18:11:19.117Z"
        },
        "user_id": "user_id",
        "created_at": "2019-12-27T18:11:19.117Z",
        "project_ids": [
          "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
        ],
        "updated_at": "2019-12-27T18:11:19.117Z"
      }
    ],
    "created_at": "2019-12-27T18:11:19.117Z",
    "email": "dev@stainless.com",
    "invited_by_user_email": "dev@stainless.com",
    "invited_by_user_id": "invited_by_user_id",
    "pending": true,
    "updated_at": "2019-12-27T18:11:19.117Z",
    "user_id": "user_id"
  }
]
Returns Examples
[
  {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "roles": [
      {
        "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "role": {
          "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
          "name": "x",
          "permissions": [
            {
              "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              "access": true,
              "description": "description",
              "name": "x",
              "created_at": "2019-12-27T18:11:19.117Z",
              "updated_at": "2019-12-27T18:11:19.117Z"
            }
          ],
          "created_at": "2019-12-27T18:11:19.117Z",
          "updated_at": "2019-12-27T18:11:19.117Z"
        },
        "user_id": "user_id",
        "created_at": "2019-12-27T18:11:19.117Z",
        "project_ids": [
          "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
        ],
        "updated_at": "2019-12-27T18:11:19.117Z"
      }
    ],
    "created_at": "2019-12-27T18:11:19.117Z",
    "email": "dev@stainless.com",
    "invited_by_user_email": "dev@stainless.com",
    "invited_by_user_id": "invited_by_user_id",
    "pending": true,
    "updated_at": "2019-12-27T18:11:19.117Z",
    "user_id": "user_id"
  }
]