Abrechnungsorganisationen der Nutzer festlegen
curl --request PUT \
--url https://api.devin.ai/v3/enterprise/members/users/billing-orgs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"assignments": [
{
"billing_org_id": "<string>",
"user_id": "<string>"
}
]
}
'import requests
url = "https://api.devin.ai/v3/enterprise/members/users/billing-orgs"
payload = { "assignments": [
{
"billing_org_id": "<string>",
"user_id": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({assignments: [{billing_org_id: '<string>', user_id: '<string>'}]})
};
fetch('https://api.devin.ai/v3/enterprise/members/users/billing-orgs', 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/v3/enterprise/members/users/billing-orgs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'assignments' => [
[
'billing_org_id' => '<string>',
'user_id' => '<string>'
]
]
]),
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/v3/enterprise/members/users/billing-orgs"
payload := strings.NewReader("{\n \"assignments\": [\n {\n \"billing_org_id\": \"<string>\",\n \"user_id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.devin.ai/v3/enterprise/members/users/billing-orgs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"assignments\": [\n {\n \"billing_org_id\": \"<string>\",\n \"user_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3/enterprise/members/users/billing-orgs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"assignments\": [\n {\n \"billing_org_id\": \"<string>\",\n \"user_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"assigned": [
{
"billing_org_id": "<string>",
"user_id": "<string>"
}
],
"failed": [
{
"billing_org_id": "<string>",
"reason": "user_not_found",
"user_id": "<string>"
}
]
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}Nutzer & Mitgliedschaft (Enterprise)
Abrechnungsorganisationen der Nutzer festlegen
Die Abrechnungsorganisation für bis zu 100 Nutzer festlegen.
Änderungen betreffen nur die übermittelten Nutzer. Gültige Zuweisungen werden gemeinsam gespeichert, auch
wenn andere ungültig sind. Daher kann eine 200-Antwort Fehlschläge enthalten: Prüfen Sie immer failed.
Eine Fehlerantwort bedeutet, dass nichts gespeichert wurde. Das erneute Senden einer Zuweisung überschreibt
die aktuelle Abrechnungsorganisation des Nutzers und erzeugt einen weiteren Eintrag im Audit-Protokoll.
PUT
/
v3
/
enterprise
/
members
/
users
/
billing-orgs
Abrechnungsorganisationen der Nutzer festlegen
curl --request PUT \
--url https://api.devin.ai/v3/enterprise/members/users/billing-orgs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"assignments": [
{
"billing_org_id": "<string>",
"user_id": "<string>"
}
]
}
'import requests
url = "https://api.devin.ai/v3/enterprise/members/users/billing-orgs"
payload = { "assignments": [
{
"billing_org_id": "<string>",
"user_id": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({assignments: [{billing_org_id: '<string>', user_id: '<string>'}]})
};
fetch('https://api.devin.ai/v3/enterprise/members/users/billing-orgs', 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/v3/enterprise/members/users/billing-orgs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'assignments' => [
[
'billing_org_id' => '<string>',
'user_id' => '<string>'
]
]
]),
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/v3/enterprise/members/users/billing-orgs"
payload := strings.NewReader("{\n \"assignments\": [\n {\n \"billing_org_id\": \"<string>\",\n \"user_id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.devin.ai/v3/enterprise/members/users/billing-orgs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"assignments\": [\n {\n \"billing_org_id\": \"<string>\",\n \"user_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3/enterprise/members/users/billing-orgs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"assignments\": [\n {\n \"billing_org_id\": \"<string>\",\n \"user_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"assigned": [
{
"billing_org_id": "<string>",
"user_id": "<string>"
}
],
"failed": [
{
"billing_org_id": "<string>",
"reason": "user_not_found",
"user_id": "<string>"
}
]
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}Legt die Abrechnungsorganisation für bis zu 100 Nutzer in einer einzigen Anfrage fest. Geändert werden nur die von Ihnen übermittelten Nutzer; alle übrigen Nutzer der Enterprise bleiben unverändert. Für einzelne Nutzer akzeptiert auch der Endpunkt für Nutzereinstellungen (Beta) den Parameter
Künftig können weitere Gründe hinzukommen. Behandeln Sie unbekannte Werte daher als Fehlschlag und nicht als Fehler.
Eine Fehlerantwort (
billing_org_id.
Teilweiser Erfolg
Gültige Zuweisungen werden gespeichert, auch wenn andere Zeilen derselben Anfrage ungültig sind. Eine200-Antwort kann daher Fehlschläge enthalten. Werten Sie immer failed aus: Jeder Eintrag nennt den Nutzer, die angeforderte Organisation und einen reason. Die Abrechnungsorganisationen dieser Nutzer wurden nicht geändert. Korrigieren Sie die betroffenen Zeilen und senden Sie sie erneut.
reason | Bedeutung |
|---|---|
user_not_found | Der Nutzer ist weder direkt noch über eine Gruppe eines Identity Providers Mitglied des Enterprise. |
org_not_found | Die Organisation gehört nicht zum Enterprise. |
user_not_org_member | Die Organisation ist nicht die primäre Organisation des Enterprise, und der Nutzer ist nicht Mitglied dieser Organisation. |
4xx oder 5xx) bedeutet, dass nichts aus der Anfrage gespeichert wurde. Anfragen ohne Zuweisungen, mit mehr als 100 Zuweisungen oder mit mehrfach vorkommender user_id werden mit 422 abgelehnt.
Wird eine Zuweisung erneut gesendet, überschreibt sie die aktuelle Abrechnungsorganisation des Nutzers und erzeugt einen weiteren Eintrag im Audit-Protokoll. Wiederholte Aufrufe sind daher unbedenklich, aber nicht folgenlos.
Berechtigungen
Erfordert einen Service-Benutzer oder ein persönliches Zugriffstoken mit den beiden BerechtigungenManageBilling und ViewOrganizations auf Enterprise-Ebene. Alternativ zu ViewOrganizations genügt auch ManageOrganizations, da diese Berechtigung ViewOrganizations einschließt.Body
application/json
Antwort
Erfolgreiche Antwort

