Coregit
API Reference

Audit Log

View an immutable record of all security-relevant actions in your organization.

Overview

The audit log records all write operations and security events in your organization. Each entry captures the actor, action, affected resource, and request metadata.

List Audit Events

GET /v1/audit-log

Permission: Master API key only.

Query Parameters

ParameterDescription
limitItems per page (1-200, default 50)
cursorPagination cursor (event ID from next_cursor)
actionFilter by action (e.g. repo.create, token.create)
resource_typeFilter by resource type (e.g. repo, token, branch)
sinceISO 8601 timestamp — only events after this time
untilISO 8601 timestamp — only events before this time

Response 200

{
  "events": [
    {
      "id": 42,
      "actor_id": "key_abc123",
      "actor_type": "master_key",
      "action": "repo.create",
      "resource_type": "repo",
      "resource_id": "repo_xyz",
      "metadata": { "slug": "my-app", "visibility": "private" },
      "ip_address": "203.0.113.1",
      "request_id": "a1b2c3d4",
      "created_at": "2026-04-05T12:00:00Z"
    }
  ],
  "next_cursor": "41"
}

Actor Types

TypeDescription
master_keyAction performed with a master API key
scoped_tokenAction performed with a scoped token
internalAction performed by the system (e.g. sync webhook)

Common Actions

ActionResource TypeTrigger
repo.createrepoRepository created
repo.deleterepoRepository deleted
branch.createbranchBranch created
branch.deletebranchBranch deleted
token.createtokenScoped token created
token.revoketokenScoped token revoked
webhook.createwebhookWebhook created
webhook.deletewebhookWebhook deleted

SDK Examples

// List recent events
const { data } = await git.audit.list({ limit: 20 });
console.log(data.events);

// Filter by action
const { data } = await git.audit.list({
  action: "repo.create",
  since: "2026-04-01T00:00:00Z",
});

// Paginate
const { data: page1 } = await git.audit.list({ limit: 50 });
if (page1.next_cursor) {
  const { data: page2 } = await git.audit.list({
    limit: 50,
    cursor: page1.next_cursor,
  });
}

On this page