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
templateIdstringNoFilter by template ID
statusintNoFilter by ReportStatus enum value
formatintNoFilter by ReportFormat enum value
fromDateDateTimeNoStart of date range
toDateDateTimeNoEnd 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}",
  "fileUri": "reports/2026/01/monthly-sales-abc123.pdf",
  "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,
  "downloadUrl": "/api/v1/reports/f47ac10b-.../download",
  "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

Downloads the generated report file.

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

Response 200 OK — Returns FileStreamResult with:

  • Content-Type: application/pdf, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, text/csv, or text/html
  • Content-Disposition: attachment; filename="report.pdf"

Error 404 Not Found — report not found or file not available.


Delete Report

Soft-deletes a report execution and its associated file.

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.