Skip to main content
POST
/
authorized_users
JavaScript
import Whop from '@whop/sdk';

const client = new Whop({
  apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});

const authorizedUser = await client.authorizedUsers.create({
  company_id: 'biz_xxxxxxxxxxxxxx',
  role: 'owner',
  user_id: 'user_xxxxxxxxxxxxx',
});

console.log(authorizedUser.id);
{
  "id": "ausr_xxxxxxxxxxxxx",
  "role": "owner",
  "user": {
    "id": "user_xxxxxxxxxxxxx",
    "name": "John Doe",
    "username": "johndoe42",
    "email": "john.doe@example.com"
  },
  "company": {
    "id": "biz_xxxxxxxxxxxxxx",
    "title": "Pickaxe"
  }
}

Authorizations

Authorization
string
header
required

A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like Bearer ***************************

Body

application/json

Parameters for CreateAuthorizedUser

company_id
string
required

The ID of the company to add the authorized user to.

Example:

"biz_xxxxxxxxxxxxxx"

role
enum<string>
required

The role to assign to the authorized user within the company. Supported roles: 'moderator', 'sales_manager'.

Available options:
owner,
admin,
sales_manager,
moderator,
app_manager,
support,
manager,
custom
user_id
string
required

The ID of the user to add as an authorized user.

Example:

"user_xxxxxxxxxxxxx"

send_emails
boolean | null

Whether to send notification emails to the user on creation.

Response

A successful response

A user who has been granted administrative access to manage a company's dashboard and settings.

id
string
required

The unique identifier for the authorized user.

Example:

"ausr_xxxxxxxxxxxxx"

role
enum<string>
required

The permission role assigned to this authorized user within the company.

Available options:
owner,
admin,
sales_manager,
moderator,
app_manager,
support,
manager,
custom
user
object
required

The user account linked to this authorized user record.

company
object
required

The company this authorized user has access to.