Set a repository's Review billing rule
curl --request PUT \
--url https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"bill_to": {
"id": "<string>"
},
"repository": "<string>"
}
'import requests
url = "https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules"
payload = {
"bill_to": { "id": "<string>" },
"repository": "<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({bill_to: {id: '<string>'}, repository: '<string>'})
};
fetch('https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules', 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/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules",
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([
'bill_to' => [
'id' => '<string>'
],
'repository' => '<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/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules"
payload := strings.NewReader("{\n \"bill_to\": {\n \"id\": \"<string>\"\n },\n \"repository\": \"<string>\"\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/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"bill_to\": {\n \"id\": \"<string>\"\n },\n \"repository\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules")
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 \"bill_to\": {\n \"id\": \"<string>\"\n },\n \"repository\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"bill_to": {
"id": "<string>",
"type": "organization"
},
"created_at": 123,
"id": "<string>",
"repository": "<string>",
"updated_at": 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"
}Review Billing Rules (Enterprise) [Beta]
Set a repository's Review billing rule
Assign future Review usage on one repository to an organization or budget.
PUT
/
v3beta1
/
enterprise
/
organizations
/
{org_id}
/
review-settings
/
repo-billing-rules
Set a repository's Review billing rule
curl --request PUT \
--url https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"bill_to": {
"id": "<string>"
},
"repository": "<string>"
}
'import requests
url = "https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules"
payload = {
"bill_to": { "id": "<string>" },
"repository": "<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({bill_to: {id: '<string>'}, repository: '<string>'})
};
fetch('https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules', 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/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules",
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([
'bill_to' => [
'id' => '<string>'
],
'repository' => '<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/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules"
payload := strings.NewReader("{\n \"bill_to\": {\n \"id\": \"<string>\"\n },\n \"repository\": \"<string>\"\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/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"bill_to\": {\n \"id\": \"<string>\"\n },\n \"repository\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules")
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 \"bill_to\": {\n \"id\": \"<string>\"\n },\n \"repository\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"bill_to": {
"id": "<string>",
"type": "organization"
},
"created_at": 123,
"id": "<string>",
"repository": "<string>",
"updated_at": 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"
}Creates or replaces the billing rule for one exact repository, so that future Devin Review usage on it is charged to an organization or a budget. To see existing rules, use List repository billing rules.
Permissions
Requires a service user or personal access token with theManageReview permission in the organization. The caller can manage rules only for repositories delegated to that organization, and can bill only to that organization or a budget it manages.
Behavior
repositoryacceptsowner/repofor github.com,host/pathfor other providers, or a full repository URL. It must name one exact repository. Wildcards are rejected with422.- A repository has at most one rule. Sending a repository that already has a rule replaces who pays and keeps the same rule
id. bill_to.typeisorganizationorbudget, andbill_to.idis the matching organization ID or budget ID. A target the caller can’t use returns400or403.- The rule applies to future reviews only. Usage already charged is not moved.
- Returns
409when the repository is already mapped through another git connection on the same host, or when the rule changed during the request. Retry the request in the second case.
Body
application/json
Response
Successful Response

