Create User
curl --request POST \
--url https://api.royalti.io/user/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"firstName": "<string>",
"lastName": "<string>",
"userType": "<string>",
"role": "<string>",
"nickName": "<string>",
"email": "jsmith@example.com",
"ipi": "<string>",
"phone": "<string>",
"country": "<string>",
"sendEmail": true,
"redirect_url": "<string>",
"message": "<string>"
}
'import requests
url = "https://api.royalti.io/user/"
payload = {
"firstName": "<string>",
"lastName": "<string>",
"userType": "<string>",
"role": "<string>",
"nickName": "<string>",
"email": "jsmith@example.com",
"ipi": "<string>",
"phone": "<string>",
"country": "<string>",
"sendEmail": True,
"redirect_url": "<string>",
"message": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
firstName: '<string>',
lastName: '<string>',
userType: '<string>',
role: '<string>',
nickName: '<string>',
email: 'jsmith@example.com',
ipi: '<string>',
phone: '<string>',
country: '<string>',
sendEmail: true,
redirect_url: '<string>',
message: '<string>'
})
};
fetch('https://api.royalti.io/user/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.royalti.io/user/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'firstName' => '<string>',
'lastName' => '<string>',
'userType' => '<string>',
'role' => '<string>',
'nickName' => '<string>',
'email' => 'jsmith@example.com',
'ipi' => '<string>',
'phone' => '<string>',
'country' => '<string>',
'sendEmail' => true,
'redirect_url' => '<string>',
'message' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.royalti.io/user/"
payload := strings.NewReader("{\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"userType\": \"<string>\",\n \"role\": \"<string>\",\n \"nickName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"ipi\": \"<string>\",\n \"phone\": \"<string>\",\n \"country\": \"<string>\",\n \"sendEmail\": true,\n \"redirect_url\": \"<string>\",\n \"message\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.royalti.io/user/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"userType\": \"<string>\",\n \"role\": \"<string>\",\n \"nickName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"ipi\": \"<string>\",\n \"phone\": \"<string>\",\n \"country\": \"<string>\",\n \"sendEmail\": true,\n \"redirect_url\": \"<string>\",\n \"message\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/user/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"userType\": \"<string>\",\n \"role\": \"<string>\",\n \"nickName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"ipi\": \"<string>\",\n \"phone\": \"<string>\",\n \"country\": \"<string>\",\n \"sendEmail\": true,\n \"redirect_url\": \"<string>\",\n \"message\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"fullName": "Emmanuel Royalti",
"phone": "+1234567890",
"country": "Nigeria",
"message": "Welcome to Royalti!",
"sendEmail": true,
"redirect_url": "https://app.royalti.io/welcome",
"id": "3d5c9971-451e-4711-8874-ff498d55e601",
"isVerified": false,
"isActive": false,
"firstName": "Emmanuel",
"lastName": "Royalti",
"TenantUsers": [
{
"UserId": "3d5c9971-451e-4711-8874-ff498d55e601",
"TenantId": 1,
"nickName": "iEmmanuel104",
"userType": [
"Artist"
],
"paymentSettings": null,
"lastLogin": null,
"permissions": null
}
],
"email": "emmanuel@royalti.io",
"updatedAt": "2023-02-19T11:26:45.512Z",
"createdAt": "2023-02-19T11:26:45.512Z",
"externalId": null,
"ipi": null,
"role": null
}{
"msg": "User Email provided already associated with workspace!"
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}User
Create User
/user/
POST
/
user
/
Create User
curl --request POST \
--url https://api.royalti.io/user/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"firstName": "<string>",
"lastName": "<string>",
"userType": "<string>",
"role": "<string>",
"nickName": "<string>",
"email": "jsmith@example.com",
"ipi": "<string>",
"phone": "<string>",
"country": "<string>",
"sendEmail": true,
"redirect_url": "<string>",
"message": "<string>"
}
'import requests
url = "https://api.royalti.io/user/"
payload = {
"firstName": "<string>",
"lastName": "<string>",
"userType": "<string>",
"role": "<string>",
"nickName": "<string>",
"email": "jsmith@example.com",
"ipi": "<string>",
"phone": "<string>",
"country": "<string>",
"sendEmail": True,
"redirect_url": "<string>",
"message": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
firstName: '<string>',
lastName: '<string>',
userType: '<string>',
role: '<string>',
nickName: '<string>',
email: 'jsmith@example.com',
ipi: '<string>',
phone: '<string>',
country: '<string>',
sendEmail: true,
redirect_url: '<string>',
message: '<string>'
})
};
fetch('https://api.royalti.io/user/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.royalti.io/user/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'firstName' => '<string>',
'lastName' => '<string>',
'userType' => '<string>',
'role' => '<string>',
'nickName' => '<string>',
'email' => 'jsmith@example.com',
'ipi' => '<string>',
'phone' => '<string>',
'country' => '<string>',
'sendEmail' => true,
'redirect_url' => '<string>',
'message' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.royalti.io/user/"
payload := strings.NewReader("{\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"userType\": \"<string>\",\n \"role\": \"<string>\",\n \"nickName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"ipi\": \"<string>\",\n \"phone\": \"<string>\",\n \"country\": \"<string>\",\n \"sendEmail\": true,\n \"redirect_url\": \"<string>\",\n \"message\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.royalti.io/user/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"userType\": \"<string>\",\n \"role\": \"<string>\",\n \"nickName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"ipi\": \"<string>\",\n \"phone\": \"<string>\",\n \"country\": \"<string>\",\n \"sendEmail\": true,\n \"redirect_url\": \"<string>\",\n \"message\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/user/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"userType\": \"<string>\",\n \"role\": \"<string>\",\n \"nickName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"ipi\": \"<string>\",\n \"phone\": \"<string>\",\n \"country\": \"<string>\",\n \"sendEmail\": true,\n \"redirect_url\": \"<string>\",\n \"message\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"fullName": "Emmanuel Royalti",
"phone": "+1234567890",
"country": "Nigeria",
"message": "Welcome to Royalti!",
"sendEmail": true,
"redirect_url": "https://app.royalti.io/welcome",
"id": "3d5c9971-451e-4711-8874-ff498d55e601",
"isVerified": false,
"isActive": false,
"firstName": "Emmanuel",
"lastName": "Royalti",
"TenantUsers": [
{
"UserId": "3d5c9971-451e-4711-8874-ff498d55e601",
"TenantId": 1,
"nickName": "iEmmanuel104",
"userType": [
"Artist"
],
"paymentSettings": null,
"lastLogin": null,
"permissions": null
}
],
"email": "emmanuel@royalti.io",
"updatedAt": "2023-02-19T11:26:45.512Z",
"createdAt": "2023-02-19T11:26:45.512Z",
"externalId": null,
"ipi": null,
"role": null
}{
"msg": "User Email provided already associated with workspace!"
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}This endpoint requires authentication. Include your Bearer token in the Authorization header.
Description
/user/ Description: The/user/ endpoint allows the creation of a single user by providing their details, such as first name, last name, nickname, user type, and email address.
Authorization:
- Required role:
adminor higher
POST
Request Payload:
| Parameter | Type | Description |
|---|---|---|
| firstName | string | The first name of the user. |
| lastName | string | The last name of the user. |
| nickName (Optional) | string | The nickname of the user. |
| userType | string | The type of user (e.g., Artist, Manager). |
| string | The email address of the user. | |
| ipi (Optional) | string | The IPI (Interested Parties Information) of the user. |
| role | string | The role of the user in the workspace |
| phone (Optional) | string | The user’s phone number. |
| country (Optional) | string | The user’s country. |
| sendEmail (Optional) | boolean | This sends an invite email to the user, by default it is true. |
| redirect_url (Optional) | string | The URL to redirect the user to after the creation. |
| message (Optional) | string | For passing the invite email custom message. |
Code Examples
const response = await fetch('https://api.royalti.io/user/', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"firstName": "sample-firstName",
"lastName": "sample-lastName",
"nickName": "sample-nickName",
"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);
import requests
response = requests.post(
'https://api.royalti.io/user/',
headers={
'Authorization': f'Bearer {token}'
},
json={"firstName":"sample-firstName","lastName":"sample-lastName","nickName":"sample-nickName","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"}
)
data = response.json()
print(data)
curl -X POST https://api.royalti.io/user/ \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"firstName":"sample-firstName","lastName":"sample-lastName","nickName":"sample-nickName","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"}'
Authorizations
Body
application/json