Create project
curl --request POST \
--url https://identity.nks.europe-west4.nscale.com/api/v1/organizations/{organizationID}/projects \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {
"name": "my-project"
},
"spec": {
"groupIDs": [
"ddde69ef-bb52-4815-9e9e-aed856c6057f"
]
}
}
'import requests
url = "https://identity.nks.europe-west4.nscale.com/api/v1/organizations/{organizationID}/projects"
payload = {
"metadata": { "name": "my-project" },
"spec": { "groupIDs": ["ddde69ef-bb52-4815-9e9e-aed856c6057f"] }
}
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({
metadata: {name: 'my-project'},
spec: {groupIDs: ['ddde69ef-bb52-4815-9e9e-aed856c6057f']}
})
};
fetch('https://identity.nks.europe-west4.nscale.com/api/v1/organizations/{organizationID}/projects', 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}/projects",
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([
'metadata' => [
'name' => 'my-project'
],
'spec' => [
'groupIDs' => [
'ddde69ef-bb52-4815-9e9e-aed856c6057f'
]
]
]),
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}/projects"
payload := strings.NewReader("{\n \"metadata\": {\n \"name\": \"my-project\"\n },\n \"spec\": {\n \"groupIDs\": [\n \"ddde69ef-bb52-4815-9e9e-aed856c6057f\"\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}/projects")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {\n \"name\": \"my-project\"\n },\n \"spec\": {\n \"groupIDs\": [\n \"ddde69ef-bb52-4815-9e9e-aed856c6057f\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://identity.nks.europe-west4.nscale.com/api/v1/organizations/{organizationID}/projects")
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 \"metadata\": {\n \"name\": \"my-project\"\n },\n \"spec\": {\n \"groupIDs\": [\n \"ddde69ef-bb52-4815-9e9e-aed856c6057f\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"metadata": {
"id": "a142f641-7fd6-4ab9-a875-344c7ebadc53",
"name": "my-project",
"organizationId": "d4600d6e-e965-4b44-a808-84fb2fa36702",
"creationTime": "2024-05-31T14:11:00Z",
"provisioningStatus": "provisioned",
"healthStatus": "healthy"
},
"spec": {
"groupIDs": [
"ef509cd1-c7e6-42f8-aae7-a01164dc60dc"
]
}
}{
"error": "invalid_request",
"error_description": "request body invalid"
}{
"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"
}Projects
Create project
Creates a new project resource for the user’s organization.
POST
/
api
/
v1
/
organizations
/
{organizationID}
/
projects
Create project
curl --request POST \
--url https://identity.nks.europe-west4.nscale.com/api/v1/organizations/{organizationID}/projects \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {
"name": "my-project"
},
"spec": {
"groupIDs": [
"ddde69ef-bb52-4815-9e9e-aed856c6057f"
]
}
}
'import requests
url = "https://identity.nks.europe-west4.nscale.com/api/v1/organizations/{organizationID}/projects"
payload = {
"metadata": { "name": "my-project" },
"spec": { "groupIDs": ["ddde69ef-bb52-4815-9e9e-aed856c6057f"] }
}
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({
metadata: {name: 'my-project'},
spec: {groupIDs: ['ddde69ef-bb52-4815-9e9e-aed856c6057f']}
})
};
fetch('https://identity.nks.europe-west4.nscale.com/api/v1/organizations/{organizationID}/projects', 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}/projects",
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([
'metadata' => [
'name' => 'my-project'
],
'spec' => [
'groupIDs' => [
'ddde69ef-bb52-4815-9e9e-aed856c6057f'
]
]
]),
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}/projects"
payload := strings.NewReader("{\n \"metadata\": {\n \"name\": \"my-project\"\n },\n \"spec\": {\n \"groupIDs\": [\n \"ddde69ef-bb52-4815-9e9e-aed856c6057f\"\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}/projects")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {\n \"name\": \"my-project\"\n },\n \"spec\": {\n \"groupIDs\": [\n \"ddde69ef-bb52-4815-9e9e-aed856c6057f\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://identity.nks.europe-west4.nscale.com/api/v1/organizations/{organizationID}/projects")
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 \"metadata\": {\n \"name\": \"my-project\"\n },\n \"spec\": {\n \"groupIDs\": [\n \"ddde69ef-bb52-4815-9e9e-aed856c6057f\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"metadata": {
"id": "a142f641-7fd6-4ab9-a875-344c7ebadc53",
"name": "my-project",
"organizationId": "d4600d6e-e965-4b44-a808-84fb2fa36702",
"creationTime": "2024-05-31T14:11:00Z",
"provisioningStatus": "provisioned",
"healthStatus": "healthy"
},
"spec": {
"groupIDs": [
"ef509cd1-c7e6-42f8-aae7-a01164dc60dc"
]
}
}{
"error": "invalid_request",
"error_description": "request body invalid"
}{
"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
Project request parameters.
Was this page helpful?
⌘I