Invite Users

POST /api/v1/sign-up

Common errors include:

  • "Bad Request" if body parameters are not passed
  • "DNS_CONFIGURATION_ERROR" if custom domain DNS is misconfigured.

The createQrCodeHandler creates a qr code for the input body and returns the reponse to users

Request

Method : POST
Content-Type : Application/json

URL Parameters Schema

email string Required
User's email address. Must be a valid email format
password string Required
User's password
invite string
Invitation token. If provided, indicates this is an invited user signup flow
LANGUAGE
REQUEST
  curl -X POST \
  'https://divsly-backend.vercel.app/api/v1/create-user' \
  -H 'Authorization: Bearer YOUR_JWT_TOKEN_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
	"email": "newuser@example.com",
       “userType”: “user”, 

  }'

API REQUEST
 const createUser = (userData) => {
  return new Promise((resolve, reject) => {
	fetch('https://divsly-backend.vercel.app/api/v1/create-user', {
  	method: 'POST',
  	headers: {
    	'Authorization': 'Bearer YOUR_JWT_TOKEN_HERE',
    	'Content-Type': 'application/json'
  	},
  	body: JSON.stringify({
    	email: userData.email,
    	userType: userData.userType
  	})
	})
  	.then(response => response.json())
  	.then(data => resolve(data))
  	.catch(error => reject(error));
  });
};
API REQUEST
 const axios = require('axios');

const createUser = (userData) => {
  return new Promise((resolve, reject) => {
	axios({
  	method: 'post',
  	url: 'https://divsly-backend.vercel.app/api/v1/create-user',
  	headers: {
    	'Authorization': 'Bearer YOUR_JWT_TOKEN_HERE',
    	'Content-Type': 'application/json'
  	},
  	data: {
    	email: userData.email,
    	userType: userData.userType
  	}
	})
  	.then(response => resolve(response.data))
  	.catch(error => reject(error.response.data));
  });
};

API REQUEST
 $data = array(
        'email' => 'newuser@example.com',
        'userType' => 'user'
    );

    $ch = curl_init('https://divsly-backend.vercel.app/api/v1/create-user');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
        'Authorization: Bearer YOUR_JWT_TOKEN_HERE',
        'Content-Type: application/json'
    ));

    $response = curl_exec($ch);
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);

    $result = json_decode($response, true);
    print_r($result);
API REQUEST
 import requests
import json

url = 'https://divsly-backend.vercel.app/api/v1/create-user'
headers = {
	'Authorization': 'Bearer YOUR_JWT_TOKEN_HERE',
	'Content-Type': 'application/json'
}
data = {
	'email': 'newuser@example.com',
	'userType':'user'
}

try:
	response = requests.post(
    	url,
    	headers=headers,
    	json=data
	)
	response.raise_for_status()
	print(response.json())
except requests.exceptions.RequestException as e:
	print(f"Error: {e}")

RESPONSE
 {
   "success":true,"data":{"id":120,"userType":"user","isAdmin":false,"avatar":"data:image/png;base64,iVBORw","password":"","username":null,"email":"test@test.com","firstName":"test","lastName":"","company":null,"companySize":null,"industry":null,"jobTitle":null,"onboardingStatus":"NOT_STARTED","vatId":null,"mobile":null,"token":null,"country":"IN","profileImage":null,"parentUser":89,"lastLogin":null,"ip":"183.83.160.128","edit":0,"stripeCustomerId":null,"subscriptionId":null,"subscriptionItemId":null,"plan":"yearly-super","planStart":null,"planStatus":null,"paymentStatus":null,"subStartDate":"2025-03-17T15:51:37.000Z","subEndDate":"2054-03-16T18:30:00.000Z","demoTour1":false,"demoTour2":false,"demoTour3":false,"method":"Manual","isActive":true,"passwordUpdated":false,"isVerified":true,"isDelete":false,"createdAt":"2025-04-02T03:33:05.492Z","updatedAt":"2025-04-02T03:33:05.492Z","isadminblocked":false,"useracceptedterms":false,"userEvents":{},"qrCodes":[]},"message":"Invitation email sent to user!"}
    
  {
  "data": {
	"message": "Unauthorized",
  }
}


  {
  "data": {
	"message": "Forbidden Access!",
  }
}


    
 {
  "data": {
	"message": "Account already exists",
	"type": "ACCOUNT_NOT_EXIST| Invitation has been expired | Admin account is not exist!"
  }
}