User Signup API

Create new user accounts with email, password, and optional referral code

Account Creation

User Signup API

Create new user accounts with secure email verification. Support referral codes for user acquisition and loyalty programs.

Simple Registration

Create accounts with just email and password. No complex forms required.

Email Verification

Automatic verification emails ensure valid user accounts.

Referral Support

Built-in referral code system for growth and rewards.


Endpoint Overview

MUTATION/graphql

Create a new user account with email, password, and optional referral code. Sends a verification email upon successful registration.

Authentication:No Auth Required

Request Parameters

emailString!Required

The email address for the new account. Must be a valid email format and not already registered.

passwordString!Required

The password for the account. Must meet security requirements: minimum 8 characters, including uppercase, lowercase, and numbers.

referralString

An optional referral code from an existing user. Provides benefits to both the referrer and new user.


Password Requirements

Minimum 8 Characters

Passwords must be at least 8 characters long for basic security.

Mixed Case Required

Include both uppercase (A-Z) and lowercase (a-z) letters.

Numbers Required

Include at least one numeric digit (0-9) in your password.

Recommended: Special Characters

Add special characters (!@#$%^&*) for stronger security.


GraphQL Mutation

mutation signup($email: String!, $password: String!, $referral: String) {
  signup(email: $email, password: $password, referral: $referral) {
    message
    success
  }
}

Variables:

{
  "email": "newuser@example.com",
  "password": "SecureP@ss123",
  "referral": "REF2024ABC"
}

HTTP Request:

curl -X POST https://api.orbnet.com/graphql \
  -H "Content-Type: application/json" \
  -d '{
    "query": "mutation signup($email: String!, $password: String!, $referral: String) { signup(email: $email, password: $password, referral: $referral) { message success } }",
    "variables": {
      "email": "newuser@example.com",
      "password": "SecureP@ss123",
      "referral": "REF2024ABC"
    }
  }'

Response

200Successful Registration
{
  "data": {
    "signup": {
      "message": "Account created successfully. Please check your email to verify your account.",
      "success": true
    }
  }
}
400Invalid Email Format
{
  "errors": [
    {
      "message": "Invalid email address format",
      "path": ["signup"],
      "extensions": {
        "code": "INVALID_EMAIL"
      }
    }
  ],
  "data": null
}
409Email Already Registered
{
  "errors": [
    {
      "message": "An account with this email already exists",
      "path": ["signup"],
      "extensions": {
        "code": "EMAIL_EXISTS"
      }
    }
  ],
  "data": null
}
400Weak Password
{
  "errors": [
    {
      "message": "Password does not meet security requirements",
      "path": ["signup"],
      "extensions": {
        "code": "WEAK_PASSWORD",
        "requirements": [
          "Minimum 8 characters",
          "Include uppercase letters",
          "Include lowercase letters",
          "Include numbers"
        ]
      }
    }
  ],
  "data": null
}

Registration Flow


Referral System

Get Referral Codes

Existing users can generate referral codes from their dashboard or via the getReferralCode API.

Apply at Signup

New users enter a referral code during registration. Invalid codes are silently ignored.

Both Users Benefit

Referrer and referee both receive rewards such as extended trial periods or discounts.

Track Referrals

Referrers can track successful referrals and accumulated rewards in their account.


Best Practices

Client-Side Validation

Validate email format and password requirements before calling the API to provide instant feedback.

Clear Error Messages

Display user-friendly error messages. For EMAIL_EXISTS, offer password reset option.

Verification Reminder

Clearly communicate that email verification is required. Offer to resend verification if needed.

Secure Transport

Always use HTTPS. Never log or expose passwords. Hash passwords if storing temporarily.


Error Handling

INVALID_EMAIL

Email format is invalid. Check for typos and proper email structure.

EMAIL_EXISTS

Account already exists. Offer login or password reset options.

WEAK_PASSWORD

Password doesn't meet requirements. Show specific missing criteria.

INVALID_REFERRAL

Referral code not found. Usually silently ignored; account created anyway.



Email Verification Required

Users must verify their email address before they can log in. Make sure to guide users through the verification process after successful signup.

Start Onboarding Users

Create seamless registration experiences with our signup API. Support referrals, enforce security, and verify users automatically.

View Verification API