Skip to content

Audit Logs API

Query audit logs for all actions performed within an organization. Audit logs are immutable and retained according to your plan.

Endpoints

MethodPathDescription
GET/api/audit-logsList audit logs

Audit Log Object

json
{
  "id": "aud_abc123",
  "action": "source.created",
  "entityType": "source",
  "entityId": "src_xyz789",
  "entityName": "GitHub Webhooks",
  "userId": "usr_abc123",
  "userEmail": "[email protected]",
  "userDisplayName": "John Doe",
  "metadata": {
    "name": "GitHub Webhooks",
    "slug": "github",
    "provider": "github"
  },
  "ipAddress": "192.168.1.1",
  "userAgent": "Mozilla/5.0...",
  "createdAt": "2024-01-15T10:30:00Z"
}

List Audit Logs

http
GET /api/audit-logs

Query Parameters

ParameterTypeDescription
pagenumberPage number (default: 1)
pageSizenumberItems per page (default: 50, max: 100)
actionstringFilter by action type (e.g., source.created)
entityTypestringFilter by entity type (e.g., source)
userIdstringFilter by user who performed the action
fromstringStart date (ISO 8601)
tostringEnd date (ISO 8601)

Example

bash
# Get all audit logs
curl https://api.hookbase.app/api/audit-logs \
  -H "Authorization: Bearer whr_your_api_key"

# Filter by action
curl "https://api.hookbase.app/api/audit-logs?action=source.deleted" \
  -H "Authorization: Bearer whr_your_api_key"

# Filter by entity type and date range
curl "https://api.hookbase.app/api/audit-logs?entityType=route&from=2024-01-01&to=2024-01-31" \
  -H "Authorization: Bearer whr_your_api_key"
javascript
// Get all audit logs
const response = await fetch('https://api.hookbase.app/api/audit-logs', {
  headers: {
    'Authorization': 'Bearer whr_your_api_key'
  }
});
const data = await response.json();

// Filter by action
const filtered = await fetch('https://api.hookbase.app/api/audit-logs?action=source.deleted', {
  headers: {
    'Authorization': 'Bearer whr_your_api_key'
  }
});

// Filter by entity type and date range
const rangeFiltered = await fetch(
  'https://api.hookbase.app/api/audit-logs?entityType=route&from=2024-01-01&to=2024-01-31',
  {
    headers: {
      'Authorization': 'Bearer whr_your_api_key'
    }
  }
);
python
import requests

# Get all audit logs
response = requests.get(
    'https://api.hookbase.app/api/audit-logs',
    headers={'Authorization': 'Bearer whr_your_api_key'}
)
data = response.json()

# Filter by action
filtered = requests.get(
    'https://api.hookbase.app/api/audit-logs?action=source.deleted',
    headers={'Authorization': 'Bearer whr_your_api_key'}
)

# Filter by entity type and date range
range_filtered = requests.get(
    'https://api.hookbase.app/api/audit-logs?entityType=route&from=2024-01-01&to=2024-01-31',
    headers={'Authorization': 'Bearer whr_your_api_key'}
)

Response

json
{
  "data": [
    {
      "id": "aud_abc123",
      "action": "source.created",
      "entityType": "source",
      "entityId": "src_xyz789",
      "entityName": "GitHub Webhooks",
      "userId": "usr_abc123",
      "userEmail": "[email protected]",
      "createdAt": "2024-01-15T10:30:00Z"
    },
    {
      "id": "aud_def456",
      "action": "route.updated",
      "entityType": "route",
      "entityId": "rte_main123",
      "entityName": "GitHub to Slack",
      "userId": "usr_def456",
      "userEmail": "[email protected]",
      "createdAt": "2024-01-15T10:25:00Z"
    }
  ],
  "pagination": {
    "total": 234,
    "page": 1,
    "pageSize": 50
  }
}

Action Types

Source Actions

ActionDescription
source.createdSource created
source.updatedSource settings updated
source.deletedSource deleted
source.secret_rotatedSigning secret rotated
source.importedSources imported from file
source.exportedSources exported

Destination Actions

ActionDescription
destination.createdDestination created
destination.updatedDestination settings updated
destination.deletedDestination deleted
destination.testedTest webhook sent
destination.importedDestinations imported
destination.exportedDestinations exported

Route Actions

ActionDescription
route.createdRoute created
route.updatedRoute settings updated
route.deletedRoute deleted
route.pausedRoute paused
route.resumedRoute resumed
route.circuit_resetCircuit breaker manually reset
route.importedRoutes imported
route.exportedRoutes exported

Organization Actions

ActionDescription
organization.updatedOrganization settings updated
organization.member_addedMember added
organization.member_removedMember removed
organization.member_role_changedMember role changed
organization.invite_createdInvite sent
organization.invite_acceptedInvite accepted

Security Actions

ActionDescription
api_key.createdAPI key created
api_key.revokedAPI key revoked
auth.loginUser logged in
auth.login_failedFailed login attempt
auth.2fa_enabledTwo-factor authentication enabled
auth.2fa_disabledTwo-factor authentication disabled
auth.password_changedPassword changed

Other Actions

ActionDescription
transform.createdTransform created
transform.updatedTransform updated
transform.deletedTransform deleted
filter.createdFilter created
filter.updatedFilter updated
filter.deletedFilter deleted
schema.createdSchema created
schema.updatedSchema updated
schema.deletedSchema deleted
custom_domain.createdCustom domain added
custom_domain.verifiedCustom domain verified
custom_domain.deletedCustom domain removed
notification_channel.createdNotification channel created
notification_channel.deletedNotification channel deleted

Entity Types

Entity TypeDescription
sourceWebhook source
destinationWebhook destination
routeRoute
transformTransform
filterFilter
schemaSchema
organizationOrganization
api_keyAPI key
custom_domainCustom domain
notification_channelNotification channel
cron_jobCron job
tunnelTunnel
authAuthentication event

Released under the MIT License.