Data Portability

Export your organization's data at any time. We support selective, app-by-app export across all major data classes, plus FHIR-compliant clinical bulk export for healthcare customers.

Quick start

What you can export:

Export surfaces — at a glance

Surface Endpoint Format Scope Status Cap
DocumentsGET /api/documents/{id}/download/Original formatPer-docLiveDisk-bounded
FHIR bulkPOST /api/ehr/fhir/r4/$exportNDJSON / JSONSystem / patient / groupLive24-hour retention
Training datasetsPOST /api/training_data/datasets/{id}/export/JSONLPer-datasetLiveAsync Celery job
Compliance (RoPA, transfers)POST /api/v1/data-mapping/exports/PDF / Excel / CSVOrg-scopedLive24-hour expiry
PMO tasksGET /api/v1/pmo/tasks/export/?project=X&format=csvCSVOrg-scopedLiveAll columns
PMO projectsGET /api/v1/pmo/projects-export/CSVOrg-scopedLiveAll columns
Audit logsGET /api/core/audit/export/?format=csvCSVOrg-scopedLive10,000 records max
Agent governanceGET /api/agents/governance-audit/export/CSVOrg-scopedLiveStreaming
Agent analyticsGET /api/agents/analytics/export/?type=usageCSVOrg-scopedLiveStreaming
ITSM ticketsGET /api/itsm/tickets/export/CSVOrg-scopedLiveAll columns
Risk assessmentsGET /api/risk-assessment/conformity/{id}/export/CSV / JSONPer-assessmentLiveN/A
InvestigationsGET /api/investigation/{id}/export-pdf/PDFPer-investigationLiveN/A
TaxonomyGET /api/documents/taxonomy/export/JSONOrg-scopedLiveFull snapshot

All exports are audit-logged. Files generated by async jobs auto-expire 24 hours after completion.

Per-surface guides

1. Documents — download originals

Download any document you uploaded to Cognethics in its original format.

Endpoint: GET /api/documents/{document_id}/download/

curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.cognethics.com/api/documents/550e8400-e29b-41d4-a716-446655440000/download/"

Response: File stream (PDF, DOCX, XLSX, PNG, JPG, etc.).

Query parameters:

Notes:

2. FHIR bulk clinical export

Export FHIR-compliant clinical records (Patient, Observation, DiagnosticReport, etc.) for integration with other health systems.

Kickoff: POST /api/ehr/fhir/r4/$export (or GET with query params)

Status poll: GET /api/ehr/fhir/r4/$export-status/{job_id}

Download: GET /api/ehr/fhir/r4/$export-file/{job_id}/{filename}

curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/fhir+json" \
  "https://api.cognethics.com/api/ehr/fhir/r4/\$export" \
  -d '{
    "_type": "Patient,Observation,DiagnosticReport",
    "_since": "2026-01-01T00:00:00Z"
  }'

Response (kickoff): 202 Accepted with a Content-Location header pointing at the status endpoint.

Query parameters:

Format: NDJSON (newline-delimited JSON, one resource per line). JSON available on request.

Compliance:

3. GDPR compliance exports (RoPA, transfers, data inventory)

Export Article 30 Records of Processing Activities, transfer registers, and data inventories for compliance audits and cross-border transfer documentation.

Endpoint: POST /api/v1/data-mapping/exports/ (convenience endpoints: /api/v1/data-mapping/exports/ropa/ and /api/v1/data-mapping/exports/assets/).

curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Organization-ID: org-uuid-123" \
  -H "Content-Type: application/json" \
  "https://api.cognethics.com/api/v1/data-mapping/exports/" \
  -d '{
    "export_type": "ropa_pdf",
    "parameters": {
      "include_data_flows": true,
      "include_transfers": true,
      "include_ai_systems": true,
      "language": "en"
    }
  }'

Export types:

Status polling:

curl -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Organization-ID: org-uuid-123" \
  "https://api.cognethics.com/api/v1/data-mapping/exports/{export_id}/status/"

Returns JSON with status (pending / processing / completed / failed / expired) and progress (0–100%).

Download (once ready):

curl -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Organization-ID: org-uuid-123" \
  "https://api.cognethics.com/api/v1/data-mapping/exports/{export_id}/download/" \
  --output export.pdf

Caps:

4. Training datasets (JSONL export)

Export training datasets in JSONL (JSON Lines) format for machine learning pipelines, data science tools, or external annotation platforms.

Endpoint: POST /api/training_data/datasets/{dataset_id}/export/

curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.cognethics.com/api/training_data/datasets/dataset-uuid-123/export/" \
  -d '{"format": "jsonl"}'

Response: 202 Accepted with export_id.

{
  "export_id": "export-uuid-456",
  "status": "pending",
  "created_at": "2026-05-21T12:34:56Z"
}

JSONL output (each line):

{"id": "anno-1", "text": "...", "label": "label-name", "tags": [], "metadata": {}}
{"id": "anno-2", "text": "...", "label": "label-name", "tags": [], "metadata": {}}

Notes:

5. Audit logs (CSV export)

Export your organization's audit trail for compliance reviews, incident investigations, and regulatory audits.

Endpoint: GET /api/core/audit/export/?format=csv

curl -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Organization-Context: org-uuid-123" \
  "https://api.cognethics.com/api/core/audit/export/?format=csv&limit=5000&start_date=2026-05-01"

Response: CSV file (text/csv).

CSV headers:

Timestamp,Category,Action,Entity Type,Entity ID,User Email,User Name,IP Address,Request Method,Request Path,Response Status,Changes

Query parameters:

Caps:

6. MCP API loop — export any entity type

The MCP API exposes paginated read access to every entity type in the system. Loop through entity types with pagination to export custom data subsets.

Pattern: call prism_entity_crud(app="...", entity="...", operation="list", page=1, page_size=100, filters={...}) and paginate until you receive fewer than page_size records.

from anthropic import Anthropic

client = Anthropic()

entity_types = [
    ("healthcare", "claim"),
    ("finance", "invoice"),
    ("hr", "employee"),
    ("documents", "document"),
]

all_data = {}

for app, entity in entity_types:
    all_data[entity] = []
    page = 1

    while True:
        response = client.beta.messages.create(
            model="claude-opus-4-7",
            messages=[{
                "role": "user",
                "content": (
                    f"List {entity} records from {app}, page {page}, "
                    f"100 per page. Return raw JSON list."
                ),
            }],
            betas=["mcp-1.0"],
        )

        records = parse_response(response)
        all_data[entity].extend(records)

        if len(records) < 100:
            break
        page += 1

import json
with open("export.json", "w") as f:
    json.dump(all_data, f, indent=2)

Pagination rules:

Supported filters:

Response format: JSON array of entity objects.

7. Scheduled exports — run on a cron

Any of the compliance export surfaces above (RoPA, data inventory, transfer register, data-flow diagrams) can be run on a recurring schedule. Cognethics scans schedules every minute and enqueues a fresh export job whenever a schedule comes due. Each run produces a normal ExportTask with the standard 24-hour download window — plus optional notifications and remote-destination delivery.

Create a schedule:

curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Organization-ID: org-uuid-123" \
  -H "Content-Type: application/json" \
  "https://api.cognethics.com/api/v1/data-mapping/schedules/" \
  -d '{
    "name": "Daily RoPA snapshot",
    "description": "Article 30 record refreshed every morning at 06:00 UTC",
    "export_type": "ropa_pdf",
    "schedule_cron": "0 6 * * *",
    "parameters": {
      "include_data_flows": true,
      "include_transfers": true,
      "language": "en"
    },
    "notification_emails": ["[email protected]"]
  }'

Body parameters:

Cron examples (UTC):

CadenceCron
Daily 06:000 6 * * *
Weekly Monday 06:000 6 * * 1
Monthly on the 1st 06:000 6 1 * *
Every 15 minutes*/15 * * * *
Quarterly (every 3 months on the 1st 06:00)0 6 1 */3 *

Manage a schedule:

# List your org's schedules
GET    /api/v1/data-mapping/schedules/

# Inspect one
GET    /api/v1/data-mapping/schedules/{id}/

# Edit (cron, parameters, destination, notification list, etc.)
PATCH  /api/v1/data-mapping/schedules/{id}/

# Temporarily turn it off without deleting
POST   /api/v1/data-mapping/schedules/{id}/disable/

# Re-enable (recomputes next_run_at relative to now)
POST   /api/v1/data-mapping/schedules/{id}/enable/

# Force a run on the next scanner tick (≤ 60s away)
POST   /api/v1/data-mapping/schedules/{id}/run-now/

# Delete permanently
DELETE /api/v1/data-mapping/schedules/{id}/

Telemetry on each schedule:

Permissions:

Reads (list, retrieve) require any authenticated user with org context. Mutations (create, edit, enable/disable, delete) require the data_mapping.manage_export_schedules permission. Org administrators have this by default; grant it to other roles via the admin console.

Audit: every dispatch logs an AuditService.log_data_export entry tagged with the schedule UUID, so a scheduled run is indistinguishable from a manual export in your audit trail — just attributed to the schedule's creator.

8. Bring your own destination — S3 or SFTP

Any export (manual or scheduled) can be delivered straight to your own S3 bucket or SFTP server in addition to the Cognethics-hosted download link. Credentials are encrypted at rest with Fernet — only the running export worker can decrypt them — and we never echo secrets back through the API.

Create a destination:

curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Organization-ID: org-uuid-123" \
  -H "Content-Type: application/json" \
  "https://api.cognethics.com/api/v1/data-mapping/destinations/" \
  -d '{
    "name": "Audit S3 bucket",
    "kind": "s3",
    "config": {
      "bucket": "acme-cognethics-exports",
      "prefix": "exports/",
      "region": "us-east-1"
    },
    "credentials": {
      "access_key_id": "AKIA...",
      "secret_access_key": "..."
    }
  }'

S3 fields:

SFTP fields:

curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Organization-ID: org-uuid-123" \
  -H "Content-Type: application/json" \
  "https://api.cognethics.com/api/v1/data-mapping/destinations/" \
  -d '{
    "name": "Partner SFTP",
    "kind": "sftp",
    "config": {
      "host": "sftp.partner.example",
      "port": 22,
      "user": "cognethics",
      "path": "/inbox/exports"
    },
    "credentials": {
      "private_key": "-----BEGIN OPENSSH PRIVATE KEY-----\n...",
      "key_passphrase": "optional"
    }
  }'

Optional GPG signing — supply gpg_recipient_fingerprint and gpg_public_key (ASCII-armored) on the destination. Each export is GPG-encrypted to that recipient before upload, and lands at the destination with a .gpg suffix.

Use a destination on a one-shot export:

curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Organization-ID: org-uuid-123" \
  -H "Content-Type: application/json" \
  "https://api.cognethics.com/api/v1/data-mapping/exports/" \
  -d '{
    "export_type": "ropa_pdf",
    "destination": "destination-uuid-from-above"
  }'

The Celery worker writes the file to local storage as usual (so the standard 24-hour download URL still works), then uploads it to the destination. The export task gains remote_uri, delivered_at, and delivery_error fields.

Verify a destination works before using it:

POST /api/v1/data-mapping/destinations/{id}/test/

Writes a small probe file to the destination and deletes it afterwards. Returns {"ok": true, "remote_uri": "..."} on success; {"ok": false, "error": "..."} on failure.

Manage destinations:

GET    /api/v1/data-mapping/destinations/                # list
GET    /api/v1/data-mapping/destinations/{id}/           # detail (no secrets)
PATCH  /api/v1/data-mapping/destinations/{id}/           # update (omit credentials to keep existing)
DELETE /api/v1/data-mapping/destinations/{id}/           # remove

Permissions: reads require any authenticated user with org context. Mutations require the data_mapping.manage_export_destinations permission. Org administrators have it by default.

Security: credentials are encrypted at rest with a key derived from the Cognethics master secret via HKDF; the encrypted blob is the only field stored in the database. Decryption happens only inside the Celery export worker for the duration of an upload. The API never returns plaintext credentials — even to the user who created them.

Data portability for GDPR & privacy compliance

Your rights

How to submit a request

For data subject access requests (DSAR), right to erasure, or other privacy requests, submit the form below. In your message, include:

Submit a data-subject request

Pick a topic and we'll route your message to the right team.

Response SLA: 30 days (GDPR Article 12(3)).

What happens next

  1. We verify your identity and your right to request data for the specified organization.
  2. We compile all relevant data exports (documents, audit logs, structured records) into a secure archive.
  3. We encrypt and deliver via secure presigned link (48-hour expiry).
  4. You download and retain your copy.
  5. For erasure requests, we execute and confirm hard-deletion within 30 days of approval.

FAQs

How long do exported files stay available?
Files expire 24 hours after async-job completion (FHIR, RoPA, training datasets). Download them within that window or request a new export.

What if I need more than 10,000 audit log records?
Use date-range filters and make multiple requests. For very large audits, reach our support team through the contact form and we can arrange a custom export.

Can I automate exports on a schedule?
Yes. Create an ExportSchedule against /api/v1/data-mapping/schedules/ with a standard cron expression (UTC). The scanner runs every minute, so a daily, weekly, monthly, or sub-hourly cadence all work. See Scheduled exports above for the full API.

Are all exports encrypted?
All data in transit (HTTPS/TLS) is encrypted. Files at rest are encrypted on our storage. For DSAR responses, we use additional encryption for the download link.

Can I export data for a sub-organization or department?
Exports are scoped to your organization. Sub-org exports require a separate request with appropriate permissions.

What formats does Cognethics support?
CSV, JSON, JSONL, PDF, Excel, NDJSON (FHIR), and original document formats (DOCX, XLSX, images, etc.).

Support

For questions about data export, GDPR compliance, or HIPAA BAA portability, reach our support team through the contact form.

← Back to console