Appearance
Export Endpoints
Generate and download reports and data exports.
Export Audit Log
Export audit log data.
POST /api/export/auditRequest
json
{
"start_date": "2024-01-01",
"end_date": "2024-01-31",
"format": "csv",
"filters": {
"entity_types": ["US_SSN", "CREDIT_CARD"],
"user_ids": ["user_123"]
}
}| Field | Type | Required | Description |
|---|---|---|---|
start_date | string | Yes | Start date (YYYY-MM-DD) |
end_date | string | Yes | End date (YYYY-MM-DD) |
format | string | No | csv, json, or xlsx |
filters | object | No | Filter criteria |
Response
json
{
"export_id": "exp_abc123",
"status": "processing",
"format": "csv",
"record_count": null,
"download_url": null,
"expires_at": null
}Check Export Status
GET /api/export/{export_id}Response when ready:
json
{
"export_id": "exp_abc123",
"status": "completed",
"format": "csv",
"record_count": 1500,
"download_url": "https://api.ghostai.com/v1/downloads/exp_abc123",
"expires_at": "2024-01-15T12:00:00Z"
}Export Compliance Report
Generate compliance reports.
POST /api/export/complianceRequest
json
{
"report_type": "hipaa",
"period": "monthly",
"month": "2024-01",
"format": "pdf",
"include_details": true
}Report types:
hipaa- HIPAA compliance summarypci- PCI-DSS compliance summarygdpr- GDPR compliance summarygeneral- General compliance report
Response
json
{
"export_id": "exp_xyz789",
"status": "processing",
"report_type": "hipaa",
"download_url": null
}Export Board Report
Generate executive board report.
POST /api/export/boardRequest
json
{
"period": "2024-Q1",
"format": "pdf",
"sections": ["executive_summary", "risk_analysis", "recommendations"],
"branding": true
}Response
json
{
"export_id": "exp_board123",
"status": "processing",
"pages": null,
"download_url": null
}Export Session Data
Export conversation history.
POST /api/export/sessionRequest
json
{
"session_id": "sess_abc123",
"format": "json",
"include_tokens": false,
"include_audit": true
}Response
json
{
"session_id": "sess_abc123",
"export_id": "exp_sess456",
"messages": 25,
"download_url": "https://api.ghostai.com/v1/downloads/exp_sess456"
}Download Export
Download a completed export.
GET /api/downloads/{export_id}Returns the file with appropriate Content-Type header.
Example
bash
# Start export
curl -X POST https://api.ghostai.com/v1/export/audit \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"start_date": "2024-01-01",
"end_date": "2024-01-31",
"format": "csv"
}'
# Check status
curl https://api.ghostai.com/v1/export/exp_abc123 \
-H "Authorization: Bearer YOUR_TOKEN"
# Download when ready
curl -O https://api.ghostai.com/v1/downloads/exp_abc123 \
-H "Authorization: Bearer YOUR_TOKEN"Scheduled Exports
Set up recurring exports.
POST /api/export/scheduledRequest
json
{
"report_type": "compliance",
"schedule": "weekly",
"day_of_week": 1,
"format": "pdf",
"recipients": ["compliance@company.com"],
"enabled": true
}Response
json
{
"schedule_id": "sch_abc123",
"next_run": "2024-01-22T08:00:00Z",
"enabled": true
}List Scheduled Exports
GET /api/export/scheduledUpdate Schedule
PUT /api/export/scheduled/{schedule_id}Delete Schedule
DELETE /api/export/scheduled/{schedule_id}