Skip to main content
POST
/
workspaces
/
{workspaceId}
/
users
/
add
Add Workspace User
curl --request POST \
  --url https://api.raydocs.com/workspaces/{workspaceId}/users/add \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "jsmith@example.com",
  "role": "admin"
}
'

Authentication & Scope

Requires the workspace-users-write ability.

Request

POST /workspaces/1/users/add HTTP/1.1
Host: api.raydocs.com
Authorization: Bearer <token>
Content-Type: application/json

{
  "email": "newuser@example.com",
  "role": "user"
}

Path Parameters

ParameterTypeRequiredDescription
workspaceIdintegerYesThe workspace ID

Body Parameters

ParameterTypeRequiredDescription
emailstringYesEmail address of the user to add
rolestringYesRole to assign: admin, user, or readonly

Response

200 OK – User added or invitation sent.
{
  "message": "User added successfully"
}
Or if the user doesn’t exist:
{
  "message": "Invitation sent",
  "invite_id": 123
}
422 Unprocessable Entity – User is already a member or validation error.

Authorizations

Authorization
string
header
required

Personal Access Token

Path Parameters

workspaceId
integer
required

Body

application/json
email
string<email>
required
role
enum<string>
required
Available options:
admin,
user,
readonly

Response

User added or invited