Skip to main content
POST
/
api
/
v2.1
/
admin
/
organization
/
{organizationId}
/
users
/
{userId}
/
sessions
Create Session
curl --request POST \
  --url https://sandbox.finhub.cloud/api/v2.1/admin/organization/{organizationId}/users/{userId}/sessions \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: <user-agent>' \
  --header 'X-Forwarded-For: <x-forwarded-for>' \
  --header 'X-Forwarded-From: <x-forwarded-from>' \
  --header 'X-Tenant-ID: <x-tenant-id>' \
  --header 'deviceId: <deviceid>' \
  --header 'platform: <platform>' \
  --data '
{
  "ipAddress": "127.0.0.1",
  "userAgent": "Mozilla/5.0",
  "platform": "web",
  "deviceId": "device-demo-001",
  "username": "admin@example.test",
  "password": "SecurePass123!",
  "role": "MASTER_ADMIN",
  "organizationType": "PLATFORM_OWNER"
}
'
import requests

url = "https://sandbox.finhub.cloud/api/v2.1/admin/organization/{organizationId}/users/{userId}/sessions"

payload = {
"ipAddress": "127.0.0.1",
"userAgent": "Mozilla/5.0",
"platform": "web",
"deviceId": "device-demo-001",
"username": "admin@example.test",
"password": "SecurePass123!",
"role": "MASTER_ADMIN",
"organizationType": "PLATFORM_OWNER"
}
headers = {
"User-Agent": "<user-agent>",
"X-Forwarded-For": "<x-forwarded-for>",
"X-Tenant-ID": "<x-tenant-id>",
"X-Forwarded-From": "<x-forwarded-from>",
"platform": "<platform>",
"deviceId": "<deviceid>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {
'User-Agent': '<user-agent>',
'X-Forwarded-For': '<x-forwarded-for>',
'X-Tenant-ID': '<x-tenant-id>',
'X-Forwarded-From': '<x-forwarded-from>',
platform: '<platform>',
deviceId: '<deviceid>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
ipAddress: '127.0.0.1',
userAgent: 'Mozilla/5.0',
platform: 'web',
deviceId: 'device-demo-001',
username: 'admin@example.test',
password: 'SecurePass123!',
role: 'MASTER_ADMIN',
organizationType: 'PLATFORM_OWNER'
})
};

fetch('https://sandbox.finhub.cloud/api/v2.1/admin/organization/{organizationId}/users/{userId}/sessions', 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://sandbox.finhub.cloud/api/v2.1/admin/organization/{organizationId}/users/{userId}/sessions",
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([
'ipAddress' => '127.0.0.1',
'userAgent' => 'Mozilla/5.0',
'platform' => 'web',
'deviceId' => 'device-demo-001',
'username' => 'admin@example.test',
'password' => 'SecurePass123!',
'role' => 'MASTER_ADMIN',
'organizationType' => 'PLATFORM_OWNER'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"User-Agent: <user-agent>",
"X-Forwarded-For: <x-forwarded-for>",
"X-Forwarded-From: <x-forwarded-from>",
"X-Tenant-ID: <x-tenant-id>",
"deviceId: <deviceid>",
"platform: <platform>"
],
]);

$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://sandbox.finhub.cloud/api/v2.1/admin/organization/{organizationId}/users/{userId}/sessions"

payload := strings.NewReader("{\n \"ipAddress\": \"127.0.0.1\",\n \"userAgent\": \"Mozilla/5.0\",\n \"platform\": \"web\",\n \"deviceId\": \"device-demo-001\",\n \"username\": \"admin@example.test\",\n \"password\": \"SecurePass123!\",\n \"role\": \"MASTER_ADMIN\",\n \"organizationType\": \"PLATFORM_OWNER\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("User-Agent", "<user-agent>")
req.Header.Add("X-Forwarded-For", "<x-forwarded-for>")
req.Header.Add("X-Tenant-ID", "<x-tenant-id>")
req.Header.Add("X-Forwarded-From", "<x-forwarded-from>")
req.Header.Add("platform", "<platform>")
req.Header.Add("deviceId", "<deviceid>")
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://sandbox.finhub.cloud/api/v2.1/admin/organization/{organizationId}/users/{userId}/sessions")
.header("User-Agent", "<user-agent>")
.header("X-Forwarded-For", "<x-forwarded-for>")
.header("X-Tenant-ID", "<x-tenant-id>")
.header("X-Forwarded-From", "<x-forwarded-from>")
.header("platform", "<platform>")
.header("deviceId", "<deviceid>")
.header("Content-Type", "application/json")
.body("{\n \"ipAddress\": \"127.0.0.1\",\n \"userAgent\": \"Mozilla/5.0\",\n \"platform\": \"web\",\n \"deviceId\": \"device-demo-001\",\n \"username\": \"admin@example.test\",\n \"password\": \"SecurePass123!\",\n \"role\": \"MASTER_ADMIN\",\n \"organizationType\": \"PLATFORM_OWNER\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://sandbox.finhub.cloud/api/v2.1/admin/organization/{organizationId}/users/{userId}/sessions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["User-Agent"] = '<user-agent>'
request["X-Forwarded-For"] = '<x-forwarded-for>'
request["X-Tenant-ID"] = '<x-tenant-id>'
request["X-Forwarded-From"] = '<x-forwarded-from>'
request["platform"] = '<platform>'
request["deviceId"] = '<deviceid>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ipAddress\": \"127.0.0.1\",\n \"userAgent\": \"Mozilla/5.0\",\n \"platform\": \"web\",\n \"deviceId\": \"device-demo-001\",\n \"username\": \"admin@example.test\",\n \"password\": \"SecurePass123!\",\n \"role\": \"MASTER_ADMIN\",\n \"organizationType\": \"PLATFORM_OWNER\"\n}"

response = http.request(request)
puts response.read_body

Headers

User-Agent
string
required
X-Forwarded-For
string
required
Example:

"127.0.0.1"

X-Tenant-ID
string
required
Example:

"tenant-demo-001"

sec-ch-ua-platform
string
X-Forwarded-From
string
required

Client source identifier

Example:

"client-app"

platform
string
required

Client platform

Example:

"mobile"

deviceId
string
required

Device identifier

Example:

"device-demo-001"

Path Parameters

organizationId
string<uuid>
required
Example:

"00000000-0000-0000-0000-000000000000"

userId
string<uuid>
required
Example:

"00000000-0000-0000-0000-000000000000"

Body

application/json
ipAddress
string

Client IP address

Example:

"127.0.0.1"

userAgent
string

User agent string

Example:

"Mozilla/5.0"

platform
string

Client platform

Example:

"web"

deviceId
string

Device identifier

Example:

"device-demo-001"

username
string

Username for login/session

Example:

"admin@example.test"

password
string

Password for login/session

Example:

"SecurePass123!"

role
string

Role assigned to session

Example:

"MASTER_ADMIN"

organizationType
string

Organization type

Example:

"PLATFORM_OWNER"

Response

200

OK