Organizations
Create a organization role
POST
/
v1
/
organizations
/
{organizationId}
/
roles
TypeScript SDK
import Tembo from '@tembo-io/sdk';
const client = new Tembo();
const role = await client.organizations.roles.create('organizationId', {
name: 'x',
description: '',
permissions: ['organization:read'],
});use tembo_rs::*;
let client = Tembo::from_env()?;
let response = client
.organizations()
.roles()
.create(
"example",
RolesCreateBody::new("x".to_string(), vec![RolesCreateBodyPermission::OrganizationRead]),
)
.send()
.await?;
curl --request POST \
--url https://api.tembo.io/v1/organizations/{organizationId}/roles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"permissions": [],
"description": ""
}
'import requests
url = "https://api.tembo.io/v1/organizations/{organizationId}/roles"
payload = {
"name": "<string>",
"permissions": [],
"description": ""
}
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({name: '<string>', permissions: [], description: ''})
};
fetch('https://api.tembo.io/v1/organizations/{organizationId}/roles', 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.tembo.io/v1/organizations/{organizationId}/roles",
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([
'name' => '<string>',
'permissions' => [
],
'description' => ''
]),
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://api.tembo.io/v1/organizations/{organizationId}/roles"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"permissions\": [],\n \"description\": \"\"\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://api.tembo.io/v1/organizations/{organizationId}/roles")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"permissions\": [],\n \"description\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tembo.io/v1/organizations/{organizationId}/roles")
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 \"name\": \"<string>\",\n \"permissions\": [],\n \"description\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>"
}{
"error": "<string>",
"permission": "<string>"
}{
"error": "<string>",
"permission": "<string>"
}{
"error": "<string>",
"permission": "<string>"
}{
"error": "<string>",
"permission": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Required string length:
1 - 100Maximum array length:
238Available options:
organization:read, organization:write, organization:member:read, organization:member:write, organization:invitation:read, organization:invitation:write, organization:role:read, organization:role:write, organization:secret:read, organization:secret:write, organization:setting:read, organization:setting:write, organization:configuration:read, organization:configuration:write, organization:subscription:read, organization:subscription:write, organization:onboarding:read, organization:onboarding:write, organization:logo:read, organization:logo:write, organization:slack_connect:read, organization:slack_connect:write, billing:read, billing:write, billing:trial:read, billing:trial:write, billing:usage:read, billing:usage:write, billing:payment:read, billing:payment:write, billing:payment_method:read, billing:payment_method:write, billing:checkout:read, billing:checkout:write, billing:subscription_checkout:read, billing:subscription_checkout:write, billing:portal:read, billing:portal:write, billing:on_demand:read, billing:on_demand:write, billing:credit:read, billing:credit:write, billing:custom_price:read, billing:custom_price:write, billing:custom_plan:read, billing:custom_plan:write, billing:overage_report:read, billing:overage_report:write, api_key:read, api_key:write, user:read, user:write, user:setting:read, user:setting:write, user:environment_variable:read, user:environment_variable:write, user:subscription:read, user:subscription:write, user:connected_account:read, user:connected_account:write, user:organization:read, user:organization:write, user:profile_picture:read, user:profile_picture:write, user:deletion:read, user:deletion:write, agent:read, agent:write, agent:schedule:read, agent:schedule:write, agent:trigger:read, agent:trigger:write, agent:run:read, agent:run:write, agent:instruction_revision:read, agent:instruction_revision:write, agent:template:read, agent:template:write, session:read, session:write, session:message:read, session:message:write, session:artifact:read, session:artifact:write, session:source:read, session:source:write, session:command:read, session:command:write, session:input:read, session:input:write, session:queue:read, session:queue:write, session:event:read, session:event:write, session:file:read, session:file:write, session:diff:read, session:diff:write, session:workspace:read, session:workspace:write, session:workspace_file:read, session:workspace_file:write, session:workspace_diff:read, session:workspace_diff:write, session:workspace_preview:read, session:workspace_preview:write, pull_request:read, pull_request:write, pull_request:merge:read, pull_request:merge:write, pull_request:attachment:read, pull_request:attachment:write, pull_request:session:read, pull_request:session:write, pull_request:message:read, pull_request:message:write, pull_request:comment:read, pull_request:comment:write, pull_request:review:read, pull_request:review:write, pull_request:reaction:read, pull_request:reaction:write, pull_request:commit:read, pull_request:commit:write, pull_request:check:read, pull_request:check:write, pull_request:file:read, pull_request:file:write, pull_request:reviewer:read, pull_request:reviewer:write, pull_request:label:read, pull_request:label:write, pull_request:thread:read, pull_request:thread:write, pull_request:tour:read, pull_request:tour:write, pull_request:branch_status:read, pull_request:branch_status:write, pull_request:stack:read, pull_request:stack:write, repository:read, repository:write, repository:branch:read, repository:branch:write, repository:file:read, repository:file:write, repository:pull_request:read, repository:pull_request:write, repository:user:read, repository:user:write, repository:label:read, repository:label:write, integration:read, integration:write, integration:trigger:read, integration:trigger:write, integration:provider:read, integration:provider:write, integration:configuration:read, integration:configuration:write, integration:snyk_organization:read, integration:snyk_organization:write, integration:sentry_environment:read, integration:sentry_environment:write, integration:slack_channel:read, integration:slack_channel:write, integration:rate_limit:read, integration:rate_limit:write, mcp_connection:read, mcp_connection:write, mcp_connection:shared:read, mcp_connection:shared:write, model:read, model:write, project:read, project:write, project:environment_variable:read, project:environment_variable:write, project:snapshot:read, project:snapshot:write, project:build:read, project:build:write, project:build_detail:read, project:build_detail:write, project:schedule:read, project:schedule:write, project:default:read, project:default:write, project:system_snapshot:read, project:system_snapshot:write, project:organization_snapshot:read, project:organization_snapshot:write, sandbox:read, sandbox:write, sandbox:metric:read, sandbox:metric:write, sandbox:event:read, sandbox:event:write, sandbox:size:read, sandbox:size:write, sandbox:virtual_machine:read, sandbox:virtual_machine:write, device:read, device:write, skill:read, skill:write, skill:marketplace:read, skill:marketplace:write, insight:read, insight:write, insight:member:read, insight:member:write, insight:repository:read, insight:repository:write, insight:usage:read, insight:usage:write, file:read, file:write, pin:read, pin:write, folder:read, folder:write, queue:job:read, queue:job:write, queue:host_manager_job:read, queue:host_manager_job:write, queue:worker:read, queue:worker:write, queue:scheduled_job:read, queue:scheduled_job:write, queue:triggered_job:read, queue:triggered_job:write, runtime:read, runtime:write, session:source_credential:read, session:source_credential:write, device:all:write, insight:user:read Maximum string length:
1000Response
Create a organization role
Was this page helpful?
⌘I
TypeScript SDK
import Tembo from '@tembo-io/sdk';
const client = new Tembo();
const role = await client.organizations.roles.create('organizationId', {
name: 'x',
description: '',
permissions: ['organization:read'],
});use tembo_rs::*;
let client = Tembo::from_env()?;
let response = client
.organizations()
.roles()
.create(
"example",
RolesCreateBody::new("x".to_string(), vec![RolesCreateBodyPermission::OrganizationRead]),
)
.send()
.await?;
curl --request POST \
--url https://api.tembo.io/v1/organizations/{organizationId}/roles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"permissions": [],
"description": ""
}
'import requests
url = "https://api.tembo.io/v1/organizations/{organizationId}/roles"
payload = {
"name": "<string>",
"permissions": [],
"description": ""
}
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({name: '<string>', permissions: [], description: ''})
};
fetch('https://api.tembo.io/v1/organizations/{organizationId}/roles', 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.tembo.io/v1/organizations/{organizationId}/roles",
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([
'name' => '<string>',
'permissions' => [
],
'description' => ''
]),
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://api.tembo.io/v1/organizations/{organizationId}/roles"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"permissions\": [],\n \"description\": \"\"\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://api.tembo.io/v1/organizations/{organizationId}/roles")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"permissions\": [],\n \"description\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tembo.io/v1/organizations/{organizationId}/roles")
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 \"name\": \"<string>\",\n \"permissions\": [],\n \"description\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>"
}{
"error": "<string>",
"permission": "<string>"
}{
"error": "<string>",
"permission": "<string>"
}{
"error": "<string>",
"permission": "<string>"
}{
"error": "<string>",
"permission": "<string>"
}