Create User API

Create new user accounts with profile information through the admin API

Admin

Create User API

Create new user accounts with complete profile information. Provision VPN access for customers with account credentials and personal details.

Create Accounts

Provision new users.

Full Profile

Include personal details.

Admin Control

Manage user creation.


Endpoint Overview

MUTATION/graphql

Create a new user account with profile information. The admin can specify email, password, reseller assignment, and personal profile details.

Authentication:Bearer Token
Required scopes:admin

Request Parameters

user.emailString!Required

Email address for the new user account (used for login).

user.passwordString!Required

Initial password for the user account.

user.resellerIdInt

Reseller ID to associate with this user.

userProfile.firstNameString

User's first name.

userProfile.lastNameString

User's last name.

userProfile.phoneString

Contact phone number.

userProfile.addressString

Street address.

userProfile.cityString

City name.

userProfile.countryString

Country code or name.

userProfile.postalCodeString

Postal/ZIP code.

userProfile.birthDateString

Date of birth (YYYY-MM-DD format).


GraphQL Mutation

mutation createUser($user: UserCreate!, $userProfile: UserProfileEdit) {
  createUser(user: $user, userProfile: $userProfile) {
    id
    email
    username
    enabled
    createdAt
  }
}

Variables:

{
  "user": {
    "email": "newuser@example.com",
    "password": "SecurePass123!",
    "resellerId": 100
  },
  "userProfile": {
    "firstName": "John",
    "lastName": "Doe",
    "phone": "+1234567890",
    "address": "123 Main Street",
    "city": "New York",
    "country": "US",
    "postalCode": "10001",
    "birthDate": "1990-05-15"
  }
}

HTTP Request:

curl -X POST https://api.orbnet.com/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
  -d '{
    "query": "mutation createUser($user: UserCreate!, $userProfile: UserProfileEdit) { createUser(user: $user, userProfile: $userProfile) { id email username } }",
    "variables": {
      "user": {
        "email": "newuser@example.com",
        "password": "SecurePass123!"
      },
      "userProfile": {
        "firstName": "John",
        "lastName": "Doe"
      }
    }
  }'

Response

200User Created Successfully
{
  "data": {
    "createUser": {
      "id": "user_12345",
      "email": "newuser@example.com",
      "username": "johndoe",
      "enabled": true,
      "createdAt": "2024-01-15T10:30:00Z"
    }
  }
}
400Email Already Exists
{
  "errors": [
    {
      "message": "User with this email already exists",
      "path": ["createUser"],
      "extensions": {
        "code": "EMAIL_EXISTS"
      }
    }
  ],
  "data": null
}

Best Practices

Strong Passwords

Require secure passwords that meet security standards.

Validate Email

Ensure email format is valid before creation.

Complete Profile

Collect necessary profile info for support.

Welcome Message

Send credentials to user after creation.



Admin Permission Required

This endpoint requires admin-level authentication. Only administrators can create new user accounts.

Need to Create Multiple Users?

Use the Upload Users endpoint for bulk user creation.

Upload Users