curl --request POST \
--url https://mwxpyoqrtdfxubdotbmj.supabase.co/functions/v1/public-api/v1/users \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"email": "jsmith@example.com",
"full_name": "<string>",
"password": "<string>",
"role": "<string>",
"role_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"branch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"send_welcome": false
}
'import requests
url = "https://mwxpyoqrtdfxubdotbmj.supabase.co/functions/v1/public-api/v1/users"
payload = {
"email": "jsmith@example.com",
"full_name": "<string>",
"password": "<string>",
"role": "<string>",
"role_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"branch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"send_welcome": False
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'jsmith@example.com',
full_name: '<string>',
password: '<string>',
role: '<string>',
role_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
branch_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
send_welcome: false
})
};
fetch('https://mwxpyoqrtdfxubdotbmj.supabase.co/functions/v1/public-api/v1/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://mwxpyoqrtdfxubdotbmj.supabase.co/functions/v1/public-api/v1/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' => 'jsmith@example.com',
'full_name' => '<string>',
'password' => '<string>',
'role' => '<string>',
'role_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'branch_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'send_welcome' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://mwxpyoqrtdfxubdotbmj.supabase.co/functions/v1/public-api/v1/users"
payload := strings.NewReader("{\n \"email\": \"jsmith@example.com\",\n \"full_name\": \"<string>\",\n \"password\": \"<string>\",\n \"role\": \"<string>\",\n \"role_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"branch_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"send_welcome\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://mwxpyoqrtdfxubdotbmj.supabase.co/functions/v1/public-api/v1/users")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"jsmith@example.com\",\n \"full_name\": \"<string>\",\n \"password\": \"<string>\",\n \"role\": \"<string>\",\n \"role_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"branch_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"send_welcome\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mwxpyoqrtdfxubdotbmj.supabase.co/functions/v1/public-api/v1/users")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"jsmith@example.com\",\n \"full_name\": \"<string>\",\n \"password\": \"<string>\",\n \"role\": \"<string>\",\n \"role_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"branch_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"send_welcome\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "active",
"created_at": "2023-11-07T05:31:56Z",
"must_reset_password": true,
"roles": [
"<string>"
],
"full_name": "<string>",
"email": "jsmith@example.com",
"branch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_login_at": "2023-11-07T05:31:56Z"
},
"temp_password": "<string>",
"welcome_email_sent": true
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"timestamp": "2023-11-07T05:31:56Z",
"rate_limit": {
"limit": 123,
"remaining": 123,
"reset": 123
}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Request validation failed",
"details": {
"fields": {
"first_name": "First name is required"
}
}
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2026-02-15T10:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "AUTH_INVALID_KEY",
"message": "Invalid API key"
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2026-02-15T10:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "MISSING_API_KEY",
"message": "<string>",
"details": "<unknown>"
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"timestamp": "2023-11-07T05:31:56Z",
"rate_limit": {
"limit": 123,
"remaining": 123,
"reset": 123
}
}
}{
"success": false,
"error": {
"code": "MISSING_API_KEY",
"message": "<string>",
"details": "<unknown>"
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"timestamp": "2023-11-07T05:31:56Z",
"rate_limit": {
"limit": 123,
"remaining": 123,
"reset": 123
}
}
}{
"success": false,
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Retry after 12 seconds.",
"details": {
"limit": 60,
"remaining": 0,
"reset": 1718400000000,
"retry_after": 12
}
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2026-02-15T10:00:00.000Z"
}
}Create a user
Provisions a login (auth user + workspace user + role) in one call, through
the same path the GUI uses — tenant guard, no-Super_Admin guard and the HL-A6
seat check included. With password, the seat is login-ready immediately;
without it a temporary password is generated and returned once. The
welcome email is sent only when send_welcome is true. Honours
Idempotency-Key. Required scope: users:configure. See docs/api/users.md.
curl --request POST \
--url https://mwxpyoqrtdfxubdotbmj.supabase.co/functions/v1/public-api/v1/users \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"email": "jsmith@example.com",
"full_name": "<string>",
"password": "<string>",
"role": "<string>",
"role_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"branch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"send_welcome": false
}
'import requests
url = "https://mwxpyoqrtdfxubdotbmj.supabase.co/functions/v1/public-api/v1/users"
payload = {
"email": "jsmith@example.com",
"full_name": "<string>",
"password": "<string>",
"role": "<string>",
"role_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"branch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"send_welcome": False
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'jsmith@example.com',
full_name: '<string>',
password: '<string>',
role: '<string>',
role_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
branch_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
send_welcome: false
})
};
fetch('https://mwxpyoqrtdfxubdotbmj.supabase.co/functions/v1/public-api/v1/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://mwxpyoqrtdfxubdotbmj.supabase.co/functions/v1/public-api/v1/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' => 'jsmith@example.com',
'full_name' => '<string>',
'password' => '<string>',
'role' => '<string>',
'role_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'branch_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'send_welcome' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://mwxpyoqrtdfxubdotbmj.supabase.co/functions/v1/public-api/v1/users"
payload := strings.NewReader("{\n \"email\": \"jsmith@example.com\",\n \"full_name\": \"<string>\",\n \"password\": \"<string>\",\n \"role\": \"<string>\",\n \"role_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"branch_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"send_welcome\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://mwxpyoqrtdfxubdotbmj.supabase.co/functions/v1/public-api/v1/users")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"jsmith@example.com\",\n \"full_name\": \"<string>\",\n \"password\": \"<string>\",\n \"role\": \"<string>\",\n \"role_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"branch_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"send_welcome\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mwxpyoqrtdfxubdotbmj.supabase.co/functions/v1/public-api/v1/users")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"jsmith@example.com\",\n \"full_name\": \"<string>\",\n \"password\": \"<string>\",\n \"role\": \"<string>\",\n \"role_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"branch_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"send_welcome\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "active",
"created_at": "2023-11-07T05:31:56Z",
"must_reset_password": true,
"roles": [
"<string>"
],
"full_name": "<string>",
"email": "jsmith@example.com",
"branch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_login_at": "2023-11-07T05:31:56Z"
},
"temp_password": "<string>",
"welcome_email_sent": true
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"timestamp": "2023-11-07T05:31:56Z",
"rate_limit": {
"limit": 123,
"remaining": 123,
"reset": 123
}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Request validation failed",
"details": {
"fields": {
"first_name": "First name is required"
}
}
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2026-02-15T10:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "AUTH_INVALID_KEY",
"message": "Invalid API key"
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2026-02-15T10:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "MISSING_API_KEY",
"message": "<string>",
"details": "<unknown>"
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"timestamp": "2023-11-07T05:31:56Z",
"rate_limit": {
"limit": 123,
"remaining": 123,
"reset": 123
}
}
}{
"success": false,
"error": {
"code": "MISSING_API_KEY",
"message": "<string>",
"details": "<unknown>"
},
"meta": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"timestamp": "2023-11-07T05:31:56Z",
"rate_limit": {
"limit": 123,
"remaining": 123,
"reset": 123
}
}
}{
"success": false,
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Retry after 12 seconds.",
"details": {
"limit": 60,
"remaining": 0,
"reset": 1718400000000,
"retry_after": 12
}
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2026-02-15T10:00:00.000Z"
}
}Authorizations
API key from Settings > API Keys or POST /v1/api-keys. Format
f9_live_<32 hex chars> (live) or f9_test_<32 hex chars> (sandbox — no
real sends, ever). Legacy wcrm_live_ / wcrm_test_ keys still
authenticate but are no longer issued. Shown once at creation; only a hash
is stored.
Headers
Opaque client-generated key that makes a retried POST safe. Resending the same key with the SAME body replays the original response (marked with Idempotent-Replay: true) instead of creating a second record. Resending it with a DIFFERENT body is rejected with 422. Keys are scoped to your company and to the endpoint, and expire after 24 hours.
8 - 255^[A-Za-z0-9_.:@+\-]+$Body
Given → login-ready immediately. Omitted → a temporary password is generated and returned once as temp_password.
8Role NAME (e.g. Agent). One of role / role_id is required. Super_Admin is never granted.
Send the welcome email (with the temporary password when generated). Off by default.