Optimaite

Data Export

4 min readUpdated May 27, 2026Auch auf Deutsch verfuegbar

The Export API lets you create reusable export configurations, execute them on demand, and retrieve data in JSON, CSV, or Excel format. Exports can be accessed externally via time-limited tokens, making it easy to feed Optimaite data into BI tools, CRM systems, or accounting software.

Endpoints

MethodPathDescription
GET/api/v1/exports/configsList all export configurations
POST/api/v1/exports/configsCreate an export configuration
GET/api/v1/exports/configs/{id}Get an export configuration
PUT/api/v1/exports/configs/{id}Update an export configuration
DELETE/api/v1/exports/configs/{id}Delete an export configuration
GET/api/v1/exports/configs/{id}/executeExecute an export (returns data)
GET/api/v1/exports/configs/{id}/previewPreview export data (limited rows)
POST/api/v1/exports/configs/{id}/generate-tokenGenerate external access token
GET/api/v1/exports/configs/{id}/retrieveRetrieve export via token (public)

Required scope: reports:read for listing and executing exports, reports:write for creating configurations.

The Export Configuration Object

{
  "id": "exp_01ABCDEFG",
  "name": "Monthly Revenue Report",
  "description": "Revenue grouped by case for the current month",
  "source": "invoices",
  "format": "xlsx",
  "filters": {
    "date_from": "2026-05-01",
    "date_to": "2026-05-31",
    "status": "paid"
  },
  "columns": [
    { "field": "invoice_number", "label": "Invoice #" },
    { "field": "case_name", "label": "Case" },
    { "field": "party_name", "label": "Client" },
    { "field": "total_gross", "label": "Amount (EUR)" },
    { "field": "paid_at", "label": "Paid Date" }
  ],
  "schedule": null,
  "last_executed_at": "2026-05-20T08:00:00Z",
  "created_at": "2026-01-15T10:00:00Z"
}

Create an Export Configuration

POST /api/v1/exports/configs
{
  "name": "Monthly Revenue Report",
  "source": "invoices",
  "format": "xlsx",
  "filters": {
    "date_from": "2026-05-01",
    "date_to": "2026-05-31"
  },
  "columns": [
    { "field": "invoice_number", "label": "Invoice #" },
    { "field": "case_name", "label": "Case" },
    { "field": "total_gross", "label": "Amount (EUR)" }
  ]
}

Execute an Export

GET /api/v1/exports/configs/{config_id}/execute

Returns the export data in the configured format. The response Content-Type depends on the format:

FormatContent-TypeExtension
jsonapplication/json.json
csvtext/csv.csv
xlsxapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet.xlsx

Example: JSON Response

{
  "meta": {
    "config_id": "exp_01ABCDEFG",
    "executed_at": "2026-05-27T09:00:00Z",
    "row_count": 42
  },
  "data": [
    {
      "invoice_number": "RE-2026-042",
      "case_name": "Smith v. Jones",
      "total_gross": 2677.50
    }
  ]
}

Preview an Export

GET /api/v1/exports/configs/{config_id}/preview

Returns a limited preview (first 10 rows) of the export data. Useful for validating configuration before running a full export.

External Access (Token-Authenticated)

Generate a time-limited token to allow external systems to retrieve exports without an API key:

POST /api/v1/exports/configs/{config_id}/generate-token
{
  "expires_in_hours": 24
}

Response

{
  "token": "exp_tok_abc123def456",
  "expires_at": "2026-05-28T09:00:00Z"
}

External systems can then retrieve the export:

GET /api/v1/exports/configs/{config_id}/retrieve?token=exp_tok_abc123def456

Use token-authenticated exports to feed data into BI dashboards (Metabase, Tableau), accounting software (DATEV, SevDesk), or CRM systems (Salesforce, HubSpot) via scheduled HTTP requests.

Available Export Sources

SourceDescriptionKey Filters
invoicesInvoice datadate, status, case, party
time_entriesTime tracking datadate, user, case, billable
casesCase metadatastatus, type, dezernat, date
partiesContact datatype, date
documentsDocument metadatadate, case, folder
deadlinesDeadline datadate, status, case

Error Responses

StatusCodeMeaning
400INVALID_SOURCEExport source not supported
400INVALID_FILTERFilter value is not valid for the source
403AUTH_INSUFFICIENT_SCOPEMissing reports:read scope
404CONFIG_NOT_FOUNDExport configuration does not exist
410TOKEN_EXPIREDExternal access token has expired

Next Steps

Was this helpful?