Skip to content

API Reference ​

Complete reference for all GrydReports REST API endpoints.

Reports ​

List Available Reports ​

Returns all registered report templates with their metadata, supported formats, and parameters.

http
GET /api/v1/reports

Response 200 OK:

json
[
  {
    "templateId": "monthly-sales",
    "displayName": "Monthly Sales Report",
    "description": "Summarizes sales by period",
    "supportedFormats": [1, 2, 3],
    "parameters": [
      {
        "name": "month",
        "displayName": "Month",
        "valueType": "int",
        "required": true,
        "defaultValue": null,
        "allowedValues": null,
        "description": null
      }
    ],
    "isGlobal": false,
    "version": 1
  }
]

Get Execution History ​

Paginated list of report executions with filters.

http
GET /api/v1/reports/history?templateId=monthly-sales&status=3&format=1&fromDate=2026-01-01&toDate=2026-02-28&pageNumber=1&pageSize=20
ParameterTypeRequiredDefaultDescription
templateIdstringNo—Filter by template ID
statusintNo—Filter by ReportStatus enum value
formatintNo—Filter by ReportFormat enum value
fromDateDateTimeNo—Start of date range
toDateDateTimeNo—End of date range
pageNumberintNo1Page number
pageSizeintNo20Page size

Response 200 OK:

json
{
  "items": [
    {
      "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
      "templateId": "monthly-sales",
      "reportName": "Sales Report - January 2026",
      "format": 1,
      "status": 3,
      "fileSizeBytes": 245760,
      "createdAt": "2026-01-15T10:00:00Z",
      "completedAt": "2026-01-15T10:00:02Z"
    }
  ],
  "totalCount": 42,
  "pageNumber": 1,
  "pageSize": 20,
  "totalPages": 3,
  "hasNext": true,
  "hasPrevious": false
}

Get Execution by ID ​

Detailed information about a specific report execution.

http
GET /api/v1/reports/{id}

Response 200 OK:

json
{
  "id": "f47ac10b-...",
  "templateId": "monthly-sales",
  "reportName": "Sales Report - January 2026",
  "format": 1,
  "status": 3,
  "parametersJson": "{\"month\":1,\"year\":2026}",
  "storedFileId": "0b8e2f51-7c3d-4e6a-9f10-2a4b6c8d0e12",
  "fileName": "monthly-sales-2026-01.pdf",
  "contentType": "application/pdf",
  "fileSizeBytes": 245760,
  "generationDuration": "00:00:02.341",
  "errorMessage": null,
  "startedAt": "2026-01-15T10:00:00Z",
  "completedAt": "2026-01-15T10:00:02Z",
  "requestedBy": "a1b2c3d4-...",
  "scheduleId": null,
  "downloadCount": 3,
  "expiresAt": "2026-04-15T10:00:00Z",
  "createdAt": "2026-01-15T10:00:00Z"
}

Error 404 Not Found — report ID does not exist.


Generate Report (Sync) ​

Generates a report synchronously and returns the result with download info.

http
POST /api/v1/reports/generate
Content-Type: application/json

Request Body:

json
{
  "templateId": "monthly-sales",
  "format": 1,
  "parameters": {
    "month": 1,
    "year": 2026
  },
  "requestedBy": "user@company.com"
}
FieldTypeRequiredDescription
templateIdstringYesTemplate identifier
formatintYesReportFormat enum (1=PDF, 2=Excel, 3=CSV, 4=HTML)
parametersobject?NoReport parameters
requestedBystring?NoRequester identifier

Response 201 Created:

json
{
  "id": "f47ac10b-...",
  "templateId": "monthly-sales",
  "reportName": "Sales Report",
  "format": 1,
  "status": 3,
  "fileName": "monthly-sales-2026-01.pdf",
  "fileSizeBytes": 245760,
  "storedFileId": "0b8e2f51-7c3d-4e6a-9f10-2a4b6c8d0e12",
  "generationDuration": "00:00:02.341",
  "createdAt": "2026-02-19T10:30:00Z"
}

Generate Report (Async) ​

Queues a report for background generation with optional delivery.

http
POST /api/v1/reports/generate-async
Content-Type: application/json

Request Body:

json
{
  "templateId": "annual-financial",
  "format": 2,
  "parameters": { "year": 2025 },
  "delivery": {
    "method": 2,
    "recipients": ["cfo@company.com"],
    "emailSubject": "Annual Report 2025"
  },
  "requestedBy": "admin@company.com"
}
FieldTypeRequiredDescription
templateIdstringYesTemplate identifier
formatintYesReportFormat enum
parametersobject?NoReport parameters
deliveryDeliveryOptions?NoDelivery configuration
requestedBystring?NoRequester identifier

Response 202 Accepted — includes tracking ID for status polling.


Download Report ​

Issues a short-lived presigned URL to the generated report. Breaking change: this route used to stream the file; it now returns the URL and the caller fetches the file from storage.

http
GET /api/v1/reports/{id}/download

Response 200 OK:

json
{
  "url": "https://storage.example.com/…?X-Amz-Signature=…",
  "expiresAt": "2026-09-10T18:05:00Z"
}

A GET on url returns the file as application/octet-stream with Content-Disposition: attachment; filename*=UTF-8''…. The URL expires in minutes; request a new one instead of storing it.

Errors: 404 REPORT_NOT_FOUND; 409 REPORT_NOT_AVAILABLE (not completed); 409 FILE_NOT_AVAILABLE_CONFLICT (the file is still being verified — retry shortly); 409 FILE_PURGED_CONFLICT (retention already collected it).


Delete Report ​

Soft-deletes a report execution and releases its stored file; GrydFiles purges the file after the retention grace period.

http
DELETE /api/v1/reports/{id}

Response 204 No Content

Error 404 Not Found — report not found.


Schedules ​

List Schedules ​

Paginated list of report schedules with filters.

http
GET /api/v1/reports/schedules?templateId=daily-sales&isActive=true&pageNumber=1&pageSize=20
ParameterTypeRequiredDefault
templateIdstringNo—
isActiveboolNo—
pageNumberintNo1
pageSizeintNo20

Get Schedule Details ​

http
GET /api/v1/reports/schedules/{id}

Create Schedule ​

http
POST /api/v1/reports/schedules
Content-Type: application/json

Request Body:

json
{
  "templateId": "daily-sales",
  "name": "Daily Sales Report",
  "cronExpression": "0 8 * * *",
  "format": 1,
  "parameters": { "region": "south" },
  "delivery": {
    "method": 2,
    "recipients": ["team@company.com"]
  },
  "description": "Daily report at 8 AM"
}

Response 201 Created


Update Schedule ​

http
PUT /api/v1/reports/schedules/{id}
Content-Type: application/json

Request Body (all fields optional):

json
{
  "name": "Updated Name",
  "cronExpression": "0 9 * * *",
  "format": 2,
  "parametersJson": "{\"region\":\"north\"}",
  "deliveryOptionsJson": "{\"method\":2,\"recipients\":[\"new@company.com\"]}",
  "description": "Updated description"
}

Response 204 No Content


Delete Schedule ​

http
DELETE /api/v1/reports/schedules/{id}

Response 204 No Content


Trigger Schedule ​

Execute a schedule immediately (out-of-cycle).

http
POST /api/v1/reports/schedules/{id}/trigger

Response 202 Accepted


Pause Schedule ​

http
POST /api/v1/reports/schedules/{id}/pause

Response 204 No Content


Resume Schedule ​

http
POST /api/v1/reports/schedules/{id}/resume

Response 204 No Content


Enums Reference ​

ReportFormat ​

ValueNameContent-Type
1Pdfapplication/pdf
2Excelapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet
3Csvtext/csv
4Htmltext/html

ReportStatus ​

ValueNameDescription
1QueuedWaiting for processing
2GeneratingCurrently being generated
3CompletedGeneration successful
4FailedGeneration failed
5DeliveredDelivered to recipients
6CancelledCancelled by user

DeliveryMethod ​

ValueNameDescription
1DownloadAvailable for download
2EmailSent as email attachment
3StorageCopied to target path
4WebhookPOST to webhook URL

Error Responses ​

All error responses follow RFC 7807 Problem Details format. The HTTP status code is determined by the ErrorCode suffix:

ErrorCode SuffixHTTP Status
_NOT_FOUND404
_ALREADY_EXISTS409
_CONFLICT409
_FORBIDDEN403
_UNAUTHORIZED401
_UNPROCESSABLE422
(default)400

Released under the MIT License.