Skip to main content
GET
/
v3beta1
/
enterprise
/
organizations
/
{org_id}
/
guardrail-violations
List Organization 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>"
    }
  ]
}
For an overview of how guardrails work and how to configure them, see the AI Guardrails feature guide.

Permissions

Requires a service user with the ManageEnterpriseSettings permission at the enterprise level.

Time filters

This endpoint supports optional time filters using the time_after and time_before query parameters.
  • Both time_after and time_before are Unix timestamps in seconds, interpreted as UTC.
  • If you provide time_before, you must also provide time_after.
  • The time range between time_after and time_before must be 100 days or less.
  • If no time filters are provided, the API returns guardrail violations for the full available history (subject to pagination).

Authorizations

Authorization
string
header
required

Service User credential (prefix: cog_)

Path Parameters

org_id
string
required

Organization ID (prefix: org-)

Example:

"org-abc123def456"

Query Parameters

order
enum<string>
default:desc
Available options:
asc,
desc
time_before
integer | null
time_after
integer | null
after
string | null
first
integer
default:100
Required range: 1 <= x <= 200
session_id
string | null
guardrail_id
string | null

Response

Successful Response

items
GuardrailViolationResponse · object[]
required
end_cursor
string | null

Cursor to fetch the next page, or None if this is the last page.

has_next_page
boolean
default:false

Whether there are more items available after this page.

total
integer | null

Optional total count (can be omitted for performance).