Cubicle

Add a member to an organization

POST
/v1/orgs/{org}/members

Gives an existing Cubicle user a role in the organization. The user is found by identity, matched exactly: case-sensitive and not trimmed. This route cannot invite someone who has no account.

The route writes the membership whether or not one exists:

  • A user who is not a member becomes one with role.
  • An active member's role is set to role, higher or lower than before. role defaults to member when omitted.
  • A removed member becomes active again with role, and the Box grants they held before apply again.

Owners and admins may call this route. Setting role: "owner" needs the owner role; an admin may still set an owner's role to admin or member. It needs a sign-in session; API keys are refused.

Service accounts hold only member or admin, and only in their own organization; create them with Create a service account. See Change a member's role before you lower an owner's role.

Authorization

session
headerAuthorizationBearer <token>

A sign-in session token (jvs_…) from the Dashboard, cubicle login or the device authorization flow.

Path Parameters

org*string

The organization's ID or name. An organization where the caller is not an active member returns 404.

Request Body

application/json
  1. body
identity*string
Length3 <= length <= 254
role?string
Default"member"
Value in"owner""admin""member"

Response Body

The membership as written, for a new or an existing member alike.

application/json
  1. response
id*string

The user's ID.

Formatuuid
identity*string

The identity from the request.

role*Role

The role the membership now has.

Value in"owner""admin""member"
Example Request
curl -X POST 'https://api.cubicle.sh/v1/orgs/acme/members' \  -H 'Content-Type: application/json' \  -d '{  "identity": "ada@example.com",  "role": "admin"}'
Example Response
{  "id": "2c4e6a8b-0d1f-4e3a-9b5c-7d9f1b3d5e7a",  "identity": "ada@example.com",  "role": "admin"}