curl --request PATCH \
--url https://api.devin.ai/v3/enterprise/usage-policies/budgets/{budget_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cycle_acu_limit": 4611686018427388000,
"name": "<string>",
"parent_budget_id": "<string>",
"temporary_cycle_acu_limit": 4611686018427388000
}
'import requests
url = "https://api.devin.ai/v3/enterprise/usage-policies/budgets/{budget_id}"
payload = {
"cycle_acu_limit": 4611686018427388000,
"name": "<string>",
"parent_budget_id": "<string>",
"temporary_cycle_acu_limit": 4611686018427388000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cycle_acu_limit: 4611686018427388000,
name: '<string>',
parent_budget_id: '<string>',
temporary_cycle_acu_limit: 4611686018427388000
})
};
fetch('https://api.devin.ai/v3/enterprise/usage-policies/budgets/{budget_id}', 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/usage-policies/budgets/{budget_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'cycle_acu_limit' => 4611686018427388000,
'name' => '<string>',
'parent_budget_id' => '<string>',
'temporary_cycle_acu_limit' => 4611686018427388000
]),
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/usage-policies/budgets/{budget_id}"
payload := strings.NewReader("{\n \"cycle_acu_limit\": 4611686018427388000,\n \"name\": \"<string>\",\n \"parent_budget_id\": \"<string>\",\n \"temporary_cycle_acu_limit\": 4611686018427388000\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.devin.ai/v3/enterprise/usage-policies/budgets/{budget_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cycle_acu_limit\": 4611686018427388000,\n \"name\": \"<string>\",\n \"parent_budget_id\": \"<string>\",\n \"temporary_cycle_acu_limit\": 4611686018427388000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3/enterprise/usage-policies/budgets/{budget_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cycle_acu_limit\": 4611686018427388000,\n \"name\": \"<string>\",\n \"parent_budget_id\": \"<string>\",\n \"temporary_cycle_acu_limit\": 4611686018427388000\n}"
response = http.request(request)
puts response.read_body{
"budget_id": "<string>",
"cycle_acu_limit": 123,
"name": "<string>",
"org_ids": [
"<string>"
],
"parent_budget_id": "<string>",
"status": "active",
"temporary_cycle_acu_limit": 123
}{
"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"
}Name, Limits oder übergeordnetes Budget eines Budgets aktualisieren
Das Budget umbenennen, seine eigenen Limits festlegen oder löschen oder es unter ein anderes Budget verschieben.
Es gelten dieselben Berechtigungsanforderungen wie bei der internen Budgets-API: Änderungen an Limits erfordern budget.configure für das übergeordnete Budget (beim Root-Budget gilt der Platzhalter); eine Umbenennung erfordert budget.configure und budget.share für das übergeordnete Budget; eine Verschiebung erfordert beide Berechtigungen sowohl für das bisherige als auch für das neue übergeordnete Budget. Das Limit begrenzt den Verbrauch, der dem Budget und seinen untergeordneten Budgets innerhalb eines monatlichen Zeitfensters angerechnet wird; bei einem mit einer Organisation verknüpften Budget wird cycle_acu_limit außerdem in das ACU-Limit der Organisation zurückgeschrieben.
curl --request PATCH \
--url https://api.devin.ai/v3/enterprise/usage-policies/budgets/{budget_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cycle_acu_limit": 4611686018427388000,
"name": "<string>",
"parent_budget_id": "<string>",
"temporary_cycle_acu_limit": 4611686018427388000
}
'import requests
url = "https://api.devin.ai/v3/enterprise/usage-policies/budgets/{budget_id}"
payload = {
"cycle_acu_limit": 4611686018427388000,
"name": "<string>",
"parent_budget_id": "<string>",
"temporary_cycle_acu_limit": 4611686018427388000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cycle_acu_limit: 4611686018427388000,
name: '<string>',
parent_budget_id: '<string>',
temporary_cycle_acu_limit: 4611686018427388000
})
};
fetch('https://api.devin.ai/v3/enterprise/usage-policies/budgets/{budget_id}', 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/usage-policies/budgets/{budget_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'cycle_acu_limit' => 4611686018427388000,
'name' => '<string>',
'parent_budget_id' => '<string>',
'temporary_cycle_acu_limit' => 4611686018427388000
]),
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/usage-policies/budgets/{budget_id}"
payload := strings.NewReader("{\n \"cycle_acu_limit\": 4611686018427388000,\n \"name\": \"<string>\",\n \"parent_budget_id\": \"<string>\",\n \"temporary_cycle_acu_limit\": 4611686018427388000\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.devin.ai/v3/enterprise/usage-policies/budgets/{budget_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cycle_acu_limit\": 4611686018427388000,\n \"name\": \"<string>\",\n \"parent_budget_id\": \"<string>\",\n \"temporary_cycle_acu_limit\": 4611686018427388000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3/enterprise/usage-policies/budgets/{budget_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cycle_acu_limit\": 4611686018427388000,\n \"name\": \"<string>\",\n \"parent_budget_id\": \"<string>\",\n \"temporary_cycle_acu_limit\": 4611686018427388000\n}"
response = http.request(request)
puts response.read_body{
"budget_id": "<string>",
"cycle_acu_limit": 123,
"name": "<string>",
"org_ids": [
"<string>"
],
"parent_budget_id": "<string>",
"status": "active",
"temporary_cycle_acu_limit": 123
}{
"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"
}Berechtigungen
Erfordert einen Service-Benutzer oder ein persönliches Zugriffstoken mit der BerechtigungManageAcuLimits auf Enterprise-Ebene oder delegierten Zugriff auf das Budget.Body
Partielles Update des Namens, der eigenen Limits oder des übergeordneten Budgets. Nicht angegebene Felder bleiben unverändert; null löscht ein Limit.
Antwort
Erfolgreiche Antwort
Ein Budget, dessen Nutzungsrichtlinien unter /usage-policies/budgets/{budget_id}/... verwaltet werden

