Skip to main content
POST
/
users
Create Company User
curl --request POST \
  --url https://api.nuwebgroup.com/v1/partner/users \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-NU-RESELLER-ID: <x-nu-reseller-id>' \
  --data '
{
  "name": "John Doe",
  "email": "[email protected]",
  "companies": [],
  "password": "Password123"
}
'
{
  "data": {
    "type": "users",
    "id": 1,
    "attributes": {
      "name": "John Doe",
      "email": "[email protected]",
      "phone": null,
      "phone_code": null,
      "createdAt": "2021-11-22T11:59:00.000000Z",
      "updatedAt": "2021-11-22T11:59:00.000000Z"
    },
    "relationships": {
      "companyUsers": {
        "data": [
          {
            "type": "companyUsers",
            "id": 1
          }
        ]
      },
      "visibilityGroups": {
        "data": [
          {
            "type": "visibilityGroups",
            "id": 1
          }
        ]
      }
    }
  },
  "included": [
    {
      "type": "companyUsers",
      "id": 1,
      "atributes": {
        "isSelected": true,
        "locale": null,
        "acceptedTermsAt": null,
        "acceptedPrivacyAt": null,
        "acceptedEmailOptInAt": null,
        "createdAt": "2021-11-22T11:59:00.000000Z",
        "updatedAt": "2021-11-22T11:59:00.000000Z"
      }
    },
    {
      "type": "visibilityGroups",
      "id": 1,
      "atributes": {
        "name": "Bristol Office",
        "createdAt": "2021-11-22T11:59:00.000000Z",
        "updatedAt": "2021-11-22T11:59:00.000000Z"
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

The 'Bearer' token can be obtained from the token management interface or via the login endpoint using your hub user credentials.

Headers

X-NU-RESELLER-ID
integer
required

The ID of the reseller this operation should be performed against.

Body

application/json

Request body for creating a company user.

name
string
required
email
string
required
companies
integer[]
required

An array of company ID's to associate the new user to.

roles
string[]

An array of roles to assign to this user on creation. By default the first user in a company will receive the super_user role if no other roles are provided. Subsequent users will receive no roles unless specified. Available role keys can be copied from the role management section within hub.

password
string

This field is optional, allowing you to create a user without a password. This user will be able to set their own password using the forgot password functionality when logging in.

registrationSource
enum<string>

This field is optional, allowing you to specify the users registration source. If left empty it will default to api.

Available options:
web,
api,
app
apiTokenName
string

If provided, an API key will be generated for the user and returned in the response. Note: the API key will only be returned in this request. Subsequent lookups of the user via the company API will not yield this value.

Response

Successfully created the company user.

data
object
included
object[]