POST
/
users
/
{userId}
/
principal
curl --request POST \
  --url https://api.sulu.sh/v0/users/{userId}/principal \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "organization": "<string>",
  "roles": [
    "<string>"
  ]
}'
{
  "id": "<string>",
  "userId": "<string>",
  "organizationId": "<string>",
  "roles": [
    "<string>"
  ],
  "createdAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

userId
string
required

Unique identifier for a user

Body

application/json
organization
string
required

Organization ID for the new principal

roles
string[]
required

Roles to assign to the principal

Response

201
application/json
Principal created successfully
id
string
userId
string

Unique identifier for a user

organizationId
string

Unique identifier for an organization

roles
string[]

Roles assigned to the principal

createdAt
string

The date and time when the principal was created