bitcain docs
API Reference

Audit logs

Audit logging and compliance - query, export, and verify audit logs (requires admin role)

List audit logs with filtering and pagination

GET
/api/audit-logs

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

user_id?|

Filter by user ID (UUID)

event_type?|

Filter by event type

severity?|

Filter by severity level

compliance_status?|

Filter by compliance status

table_name?|

Filter by affected table name

record_id?|

Filter by affected record ID (UUID)

symbol?|

Filter by trading symbol

start_date?|

Filter by start date (ISO 8601)

end_date?|

Filter by end date (ISO 8601)

is_resolved?|

Filter by resolution status

min_risk_score?||

Filter by minimum risk score

limit?integer

Maximum number of results

Default100
Range1 <= value <= 1000
offset?integer

Number of results to skip

Default0
Range0 <= value

Response Body

application/json

application/json

curl -X GET "https://loading/api/audit-logs"
{
  "audit_logs": [
    {
      "id": "string",
      "event_type": "string",
      "severity": "string",
      "event_description": "string",
      "user_id": "string",
      "session_id": "string",
      "table_name": "string",
      "record_id": "string",
      "old_values": {},
      "new_values": {},
      "changed_fields": [
        "string"
      ],
      "ip_address": "string",
      "user_agent": "string",
      "request_id": "string",
      "endpoint": "string",
      "http_method": "string",
      "symbol": "string",
      "amount": "string",
      "currency": "string",
      "exchange": "string",
      "compliance_status": "string",
      "risk_score": "string",
      "flagged_keywords": [
        "string"
      ],
      "country_code": "string",
      "jurisdiction": "string",
      "regulatory_framework": "string",
      "audit_metadata": {},
      "tags": [
        "string"
      ],
      "error_code": "string",
      "error_message": "string",
      "stack_trace": "string",
      "is_resolved": false,
      "resolved_at": "string",
      "resolved_by": "string",
      "resolution_notes": "string",
      "created_at": "string"
    }
  ],
  "total": 0,
  "limit": 0,
  "offset": 0
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Export audit logs to CSV or JSON

GET
/api/audit-logs/export

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

format?string

Export format (csv or json)

Default"csv"
Value in"csv" | "json"
user_id?|

Filter by user ID (UUID)

event_type?|

Filter by event type

severity?|

Filter by severity level

compliance_status?|

Filter by compliance status

start_date?|

Filter by start date (ISO 8601)

end_date?|

Filter by end date (ISO 8601)

limit?integer

Maximum number of results to export

Default10000
Range1 <= value <= 50000

Response Body

application/json

application/json

curl -X GET "https://loading/api/audit-logs/export"
null
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Export audit logs to CEF format

GET
/api/audit-logs/export/cef

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

user_id?|

Filter by user ID (UUID)

event_type?|

Filter by event type

severity?|

Filter by severity level

start_date?|

Filter by start date (ISO 8601)

end_date?|

Filter by end date (ISO 8601)

chunk_size?integer

Chunk size for streaming export

Default1000
Range100 <= value <= 5000

Response Body

application/json

application/json

curl -X GET "https://loading/api/audit-logs/export/cef"
null
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Export audit logs to LEEF format

GET
/api/audit-logs/export/leef

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

user_id?|

Filter by user ID (UUID)

event_type?|

Filter by event type

severity?|

Filter by severity level

start_date?|

Filter by start date (ISO 8601)

end_date?|

Filter by end date (ISO 8601)

chunk_size?integer

Chunk size for streaming export

Default1000
Range100 <= value <= 5000

Response Body

application/json

application/json

curl -X GET "https://loading/api/audit-logs/export/leef"
null
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Export audit logs to Syslog format

GET
/api/audit-logs/export/syslog

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

user_id?|

Filter by user ID (UUID)

event_type?|

Filter by event type

severity?|

Filter by severity level

start_date?|

Filter by start date (ISO 8601)

end_date?|

Filter by end date (ISO 8601)

chunk_size?integer

Chunk size for streaming export

Default1000
Range100 <= value <= 5000

Response Body

application/json

application/json

curl -X GET "https://loading/api/audit-logs/export/syslog"
null
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Verify integrity of audit logs

GET
/api/audit-logs/verify

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

start_date?|

Verify logs from this date onwards

end_date?|

Verify logs up to this date

limit?integer

Maximum number of logs to verify

Default1000
Range1 <= value <= 10000

Response Body

application/json

application/json

curl -X GET "https://loading/api/audit-logs/verify"
{
  "verified": true,
  "total_checked": 0,
  "tampered_logs": [
    "string"
  ],
  "message": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Verify audit log hash chain integrity

GET
/api/audit-logs/verify-chain

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

start_date?|

Start date for verification (ISO 8601)

end_date?|

End date for verification (ISO 8601)

limit?|

Maximum number of records to verify

Response Body

application/json

application/json

curl -X GET "https://loading/api/audit-logs/verify-chain"
{
  "verified": true,
  "total_checked": 0,
  "tampered_logs": [
    "string"
  ],
  "message": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get single audit log by ID

GET
/api/audit-logs/{audit_id}

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

audit_id*string

Response Body

application/json

application/json

curl -X GET "https://loading/api/audit-logs/string"
{
  "id": "string",
  "event_type": "string",
  "severity": "string",
  "event_description": "string",
  "user_id": "string",
  "session_id": "string",
  "table_name": "string",
  "record_id": "string",
  "old_values": {},
  "new_values": {},
  "changed_fields": [
    "string"
  ],
  "ip_address": "string",
  "user_agent": "string",
  "request_id": "string",
  "endpoint": "string",
  "http_method": "string",
  "symbol": "string",
  "amount": "string",
  "currency": "string",
  "exchange": "string",
  "compliance_status": "string",
  "risk_score": "string",
  "flagged_keywords": [
    "string"
  ],
  "country_code": "string",
  "jurisdiction": "string",
  "regulatory_framework": "string",
  "audit_metadata": {},
  "tags": [
    "string"
  ],
  "error_code": "string",
  "error_message": "string",
  "stack_trace": "string",
  "is_resolved": false,
  "resolved_at": "string",
  "resolved_by": "string",
  "resolution_notes": "string",
  "created_at": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

List configured webhooks

GET
/api/audit-logs/webhooks

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

is_active?|

Filter by active status

Response Body

application/json

application/json

curl -X GET "https://loading/api/audit-logs/webhooks"
{
  "webhooks": [
    {
      "id": "string",
      "user_id": "string",
      "webhook_url": "string",
      "secret_key": "string",
      "event_types": [
        "string"
      ],
      "is_active": true,
      "max_retries": 0,
      "retry_backoff_seconds": 0,
      "created_at": "string",
      "updated_at": "string",
      "last_delivery_at": "string",
      "failed_deliveries": 0
    }
  ],
  "total": 0
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Configure webhook for real-time audit log delivery

POST
/api/audit-logs/webhooks

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Request Body

application/json

webhook_url*string

HTTPS webhook endpoint URL

event_types?array<>|

List of event types to deliver (null/empty = all events)

description?|

Optional webhook description

Response Body

application/json

application/json

curl -X POST "https://loading/api/audit-logs/webhooks" \  -H "Content-Type: application/json" \  -d '{    "webhook_url": "string"  }'
{
  "id": "string",
  "user_id": "string",
  "webhook_url": "string",
  "secret_key": "string",
  "event_types": [
    "string"
  ],
  "is_active": true,
  "max_retries": 0,
  "retry_backoff_seconds": 0,
  "created_at": "string",
  "updated_at": "string",
  "last_delivery_at": "string",
  "failed_deliveries": 0
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Delete webhook configuration

DELETE
/api/audit-logs/webhooks/{webhook_id}

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

webhook_id*string

Webhook ID to delete

Response Body

application/json

curl -X DELETE "https://loading/api/audit-logs/webhooks/string"
Empty
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}