メインコンテンツへスキップ
GET
/
v3beta1
/
enterprise
/
organizations
/
{org_id}
/
guardrail-violations
組織内のガードレール違反の一覧
curl --request GET \
  --url https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/guardrail-violations \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/guardrail-violations"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/guardrail-violations', 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}/guardrail-violations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/guardrail-violations"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/guardrail-violations")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/guardrail-violations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "items": [
    {
      "action_taken": "<string>",
      "confidence_score": 123,
      "created_at": 123,
      "event_id": "<string>",
      "guardrail_id": "<string>",
      "guardrail_name": "<string>",
      "org_id": "<string>",
      "reasoning": "<string>",
      "session_id": "<string>",
      "user_message": "<string>",
      "violation_id": 123
    }
  ],
  "end_cursor": "<string>",
  "has_next_page": false,
  "total": 123
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}
Guardrailsの仕組みや設定方法の概要については、AI Guardrails の機能ガイドを参照してください。

権限

この操作には、Enterprise レベルで ManageEnterpriseSettings 権限を持つサービスユーザーが必要です。

時間フィルター

このエンドポイントは、クエリパラメータ time_aftertime_before を使った任意指定可能な時間フィルターをサポートしています。
  • time_aftertime_before はどちらも UTC として解釈される秒単位の Unix タイムスタンプです。
  • time_before を指定する場合は、必ず time_after も指定する必要があります。
  • time_aftertime_before の間の時間範囲は、100 日以内でなければなりません。
  • 時間フィルターが指定されていない場合、API は利用可能な全履歴分のガードレール違反 (ページネーションの制約内) を返します。

承認

Authorization
string
header
必須

サービスユーザーの認証情報(接頭辞: cog_)

パスパラメータ

org_id
string
必須

組織ID(プレフィックス: org-)

:

"org-abc123def456"

クエリパラメータ

order
enum<string>
デフォルト:desc
利用可能なオプション:
asc,
desc
time_before
integer | null
time_after
integer | null
after
string | null
first
integer
デフォルト:100
必須範囲: 1 <= x <= 200
session_id
string | null
guardrail_id
string | null

レスポンス

成功レスポンス

items
GuardrailViolationResponse · object[]
必須
end_cursor
string | null

次ページを取得するためのカーソル。最終ページの場合は None。

has_next_page
boolean
デフォルト:false

このページの後に、さらに項目が存在するかどうか。

total
integer | null

任意の合計件数(パフォーマンス上の理由から省略される場合があります)。