Endpoint per la creazione di un'organizzazione Enterprise
curl --request POST \
--url https://api.devin.ai/v2/enterprise/organizations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"display_name": "<string>",
"acu_limit": 123,
"add_creator_as_member": true
}
'import requests
url = "https://api.devin.ai/v2/enterprise/organizations"
payload = {
"display_name": "<string>",
"acu_limit": 123,
"add_creator_as_member": True
}
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({display_name: '<string>', acu_limit: 123, add_creator_as_member: true})
};
fetch('https://api.devin.ai/v2/enterprise/organizations', 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.devin.ai/v2/enterprise/organizations",
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([
'display_name' => '<string>',
'acu_limit' => 123,
'add_creator_as_member' => true
]),
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.devin.ai/v2/enterprise/organizations"
payload := strings.NewReader("{\n \"display_name\": \"<string>\",\n \"acu_limit\": 123,\n \"add_creator_as_member\": true\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.devin.ai/v2/enterprise/organizations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"display_name\": \"<string>\",\n \"acu_limit\": 123,\n \"add_creator_as_member\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v2/enterprise/organizations")
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 \"display_name\": \"<string>\",\n \"acu_limit\": 123,\n \"add_creator_as_member\": true\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"org_id": "<string>",
"org_name": "<string>",
"max_cycle_acu_limit": 123,
"max_session_acu_limit": 123,
"org_admin_count": 0,
"org_member_count": 0,
"org_user_count": 0
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Organizzazioni
Crea organizzazione
Crea una nuova organizzazione in questo account Enterprise
POST
/
v2
/
enterprise
/
organizations
Endpoint per la creazione di un'organizzazione Enterprise
curl --request POST \
--url https://api.devin.ai/v2/enterprise/organizations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"display_name": "<string>",
"acu_limit": 123,
"add_creator_as_member": true
}
'import requests
url = "https://api.devin.ai/v2/enterprise/organizations"
payload = {
"display_name": "<string>",
"acu_limit": 123,
"add_creator_as_member": True
}
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({display_name: '<string>', acu_limit: 123, add_creator_as_member: true})
};
fetch('https://api.devin.ai/v2/enterprise/organizations', 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.devin.ai/v2/enterprise/organizations",
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([
'display_name' => '<string>',
'acu_limit' => 123,
'add_creator_as_member' => true
]),
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.devin.ai/v2/enterprise/organizations"
payload := strings.NewReader("{\n \"display_name\": \"<string>\",\n \"acu_limit\": 123,\n \"add_creator_as_member\": true\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.devin.ai/v2/enterprise/organizations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"display_name\": \"<string>\",\n \"acu_limit\": 123,\n \"add_creator_as_member\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v2/enterprise/organizations")
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 \"display_name\": \"<string>\",\n \"acu_limit\": 123,\n \"add_creator_as_member\": true\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"org_id": "<string>",
"org_name": "<string>",
"max_cycle_acu_limit": 123,
"max_session_acu_limit": 123,
"org_admin_count": 0,
"org_member_count": 0,
"org_user_count": 0
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Richiede una chiave API personale di un amministratore Enterprise.
Crea una nuova organizzazione all’interno del tuo account Enterprise con limiti di ACU opzionali.
Autorizzazioni
API key personale (apk_user_*) riservata agli amministratori Enterprise
Corpo
application/json
Risposta
Risposta corretta
⌘I

