Skip to main content
POST
/
api
/
v1
/
runtime
/
users
Create new user (CLI/SDK)
curl --request POST \
  --url https://api.runflow.ai/api/v1/runtime/users \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "john.doe@acme.com",
  "name": "John Doe",
  "phone": "+5511999999999",
  "password": "SecurePassword123!",
  "role": "USER",
  "avatarUrl": "https://example.com/avatar.jpg"
}
'
import requests

url = "https://api.runflow.ai/api/v1/runtime/users"

payload = {
"email": "john.doe@acme.com",
"name": "John Doe",
"phone": "+5511999999999",
"password": "SecurePassword123!",
"role": "USER",
"avatarUrl": "https://example.com/avatar.jpg"
}
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: 'john.doe@acme.com',
name: 'John Doe',
phone: '+5511999999999',
password: 'SecurePassword123!',
role: 'USER',
avatarUrl: 'https://example.com/avatar.jpg'
})
};

fetch('https://api.runflow.ai/api/v1/runtime/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.runflow.ai/api/v1/runtime/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' => 'john.doe@acme.com',
'name' => 'John Doe',
'phone' => '+5511999999999',
'password' => 'SecurePassword123!',
'role' => 'USER',
'avatarUrl' => 'https://example.com/avatar.jpg'
]),
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.runflow.ai/api/v1/runtime/users"

payload := strings.NewReader("{\n \"email\": \"john.doe@acme.com\",\n \"name\": \"John Doe\",\n \"phone\": \"+5511999999999\",\n \"password\": \"SecurePassword123!\",\n \"role\": \"USER\",\n \"avatarUrl\": \"https://example.com/avatar.jpg\"\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.runflow.ai/api/v1/runtime/users")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"john.doe@acme.com\",\n \"name\": \"John Doe\",\n \"phone\": \"+5511999999999\",\n \"password\": \"SecurePassword123!\",\n \"role\": \"USER\",\n \"avatarUrl\": \"https://example.com/avatar.jpg\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.runflow.ai/api/v1/runtime/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\": \"john.doe@acme.com\",\n \"name\": \"John Doe\",\n \"phone\": \"+5511999999999\",\n \"password\": \"SecurePassword123!\",\n \"role\": \"USER\",\n \"avatarUrl\": \"https://example.com/avatar.jpg\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "email": "john.doe@acme.com",
  "name": "John Doe",
  "role": "USER",
  "isActive": true,
  "lastLoginAt": "2025-01-01T00:00:00.000Z",
  "createdAt": "2025-01-01T00:00:00.000Z",
  "updatedAt": "2025-01-01T00:00:00.000Z",
  "tenantId": "123e4567-e89b-12d3-a456-426614174000",
  "phone": "+5511999999999",
  "avatarUrl": "https://example.com/avatar.jpg",
  "metadata": {
    "auth0_user_id": "auth0|1234567890",
    "auth0_created": true,
    "invite_sent": false
  },
  "_count": {
    "agents": 3,
    "credentials": 5,
    "executions": 12
  }
}

Body

application/json
email
string<email>
required

User email address

Example:

"john.doe@acme.com"

name
string
required

User full name

Required string length: 2 - 100
Example:

"John Doe"

phone
string

User phone number

Example:

"+5511999999999"

password
string

User password (for local authentication)

Required string length: 8 - 100
Example:

"SecurePassword123!"

role
enum<string>
default:USER

User role within the tenant

Available options:
ADMIN,
USER,
VIEWER,
SUPER_ADMIN,
HUB_USER
Example:

"USER"

avatarUrl
string

User avatar URL

Maximum string length: 500
Example:

"https://example.com/avatar.jpg"

Response

201 - application/json

User created successfully.

id
string
required

User unique identifier

Example:

"123e4567-e89b-12d3-a456-426614174000"

email
string
required

User email address

Example:

"john.doe@acme.com"

name
string
required

User full name

Example:

"John Doe"

role
enum<string>
required

User role within the tenant

Available options:
ADMIN,
USER,
VIEWER,
SUPER_ADMIN,
HUB_USER
Example:

"USER"

isActive
boolean
required

Whether the user is active

Example:

true

lastLoginAt
string<date-time>
required

User last login timestamp

Example:

"2025-01-01T00:00:00.000Z"

createdAt
string<date-time>
required

Creation timestamp

Example:

"2025-01-01T00:00:00.000Z"

updatedAt
string<date-time>
required

Last update timestamp

Example:

"2025-01-01T00:00:00.000Z"

tenantId
string
required

Tenant ID that the user belongs to

Example:

"123e4567-e89b-12d3-a456-426614174000"

phone
string

User phone number

Example:

"+5511999999999"

avatarUrl
string

User avatar URL

Example:

"https://example.com/avatar.jpg"

metadata
object

User metadata (Auth0 integration data)

Example:
{
"auth0_user_id": "auth0|1234567890",
"auth0_created": true,
"invite_sent": false
}
_count
object

User related statistics

Example:
{
"agents": 3,
"credentials": 5,
"executions": 12
}