Skip to main content
GET
/
v1
/
audit-logs
cURL
curl --request GET \
  --url 'https://api.coderabbit.ai/v1/audit-logs?page=1&page_size=25' \
  --header 'x-coderabbitai-api-key: <api-key>'
import requests

url = 'https://api.coderabbit.ai/v1/audit-logs'

headers = {'x-coderabbitai-api-key': '<api-key>'}

params = {'page': 1, 'page_size': 25}

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

print(response.text)
const options = {method: 'GET', headers: {'x-coderabbitai-api-key': '<api-key>'}};

fetch('https://api.coderabbit.ai/v1/audit-logs?page=1&page_size=25', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
package main

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

func main() {

url := "https://api.coderabbit.ai/v1/audit-logs?page=1&page_size=25"

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

req.Header.Add("x-coderabbitai-api-key", "<api-key>")

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

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

fmt.Println(string(body))

}
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.coderabbit.ai/v1/audit-logs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-coderabbitai-api-key: <api-key>"
],
]);

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

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
HttpResponse<String> response = Unirest.get("https://api.coderabbit.ai/v1/audit-logs")
.header("x-coderabbitai-api-key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.coderabbit.ai/v1/audit-logs")

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

request = Net::HTTP::Get.new(url)
request["x-coderabbitai-api-key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "data": [
    {
      "id": "<string>",
      "action": "<string>",
      "actionLabel": "<string>",
      "resourceType": "<string>",
      "resourceTypeLabel": "<string>",
      "resourceSummary": "<string>",
      "actor": {
        "name": "<string>",
        "subtitle": "<string>",
        "isBot": true,
        "avatarUrl": "<string>"
      },
      "metadata": {},
      "ipAddress": "<string>",
      "createdAt": "2023-11-07T05:31:56Z",
      "relativeTime": "<string>"
    }
  ],
  "pagination": {
    "page": 123,
    "page_size": 123,
    "total_count": 123,
    "total_pages": 123,
    "has_next_page": true,
    "has_previous_page": true
  },
  "filter_options": {
    "actions": [
      {
        "value": "<string>",
        "label": "<string>",
        "count": 123
      }
    ],
    "resource_types": [
      {
        "value": "<string>",
        "label": "<string>",
        "count": 123
      }
    ]
  }
}
Returns a paginated list of organization-level audit log entries. Use the search, actions, resource_types, date_from, and date_to query parameters to filter results. Unknown query parameters are rejected with a 400 error. For a guided overview of the feature, see the Audit Logs documentation.

Authorizations

x-coderabbitai-api-key
string
header
required

API key for authentication. You can create an API key from the CodeRabbit dashboard.

Query Parameters

Case-insensitive partial match on actor name. Max 200 characters.

Maximum string length: 200
actions
string

Comma-separated list of action keys to filter by. Up to 50 values. Example: repository_create,api_key_delete

resource_types
string

Comma-separated list of resource type keys to filter by. Up to 50 values. Example: repository,api_key

date_from
string<date-time>

Inclusive lower bound for the event timestamp, in ISO 8601 format.

date_to
string<date-time>

Inclusive upper bound for the event timestamp, in ISO 8601 format. Must be on or after date_from.

page
integer
default:1

Page number (1-based). Defaults to 1.

Required range: x >= 1
page_size
integer
default:10

Number of results per page. Defaults to 10, max 100.

Required range: 1 <= x <= 100

Response

A paginated list of audit log entries.

data
object[]
required

List of audit log entries for the current page.

pagination
object
required

Pagination metadata.

filter_options
object
required

Distinct action and resource type values present in the organization's log, useful for building filter UIs.