Skip to content

Add member to business

Request

Add a user as a member of the business. Requires BUSINESS auth (min role: ADMIN) or TENANT admin.

Security
projectKey or authJWT
Path
businessIdstringrequired
Bodyapplication/jsonrequired
userIdstringrequired

The user ID to add as a member

rolestringrequired

The role to assign (permissions derived from role)

Default:"VIEWER"
Enum:"OWNER""ADMIN""EDITOR""VIEWER"
curl -i -X POST \
  'https://docs.pers.ninja/_mock/swagger/businesses/{businessId}/members' \
  -H 'Content-Type: application/json' \
  -H 'x-project-key: YOUR_API_KEY_HERE' \
  -d '{
    "userId": "string",
    "role": "OWNER"
  }'

Responses

Bodyapplication/json
idstringrequired

Unique identifier for this membership

userIdstringrequired

The user ID who has access to this business

businessIdstringrequired

The business ID this membership belongs to

rolestringrequired

The role the user has in this business. Permissions are derived from role.

Enum:"OWNER""ADMIN""EDITOR""VIEWER"
Example:"OWNER"
createdAtstring, (date-time)

When the membership was created

updatedAtstring, (date-time)

When the membership was last updated

includedobject

Included related entities. Only populated when include parameter is specified.

Response
{ "id": "string", "userId": "string", "businessId": "string", "role": "OWNER", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "included": { "user": {}, "business": {} } }