curl --request POST \
--url https://api.royalti.io/user/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"users": [
{
"firstName": "<string>",
"lastName": "<string>",
"nickName": "<string>",
"userType": "<string>",
"email": "[email protected]",
"ipi": "<string>",
"role": "<string>",
"phone": "<string>",
"country": "<string>"
}
],
"sendEmail": true,
"redirect_url": "<string>",
"message": "<string>"
}
'{
"message": "Done.",
"createdUsers": [
"John Doe",
"Jericho Doe"
],
"processedCount": 3,
"errors": [
"User Jane Doe already associated with workspace!",
"Invalid email format for Jacob Doe",
"Invalid email format for Jake Doe"
]
}/user/bulk
curl --request POST \
--url https://api.royalti.io/user/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"users": [
{
"firstName": "<string>",
"lastName": "<string>",
"nickName": "<string>",
"userType": "<string>",
"email": "[email protected]",
"ipi": "<string>",
"role": "<string>",
"phone": "<string>",
"country": "<string>"
}
],
"sendEmail": true,
"redirect_url": "<string>",
"message": "<string>"
}
'{
"message": "Done.",
"createdUsers": [
"John Doe",
"Jericho Doe"
],
"processedCount": 3,
"errors": [
"User Jane Doe already associated with workspace!",
"Invalid email format for Jacob Doe",
"Invalid email format for Jake Doe"
]
}/user/bulk endpoint allows the creation of multiple users simultaneously by providing an array of user objects, each containing user details.
Method:
POST
Request Payload:
| Parameter | Type | Description |
|---|---|---|
| users | array | An array of user objects with their details. |
| sendEmail (Optional) | boolean | This sends an invite email to the users, by default it is true. |
| redirect_url (Optional) | string | The URL to redirect after creation. |
| message (Optional) | string | For passing the invite email custom message. |
See sample response for request payload in the body below
const response = await fetch('https://api.royalti.io/user/bulk', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"users": [
{
"firstName": "sample-firstName",
"lastName": "sample-lastName",
"nickName": "sample-nickName",
"userType": "sample-userType",
"email": "sample-email",
"ipi": "sample-ipi",
"role": "sample-role",
"phone": "sample-phone",
"country": "sample-country"
}
],
"sendEmail": true,
"redirect_url": "sample-redirect_url",
"message": "sample-message"
})
});
const data = await response.json();
console.log(data);
JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"