Skip to main content

Report Exports (Async)

7 API calls in this section.

Catalogs - List for module

Reporting, Audit & Webhooks / Report / Report Exports (Async)
GET/report/catalogs/:module?tenant_id={{tenant_id}}&language=en

Returns all registered catalogs for a module: category, columns (with relationOptions), filterable statuses, scope definitions and supported formats. Each scope valueSource also includes itemsField, which tells the FE which top-level array key to read from the endpoint response (for example zones, drivers, deliveries, deliveryServices, users, warehouses, items). Warehouse exports now include receiving-orders, picking-orders, inventory-transactions, inventory-stock, warehouses, and a simple inventory-items catalog.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/report/catalogs/:module?tenant_id={{tenant_id}}&language=en" \2  --header "Authorization: Bearer {{access_token}}"

Path parameters

moduleRequired
path string

delivery

Module name (e.g. delivery, warehouse).

Query parameters

tenant_idOptional
query string

{{tenant_id}}

languageOptional
query string

en

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

200 OK200OK
Response body
json
1{2  "success": true,3  "module": "delivery",4  "catalogs": [5    {6      "key": "delivery-orders",7      "category": "operational",8      "label": "Delivery Orders",9      "description": "All delivery orders with customer, driver, zone and payment fields.",10      "supportedFormats": [11        "csv",12        "xlsx"13      ],14      "dateField": {15        "key": "created_at",16        "label": "Created at"17      },18      "statuses": [19        {20          "value": "pending",21          "label": "pending"22        },23        {24          "value": "delivered",25          "label": "delivered"26        }27      ],28      "scopes": [29        {30          "type": "zone",31          "label": "Zone",32          "multi": true,33          "valueSource": {34            "endpoint": "/delivery/zones",35            "itemsField": "zones",36            "valueField": "id",37            "labelField": "name",38            "searchParam": "search"39          }40        },41        {42          "type": "service",43          "label": "Service",44          "multi": true,45          "valueSource": {46            "endpoint": "/delivery/services",47            "itemsField": "deliveryServices",48            "valueField": "id",49            "labelField": "name",50            "searchParam": "search"51          }52        },53        {54          "type": "driver",55          "label": "Driver",56          "multi": true,57          "valueSource": {58            "endpoint": "/delivery/drivers",59            "itemsField": "drivers",60            "valueField": "id",61            "labelField": "user.full_name",62            "searchParam": "search"63          }64        },65        {66          "type": "customer",67          "label": "Customer",68          "multi": true,69          "valueSource": {70            "endpoint": "/users/customers",71            "itemsField": "users",72            "valueField": "id",73            "labelField": "full_name",74            "searchParam": "search"75          }76        }77      ],78      "columns": [79        {80          "key": "delivery_code",81          "label": "Delivery Code",82          "type": "string",83          "defaultSelected": true,84          "relationOptions": []85        },86        {87          "key": "driver",88          "label": "Driver",89          "type": "json",90          "defaultSelected": false,91          "relationOptions": []92        }93      ]94    },95    {96      "key": "receiving-orders",97      "category": "operational",98      "label": "Receiving Orders",99      "description": "Inbound receiving orders with supplier, warehouse, status and arrival dates.",100      "supportedFormats": [101        "csv",102        "xlsx"103      ],104      "dateField": {105        "key": "expected_arrival_date",106        "label": "Expected arrival date"107      },108      "statuses": [109        {110          "value": "pending",111          "label": "pending"112        },113        {114          "value": "received",115          "label": "received"116        }117      ],118      "scopes": [119        {120          "type": "warehouse",121          "label": "Warehouse",122          "multi": true,123          "valueSource": {124            "endpoint": "/warehousing/warehouses",125            "itemsField": "warehouses",126            "valueField": "id",127            "labelField": "name",128            "searchParam": "search"129          }130        }131      ],132      "columns": [133        {134          "key": "reference_number",135          "label": "Reference Number",136          "type": "string",137          "defaultSelected": true,138          "relationOptions": []139        },140        {141          "key": "warehouse_id",142          "label": "Warehouse",143          "type": "uuid",144          "defaultSelected": true,145          "relationOptions": [146            {147              "output": "id",148              "label": "Warehouse ID"149            },150            {151              "output": "reference_value",152              "label": "Warehouse name",153              "table": "warehouses",154              "referenceField": "name"155            }156          ]157        }158      ]159    },160    {161      "key": "inventory-items",162      "category": "master-data",163      "label": "Inventory Items",164      "description": "Inventory item master data. Kept intentionally simple for now with warehouse scope only.",165      "supportedFormats": [166        "csv",167        "xlsx"168      ],169      "dateField": {170        "key": "updated_at",171        "label": "Updated at"172      },173      "scopes": [174        {175          "type": "warehouse",176          "label": "Warehouse",177          "multi": true,178          "valueSource": {179            "endpoint": "/warehousing/warehouses",180            "itemsField": "warehouses",181            "valueField": "id",182            "labelField": "name",183            "searchParam": "search"184          }185        }186      ],187      "columns": [188        {189          "key": "name",190          "label": "Name",191          "type": "string",192          "defaultSelected": true,193          "relationOptions": []194        },195        {196          "key": "sku",197          "label": "SKU",198          "type": "string",199          "defaultSelected": true,200          "relationOptions": []201        },202        {203          "key": "categories",204          "label": "Categories",205          "type": "string",206          "defaultSelected": false,207          "relationOptions": []208        }209      ]210    }211  ]212}
404 Module has no catalogs404Not Found
Response body
json
1{2  "success": false,3  "message": "module_has_no_catalogs",4  "module": "unknown"5}

Exports - Preview

Reporting, Audit & Webhooks / Report / Report Exports (Async)
POST/report/exports/preview?tenant_id={{tenant_id}}&language=en

Returns the first preview page for the configured export without creating a job. Uses the same validation and relation-resolution rules as the real export pipeline. Requires view:reports.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/report/exports/preview?tenant_id={{tenant_id}}&language=en" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "module": "delivery",7  "catalog": "driver-assignments",8  "format": "csv",9  "dateRange": {10    "from": "2026-05-01",11    "to": "2026-05-07"12  },13  "statuses": [14    "pending",15    "accepted"16  ],17  "scope": {18    "type": "driver",19    "values": [20      "<driver-uuid>"21    ]22  },23  "columns": [24    "assignment_time",25    "driver_id",26    "delivery_id",27    "status"28  ],29  "relationFields": [30    {31      "field": "driver_id",32      "output": "reference_value",33      "table": "drivers",34      "referenceField": "user.full_name"35    },36    {37      "field": "delivery_id",38      "output": "reference_value",39      "table": "deliveries",40      "referenceField": "delivery_code"41    }42  ]43}'
Request body
json
1{2  "module": "delivery",3  "catalog": "driver-assignments",4  "format": "csv",5  "dateRange": {6    "from": "2026-05-01",7    "to": "2026-05-07"8  },9  "statuses": [10    "pending",11    "accepted"12  ],13  "scope": {14    "type": "driver",15    "values": [16      "<driver-uuid>"17    ]18  },19  "columns": [20    "assignment_time",21    "driver_id",22    "delivery_id",23    "status"24  ],25  "relationFields": [26    {27      "field": "driver_id",28      "output": "reference_value",29      "table": "drivers",30      "referenceField": "user.full_name"31    },32    {33      "field": "delivery_id",34      "output": "reference_value",35      "table": "deliveries",36      "referenceField": "delivery_code"37    }38  ]39}

Query parameters

tenant_idOptional
query string

{{tenant_id}}

languageOptional
query string

en

Request body fields

moduleExample
string

Example field from the request body.

catalogExample
string

Example field from the request body.

formatExample
string

Example field from the request body.

dateRangeExample
object

Example field from the request body.

dateRange.fromExample
string

Example field from the request body.

dateRange.toExample
string

Example field from the request body.

statusesExample
array<string>

Example field from the request body.

scopeExample
object

Example field from the request body.

scope.typeExample
string

Example field from the request body.

scope.valuesExample
array<string>

Example field from the request body.

columnsExample
array<string>

Example field from the request body.

relationFieldsExample
array<object>

Example field from the request body.

relationFields.fieldExample
string

Example field from the request body.

relationFields.outputExample
string

Example field from the request body.

relationFields.tableExample
string

Example field from the request body.

relationFields.referenceFieldExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

200 OK200OK
Response body
json
1{2  "success": true,3  "data": {4    "module": "delivery",5    "catalog": "driver-assignments",6    "category": "operational",7    "format": "csv",8    "previewLimit": 10,9    "totalRows": 24,10    "done": false,11    "columns": [12      {13        "key": "assignment_time",14        "label": "Assignment Time",15        "type": "datetime",16        "relationOutput": null17      },18      {19        "key": "driver_id",20        "label": "Driver",21        "type": "uuid",22        "relationOutput": "reference_value"23      },24      {25        "key": "delivery_id",26        "label": "Delivery",27        "type": "uuid",28        "relationOutput": "reference_value"29      },30      {31        "key": "status",32        "label": "Status",33        "type": "enum",34        "relationOutput": null35      }36    ],37    "rows": [38      {39        "assignment_time": "2026-05-07T10:30:00Z",40        "driver_id": "John Driver",41        "delivery_id": "DEL-1001",42        "status": "accepted"43      }44    ]45  }46}
400 Validation Error400Bad Request
Response body
json
1{2  "success": false,3  "message": "invalid_request",4  "errors": [5    {6      "field": "relationFields.driver_id",7      "message": "relation_target_not_whitelisted"8    }9  ]10}

Exports - Create

Reporting, Audit & Webhooks / Report / Report Exports (Async)
POST/report/exports?tenant_id={{tenant_id}}&language=en

Creates and queues an async export job. Returns immediately with id + status:"pending". Subscribe to realtime on report_export_jobs filtered by tenant_id to track progress. Requires export:reports. relationFields is an array of { field, output, table?, referenceField? }: - field: column key from columns (must be an ID column with relationOptions in the catalog). - output: "id" keeps the raw UUID; "reference_value" resolves to a label. - table + referenceField are required when output === "reference_value" and must match a whitelisted relationOption declared on the column. referenceField supports one nested level (e.g. user.full_name for drivers → users). Use GET /report/catalogs/:module to discover the allowed relationOptions per column.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/report/exports?tenant_id={{tenant_id}}&language=en" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "module": "delivery",7  "catalog": "delivery-orders",8  "format": "csv",9  "dateRange": {10    "from": "2026-05-01",11    "to": "2026-05-07"12  },13  "statuses": [14    "assigned",15    "in_transit"16  ],17  "scope": {18    "type": "zone",19    "values": [20      "<zone-uuid-1>",21      "<zone-uuid-2>"22    ]23  },24  "columns": [25    "delivery_code",26    "customer_id",27    "status",28    "driver_id"29  ],30  "relationFields": [31    {32      "field": "customer_id",33      "output": "reference_value",34      "table": "users",35      "referenceField": "full_name"36    },37    {38      "field": "driver_id",39      "output": "reference_value",40      "table": "drivers",41      "referenceField": "user.full_name"42    }43  ]44}'
Request body
json
1{2  "module": "delivery",3  "catalog": "delivery-orders",4  "format": "csv",5  "dateRange": {6    "from": "2026-05-01",7    "to": "2026-05-07"8  },9  "statuses": [10    "assigned",11    "in_transit"12  ],13  "scope": {14    "type": "zone",15    "values": [16      "<zone-uuid-1>",17      "<zone-uuid-2>"18    ]19  },20  "columns": [21    "delivery_code",22    "customer_id",23    "status",24    "driver_id"25  ],26  "relationFields": [27    {28      "field": "customer_id",29      "output": "reference_value",30      "table": "users",31      "referenceField": "full_name"32    },33    {34      "field": "driver_id",35      "output": "reference_value",36      "table": "drivers",37      "referenceField": "user.full_name"38    }39  ]40}

Query parameters

tenant_idOptional
query string

{{tenant_id}}

languageOptional
query string

en

Request body fields

moduleExample
string

Example field from the request body.

catalogExample
string

Example field from the request body.

formatExample
string

Example field from the request body.

dateRangeExample
object

Example field from the request body.

dateRange.fromExample
string

Example field from the request body.

dateRange.toExample
string

Example field from the request body.

statusesExample
array<string>

Example field from the request body.

scopeExample
object

Example field from the request body.

scope.typeExample
string

Example field from the request body.

scope.valuesExample
array<string>

Example field from the request body.

columnsExample
array<string>

Example field from the request body.

relationFieldsExample
array<object>

Example field from the request body.

relationFields.fieldExample
string

Example field from the request body.

relationFields.outputExample
string

Example field from the request body.

relationFields.tableExample
string

Example field from the request body.

relationFields.referenceFieldExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

202 Accepted202Accepted
Response body
json
1{2  "success": true,3  "data": {4    "id": "00000000-0000-0000-0000-000000000010",5    "module": "delivery",6    "catalog": "delivery-orders",7    "category": "operational",8    "format": "csv",9    "status": "pending",10    "fileName": null,11    "fileSizeBytes": null,12    "rowCount": null,13    "progress": {14      "total": null,15      "done": 016    },17    "downloadUrl": null,18    "requestedAt": "2025-01-15T12:00:00Z",19    "startedAt": null,20    "completedAt": null,21    "errorSummary": null,22    "metadata": null23  }24}
400 Validation Error400Bad Request
Response body
json
1{2  "success": false,3  "message": "invalid_request",4  "errors": [5    {6      "field": "format",7      "message": "format must be one of csv, xlsx"8    },9    {10      "field": "columns",11      "message": "unknown column: foo"12    }13  ]14}
403 Insufficient permissions403Forbidden
Response body
json
1{2  "success": false,3  "message": "insufficient_permissions"4}
404 Catalog not found404Not Found
Response body
json
1{2  "success": false,3  "message": "catalog_not_found",4  "module": "delivery",5  "catalog": "foo"6}

Exports - List

Reporting, Audit & Webhooks / Report / Report Exports (Async)
GET/report/exports?tenant_id={{tenant_id}}&language=en&module=delivery&status=ready&page=1&limit=20

Paginated history of export jobs for the tenant. Filters by module/catalog/status. Requires view:reports.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/report/exports?tenant_id={{tenant_id}}&language=en&module=delivery&status=ready&page=1&limit=20" \2  --header "Authorization: Bearer {{access_token}}"

Query parameters

tenant_idOptional
query string

{{tenant_id}}

languageOptional
query string

en

moduleOptional
query string

delivery

statusOptional
query string

ready

pageOptional
query string

1

limitOptional
query string

20

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

200 OK200OK
Response body
json
1{2  "success": true,3  "data": [4    {5      "id": "00000000-0000-0000-0000-000000000010",6      "module": "delivery",7      "catalog": "delivery-orders",8      "category": "operational",9      "format": "csv",10      "status": "ready",11      "fileName": "delivery-orders-2025-01-15.csv",12      "fileSizeBytes": 52431,13      "rowCount": 1240,14      "progress": {15        "total": 1240,16        "done": 124017      },18      "downloadUrl": null,19      "requestedAt": "2025-01-15T12:00:00Z",20      "startedAt": "2025-01-15T12:00:01Z",21      "completedAt": "2025-01-15T12:00:09Z",22      "errorSummary": null,23      "metadata": null24    }25  ],26  "page": 1,27  "limit": 20,28  "total": 129}

Exports - Get one

Reporting, Audit & Webhooks / Report / Report Exports (Async)
GET/report/exports/:id?tenant_id={{tenant_id}}&language=en

Single job. Use this for polling fallback when realtime is unavailable.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/report/exports/:id?tenant_id={{tenant_id}}&language=en" \2  --header "Authorization: Bearer {{access_token}}"

Path parameters

idRequired
path string

00000000-0000-0000-0000-000000000010

Query parameters

tenant_idOptional
query string

{{tenant_id}}

languageOptional
query string

en

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

200 OK200OK
Response body
json
1{2  "success": true,3  "data": {4    "id": "00000000-0000-0000-0000-000000000010",5    "module": "delivery",6    "catalog": "delivery-orders",7    "category": "operational",8    "format": "csv",9    "status": "processing",10    "fileName": null,11    "fileSizeBytes": null,12    "rowCount": null,13    "progress": {14      "total": 1240,15      "done": 50016    },17    "downloadUrl": null,18    "requestedAt": "2025-01-15T12:00:00Z",19    "startedAt": "2025-01-15T12:00:01Z",20    "completedAt": null,21    "errorSummary": null,22    "metadata": null23  }24}
404 Not Found404Not Found
Response body
json
1{2  "success": false,3  "message": "not_found"4}

Exports - Download (signed URL)

Reporting, Audit & Webhooks / Report / Report Exports (Async)
GET/report/exports/:id/download?tenant_id={{tenant_id}}&language=en

Returns a short-lived (5 min) signed URL for the generated file. Job must be in ready status.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/report/exports/:id/download?tenant_id={{tenant_id}}&language=en" \2  --header "Authorization: Bearer {{access_token}}"

Path parameters

idRequired
path string

00000000-0000-0000-0000-000000000010

Query parameters

tenant_idOptional
query string

{{tenant_id}}

languageOptional
query string

en

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

200 OK200OK
Response body
json
1{2  "success": true,3  "data": {4    "id": "00000000-0000-0000-0000-000000000010",5    "module": "delivery",6    "catalog": "delivery-orders",7    "category": "operational",8    "format": "csv",9    "status": "ready",10    "fileName": "delivery-orders-2025-01-15.csv",11    "fileSizeBytes": 52431,12    "rowCount": 1240,13    "progress": {14      "total": 1240,15      "done": 124016    },17    "downloadUrl": "https://<project>.supabase.co/storage/v1/object/sign/report-exports/exports/<tenant>/<job>/delivery-orders-2025-01-15.csv?token=...",18    "requestedAt": "2025-01-15T12:00:00Z",19    "startedAt": "2025-01-15T12:00:01Z",20    "completedAt": "2025-01-15T12:00:09Z",21    "errorSummary": null,22    "metadata": null23  }24}
409 Not Ready409Conflict
Response body
json
1{2  "success": false,3  "message": "not_ready",4  "status": "processing"5}

Exports - Cancel

Reporting, Audit & Webhooks / Report / Report Exports (Async)
POST/report/exports/:id/cancel?tenant_id={{tenant_id}}&language=en

Cancels a pending or processing job. Requires export:reports. Returns 409 if the job is already in a terminal state.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/report/exports/:id/cancel?tenant_id={{tenant_id}}&language=en" \2  --header "Authorization: Bearer {{access_token}}"

Path parameters

idRequired
path string

00000000-0000-0000-0000-000000000010

Query parameters

tenant_idOptional
query string

{{tenant_id}}

languageOptional
query string

en

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

200 OK200OK
Response body
json
1{2  "success": true,3  "data": {4    "id": "00000000-0000-0000-0000-000000000010",5    "status": "cancelled",6    "completedAt": "2025-01-15T12:00:30Z"7  }8}
409 Not Cancellable409Conflict
Response body
json
1{2  "success": false,3  "message": "not_cancellable_or_not_found"4}