Create user
curl --request POST \
--url https://identity.nks.europe-west4.nscale.com/api/v1/organizations/{organizationID}/users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"spec": {
"subject": "john.doe@acme.com",
"state": "active",
"groupIDs": [
"0aaba80d-67ef-4799-b6d9-59f37e2ce2ad"
]
}
}
'import requests
url = "https://identity.nks.europe-west4.nscale.com/api/v1/organizations/{organizationID}/users"
payload = { "spec": {
"subject": "john.doe@acme.com",
"state": "active",
"groupIDs": ["0aaba80d-67ef-4799-b6d9-59f37e2ce2ad"]
} }
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({
spec: {
subject: 'john.doe@acme.com',
state: 'active',
groupIDs: ['0aaba80d-67ef-4799-b6d9-59f37e2ce2ad']
}
})
};
fetch('https://identity.nks.europe-west4.nscale.com/api/v1/organizations/{organizationID}/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://identity.nks.europe-west4.nscale.com/api/v1/organizations/{organizationID}/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([
'spec' => [
'subject' => 'john.doe@acme.com',
'state' => 'active',
'groupIDs' => [
'0aaba80d-67ef-4799-b6d9-59f37e2ce2ad'
]
]
]),
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://identity.nks.europe-west4.nscale.com/api/v1/organizations/{organizationID}/users"
payload := strings.NewReader("{\n \"spec\": {\n \"subject\": \"john.doe@acme.com\",\n \"state\": \"active\",\n \"groupIDs\": [\n \"0aaba80d-67ef-4799-b6d9-59f37e2ce2ad\"\n ]\n }\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://identity.nks.europe-west4.nscale.com/api/v1/organizations/{organizationID}/users")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"spec\": {\n \"subject\": \"john.doe@acme.com\",\n \"state\": \"active\",\n \"groupIDs\": [\n \"0aaba80d-67ef-4799-b6d9-59f37e2ce2ad\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://identity.nks.europe-west4.nscale.com/api/v1/organizations/{organizationID}/users")
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 \"spec\": {\n \"subject\": \"john.doe@acme.com\",\n \"state\": \"active\",\n \"groupIDs\": [\n \"0aaba80d-67ef-4799-b6d9-59f37e2ce2ad\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"metadata": {
"id": "ee45f34b-9685-40d8-8724-23c31252ca46",
"name": "undefined",
"organizationId": "d4600d6e-e965-4b44-a808-84fb2fa36702",
"creationTime": "2024-05-31T14:11:00Z",
"provisioningStatus": "provisioned",
"healthStatus": "healthy"
},
"spec": {
"subject": "john.doe@acme.com",
"state": "active",
"groupIDs": [
"0aaba80d-67ef-4799-b6d9-59f37e2ce2ad"
]
},
"status": {
"lastAcive": "2025-01-12T10:49:13Z"
}
}{
"error": "access_denied",
"error_description": "authentication failed"
}{
"error": "forbidden",
"error_description": "user credentials do not have the required privileges"
}{
"error": "conflict",
"error_description": "a resource with the same name already exists"
}{
"error": "server_error",
"error_description": "failed to token claim"
}Users
Create user
Creates a new user and associates with a set of groups.
POST
/
api
/
v1
/
organizations
/
{organizationID}
/
users
Create user
curl --request POST \
--url https://identity.nks.europe-west4.nscale.com/api/v1/organizations/{organizationID}/users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"spec": {
"subject": "john.doe@acme.com",
"state": "active",
"groupIDs": [
"0aaba80d-67ef-4799-b6d9-59f37e2ce2ad"
]
}
}
'import requests
url = "https://identity.nks.europe-west4.nscale.com/api/v1/organizations/{organizationID}/users"
payload = { "spec": {
"subject": "john.doe@acme.com",
"state": "active",
"groupIDs": ["0aaba80d-67ef-4799-b6d9-59f37e2ce2ad"]
} }
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({
spec: {
subject: 'john.doe@acme.com',
state: 'active',
groupIDs: ['0aaba80d-67ef-4799-b6d9-59f37e2ce2ad']
}
})
};
fetch('https://identity.nks.europe-west4.nscale.com/api/v1/organizations/{organizationID}/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://identity.nks.europe-west4.nscale.com/api/v1/organizations/{organizationID}/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([
'spec' => [
'subject' => 'john.doe@acme.com',
'state' => 'active',
'groupIDs' => [
'0aaba80d-67ef-4799-b6d9-59f37e2ce2ad'
]
]
]),
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://identity.nks.europe-west4.nscale.com/api/v1/organizations/{organizationID}/users"
payload := strings.NewReader("{\n \"spec\": {\n \"subject\": \"john.doe@acme.com\",\n \"state\": \"active\",\n \"groupIDs\": [\n \"0aaba80d-67ef-4799-b6d9-59f37e2ce2ad\"\n ]\n }\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://identity.nks.europe-west4.nscale.com/api/v1/organizations/{organizationID}/users")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"spec\": {\n \"subject\": \"john.doe@acme.com\",\n \"state\": \"active\",\n \"groupIDs\": [\n \"0aaba80d-67ef-4799-b6d9-59f37e2ce2ad\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://identity.nks.europe-west4.nscale.com/api/v1/organizations/{organizationID}/users")
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 \"spec\": {\n \"subject\": \"john.doe@acme.com\",\n \"state\": \"active\",\n \"groupIDs\": [\n \"0aaba80d-67ef-4799-b6d9-59f37e2ce2ad\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"metadata": {
"id": "ee45f34b-9685-40d8-8724-23c31252ca46",
"name": "undefined",
"organizationId": "d4600d6e-e965-4b44-a808-84fb2fa36702",
"creationTime": "2024-05-31T14:11:00Z",
"provisioningStatus": "provisioned",
"healthStatus": "healthy"
},
"spec": {
"subject": "john.doe@acme.com",
"state": "active",
"groupIDs": [
"0aaba80d-67ef-4799-b6d9-59f37e2ce2ad"
]
},
"status": {
"lastAcive": "2025-01-12T10:49:13Z"
}
}{
"error": "access_denied",
"error_description": "authentication failed"
}{
"error": "forbidden",
"error_description": "user credentials do not have the required privileges"
}{
"error": "conflict",
"error_description": "a resource with the same name already exists"
}{
"error": "server_error",
"error_description": "failed to token claim"
}Authorizations
Operation requires OAuth 2.0 bearer token authentication.
Path Parameters
An organization ID.
Body
application/json
Body required to create a user.
Was this page helpful?
⌘I