Create User
curl --request POST \
--url https://api.example.com/api/users \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"name": "<string>",
"password": "<string>",
"profile_image_url": "<string>",
"role": "<string>",
"username": "<string>",
"oauth": {}
}
'import requests
url = "https://api.example.com/api/users"
payload = {
"email": "<string>",
"name": "<string>",
"password": "<string>",
"profile_image_url": "<string>",
"role": "<string>",
"username": "<string>",
"oauth": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
email: '<string>',
name: '<string>',
password: '<string>',
profile_image_url: '<string>',
role: '<string>',
username: '<string>',
oauth: {}
})
};
fetch('https://api.example.com/api/users', 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.example.com/api/users",
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([
'email' => '<string>',
'name' => '<string>',
'password' => '<string>',
'profile_image_url' => '<string>',
'role' => '<string>',
'username' => '<string>',
'oauth' => [
]
]),
CURLOPT_HTTPHEADER => [
"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.example.com/api/users"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"name\": \"<string>\",\n \"password\": \"<string>\",\n \"profile_image_url\": \"<string>\",\n \"role\": \"<string>\",\n \"username\": \"<string>\",\n \"oauth\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/users")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"name\": \"<string>\",\n \"password\": \"<string>\",\n \"profile_image_url\": \"<string>\",\n \"role\": \"<string>\",\n \"username\": \"<string>\",\n \"oauth\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/users")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"<string>\",\n \"name\": \"<string>\",\n \"password\": \"<string>\",\n \"profile_image_url\": \"<string>\",\n \"role\": \"<string>\",\n \"username\": \"<string>\",\n \"oauth\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"email": "<string>",
"username": "<string>",
"role": "<string>",
"name": "<string>",
"profile_image_url": "<string>",
"last_active_at": 123,
"updated_at": 123,
"created_at": 123
}Users & Groups
Create User
POST
/
api
/
users
Create User
curl --request POST \
--url https://api.example.com/api/users \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"name": "<string>",
"password": "<string>",
"profile_image_url": "<string>",
"role": "<string>",
"username": "<string>",
"oauth": {}
}
'import requests
url = "https://api.example.com/api/users"
payload = {
"email": "<string>",
"name": "<string>",
"password": "<string>",
"profile_image_url": "<string>",
"role": "<string>",
"username": "<string>",
"oauth": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
email: '<string>',
name: '<string>',
password: '<string>',
profile_image_url: '<string>',
role: '<string>',
username: '<string>',
oauth: {}
})
};
fetch('https://api.example.com/api/users', 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.example.com/api/users",
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([
'email' => '<string>',
'name' => '<string>',
'password' => '<string>',
'profile_image_url' => '<string>',
'role' => '<string>',
'username' => '<string>',
'oauth' => [
]
]),
CURLOPT_HTTPHEADER => [
"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.example.com/api/users"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"name\": \"<string>\",\n \"password\": \"<string>\",\n \"profile_image_url\": \"<string>\",\n \"role\": \"<string>\",\n \"username\": \"<string>\",\n \"oauth\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/users")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"name\": \"<string>\",\n \"password\": \"<string>\",\n \"profile_image_url\": \"<string>\",\n \"role\": \"<string>\",\n \"username\": \"<string>\",\n \"oauth\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/users")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"<string>\",\n \"name\": \"<string>\",\n \"password\": \"<string>\",\n \"profile_image_url\": \"<string>\",\n \"role\": \"<string>\",\n \"username\": \"<string>\",\n \"oauth\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"email": "<string>",
"username": "<string>",
"role": "<string>",
"name": "<string>",
"profile_image_url": "<string>",
"last_active_at": 123,
"updated_at": 123,
"created_at": 123
}Creates a new user account. Note: User creation is typically handled through the authentication endpoints (
/api/v1/auths/signup). This documentation is for reference.
Authentication
User creation through signup endpoints requires appropriate signup configuration.Request Body
string
required
User email address (will be converted to lowercase)
string
required
User display name
string
required
User password (will be hashed)
string
default:"/user.png"
URL to user’s profile image
string
default:"pending"
User role:
admin, user, or pendingstring
Username (optional)
object
OAuth provider information for OAuth-based signups
Response
string
Unique user identifier (auto-generated UUID)
string
User email address
string
Username
string
User role
string
User display name
string
URL to user’s profile image
integer
Unix timestamp of last activity (set to creation time)
integer
Unix timestamp of last update
integer
Unix timestamp of creation
Example Request
curl -X POST "https://your-domain.com/api/v1/auths/signup" \
-H "Content-Type: application/json" \
-d '{
"email": "newuser@example.com",
"name": "New User",
"password": "securePassword123!"
}'
Example Response
{
"id": "user-abc123",
"email": "newuser@example.com",
"role": "pending",
"name": "New User",
"profile_image_url": "/api/v1/users/user-abc123/profile/image",
"last_active_at": 1709424000,
"updated_at": 1709424000,
"created_at": 1709424000
}
Notes
- Email addresses are automatically converted to lowercase
- First user created automatically becomes an admin
- Subsequent users are created with
pendingrole by default unless configured otherwise - Profile image URL defaults to
/api/v1/users/{id}/profile/image - Password is hashed using secure password hashing before storage
- User creation is handled by the authentication system at
/api/v1/auths/signup