Create a role
curl --request POST \
--url https://codecobra.ai/api/organizations/{org_id}/roles \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"code_access": "read",
"delete_projects": false,
"manage_connections": false,
"manage_members": false,
"manage_projects": false,
"manage_roles": false,
"odoo_max_tier": "read",
"usage_access": false
}
'import requests
url = "https://codecobra.ai/api/organizations/{org_id}/roles"
payload = {
"name": "<string>",
"code_access": "read",
"delete_projects": False,
"manage_connections": False,
"manage_members": False,
"manage_projects": False,
"manage_roles": False,
"odoo_max_tier": "read",
"usage_access": False
}
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({
name: '<string>',
code_access: 'read',
delete_projects: false,
manage_connections: false,
manage_members: false,
manage_projects: false,
manage_roles: false,
odoo_max_tier: 'read',
usage_access: false
})
};
fetch('https://codecobra.ai/api/organizations/{org_id}/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://codecobra.ai/api/organizations/{org_id}/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>',
'code_access' => 'read',
'delete_projects' => false,
'manage_connections' => false,
'manage_members' => false,
'manage_projects' => false,
'manage_roles' => false,
'odoo_max_tier' => 'read',
'usage_access' => false
]),
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://codecobra.ai/api/organizations/{org_id}/roles"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"code_access\": \"read\",\n \"delete_projects\": false,\n \"manage_connections\": false,\n \"manage_members\": false,\n \"manage_projects\": false,\n \"manage_roles\": false,\n \"odoo_max_tier\": \"read\",\n \"usage_access\": false\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://codecobra.ai/api/organizations/{org_id}/roles")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"code_access\": \"read\",\n \"delete_projects\": false,\n \"manage_connections\": false,\n \"manage_members\": false,\n \"manage_projects\": false,\n \"manage_roles\": false,\n \"odoo_max_tier\": \"read\",\n \"usage_access\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://codecobra.ai/api/organizations/{org_id}/roles")
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 \"name\": \"<string>\",\n \"code_access\": \"read\",\n \"delete_projects\": false,\n \"manage_connections\": false,\n \"manage_members\": false,\n \"manage_projects\": false,\n \"manage_roles\": false,\n \"odoo_max_tier\": \"read\",\n \"usage_access\": false\n}"
response = http.request(request)
puts response.read_body{
"billing_access": true,
"code_access": "<string>",
"delete_projects": true,
"is_builtin": true,
"key": "<string>",
"locked": true,
"manage_connections": true,
"manage_members": true,
"manage_projects": true,
"manage_roles": true,
"name": "<string>",
"odoo_max_tier": "<string>",
"usage_access": true,
"can_assign": false,
"can_delete": false,
"can_edit": false,
"can_move": false,
"color": "slate",
"delete_blocked_reason": "<string>",
"member_count": 0
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Members & Invitations
Create a role
Add a role to the workspace. Needs a role that manages roles, and the new role can’t allow more than yours does. Sharing Odoo connections needs some Odoo access (400), and deleting and transferring projects needs managing them (400).
POST
/
api
/
organizations
/
{org_id}
/
roles
Create a role
curl --request POST \
--url https://codecobra.ai/api/organizations/{org_id}/roles \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"code_access": "read",
"delete_projects": false,
"manage_connections": false,
"manage_members": false,
"manage_projects": false,
"manage_roles": false,
"odoo_max_tier": "read",
"usage_access": false
}
'import requests
url = "https://codecobra.ai/api/organizations/{org_id}/roles"
payload = {
"name": "<string>",
"code_access": "read",
"delete_projects": False,
"manage_connections": False,
"manage_members": False,
"manage_projects": False,
"manage_roles": False,
"odoo_max_tier": "read",
"usage_access": False
}
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({
name: '<string>',
code_access: 'read',
delete_projects: false,
manage_connections: false,
manage_members: false,
manage_projects: false,
manage_roles: false,
odoo_max_tier: 'read',
usage_access: false
})
};
fetch('https://codecobra.ai/api/organizations/{org_id}/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://codecobra.ai/api/organizations/{org_id}/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>',
'code_access' => 'read',
'delete_projects' => false,
'manage_connections' => false,
'manage_members' => false,
'manage_projects' => false,
'manage_roles' => false,
'odoo_max_tier' => 'read',
'usage_access' => false
]),
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://codecobra.ai/api/organizations/{org_id}/roles"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"code_access\": \"read\",\n \"delete_projects\": false,\n \"manage_connections\": false,\n \"manage_members\": false,\n \"manage_projects\": false,\n \"manage_roles\": false,\n \"odoo_max_tier\": \"read\",\n \"usage_access\": false\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://codecobra.ai/api/organizations/{org_id}/roles")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"code_access\": \"read\",\n \"delete_projects\": false,\n \"manage_connections\": false,\n \"manage_members\": false,\n \"manage_projects\": false,\n \"manage_roles\": false,\n \"odoo_max_tier\": \"read\",\n \"usage_access\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://codecobra.ai/api/organizations/{org_id}/roles")
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 \"name\": \"<string>\",\n \"code_access\": \"read\",\n \"delete_projects\": false,\n \"manage_connections\": false,\n \"manage_members\": false,\n \"manage_projects\": false,\n \"manage_roles\": false,\n \"odoo_max_tier\": \"read\",\n \"usage_access\": false\n}"
response = http.request(request)
puts response.read_body{
"billing_access": true,
"code_access": "<string>",
"delete_projects": true,
"is_builtin": true,
"key": "<string>",
"locked": true,
"manage_connections": true,
"manage_members": true,
"manage_projects": true,
"manage_roles": true,
"name": "<string>",
"odoo_max_tier": "<string>",
"usage_access": true,
"can_assign": false,
"can_delete": false,
"can_edit": false,
"can_move": false,
"color": "slate",
"delete_blocked_reason": "<string>",
"member_count": 0
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Path Parameters
Body
application/json
Required string length:
1 - 60Available options:
read, write, merge_staging, merge_production Available options:
amber, blue, green, violet, rose, teal, orange, sky, pink, lime, indigo, slate Available options:
none, read, write, delete Response
Successful Response