Skip to content

Reports API Reference

This guide provides detailed information about the Reports API endpoints.

Authentication

All report endpoints require authentication using a Project API Token. Include your token in the Authorization header:

bash
Authorization: Bearer YOUR_PROJECT_API_TOKEN

For more information about authentication, see the Authentication Guide.

List Reports

Retrieve a list of all reports for your project.

http
GET /api/v1/reports
Authorization: Bearer YOUR_PROJECT_API_TOKEN

Example with curl:

bash
curl -X GET "https://app.uptinio.com/api/v1/reports?page=1&per_page=25&status=complete" \
  -H "Authorization: Bearer YOUR_PROJECT_API_TOKEN" \
  -H "Content-Type: application/json"

Query Parameters

ParameterTypeDescriptionDefault
pageintegerPage number1
per_pageintegerItems per page (max: 100)25
statusstringFilter by status (pending, complete)all

Note: Reports are ordered by creation date in descending order (most recent first).

Response

json
{
  "data": [
    {
      "uuid": "RPT123",
      "name": "Monthly Uptime Report - January 2024",
      "status": "complete",
      "start_date": "2024-01-01T00:00:00Z",
      "end_date": "2024-01-31T23:59:59Z",
      "resource_uuids": ["NM123", "NM456", "SRV789"],
      "incident_uuids": ["INC123", "INC456"],
      "overall_uptime": 99.95,
      "overall_downtime": 0.05,
      "downtime_events": 2,
      "average_response_time": 125.5,
      "peak_response_time": 350.2,
      "performance_data": {
        "NM123": {
          "success_rate": 99.98,
          "response_time_avg": 120.5
        },
        "NM456": {
          "success_rate": 99.92,
          "response_time_avg": 130.5
        }
      },
      "created_at": "2024-02-01T00:00:00Z",
      "updated_at": "2024-02-01T01:30:00Z"
    }
  ],
  "meta": {
    "current_page": 1,
    "per_page": 25,
    "total_pages": 2,
    "total_count": 45
  }
}

Response Fields

FieldTypeDescription
dataarrayArray of report objects
data[].uuidstringReport UUID
data[].namestringReport name
data[].statusstringReport status (pending, complete)
data[].start_datestringISO 8601 timestamp of the report start date
data[].end_datestringISO 8601 timestamp of the report end date
data[].resource_uuidsarrayArray of UUIDs of monitored resources (NetworkMonitors and Servers)
data[].incident_uuidsarrayArray of UUIDs of incidents that occurred during the report period
data[].overall_uptimefloat|nullOverall uptime percentage across all resources
data[].overall_downtimefloat|nullOverall downtime percentage across all resources
data[].downtime_eventsinteger|nullTotal number of downtime events
data[].average_response_timefloat|nullAverage response time in milliseconds
data[].peak_response_timefloat|nullPeak response time in milliseconds
data[].performance_dataobjectPerformance data per resource (keyed by resource UUID)
data[].created_atstringISO 8601 timestamp of creation
data[].updated_atstringISO 8601 timestamp of last update
metaobjectPagination metadata
meta.current_pageintegerCurrent page number
meta.per_pageintegerNumber of items per page
meta.total_pagesintegerTotal number of pages
meta.total_countintegerTotal number of items

Get Report

Retrieve details of a specific report.

http
GET /api/v1/reports/:uuid
Authorization: Bearer YOUR_PROJECT_API_TOKEN

Example with curl:

bash
curl -X GET https://app.uptinio.com/api/v1/reports/RPT123 \
  -H "Authorization: Bearer YOUR_PROJECT_API_TOKEN" \
  -H "Content-Type: application/json"

Response

json
{
  "uuid": "RPT123",
  "name": "Monthly Uptime Report - January 2024",
  "status": "complete",
  "start_date": "2024-01-01T00:00:00Z",
  "end_date": "2024-01-31T23:59:59Z",
  "resource_uuids": ["NM123", "NM456", "SRV789"],
  "incident_uuids": ["INC123", "INC456"],
  "overall_uptime": 99.95,
  "overall_downtime": 0.05,
  "downtime_events": 2,
  "average_response_time": 125.5,
  "peak_response_time": 350.2,
  "performance_data": {
    "NM123": {
      "success_rate": 99.98,
      "response_time_avg": 120.5
    },
    "NM456": {
      "success_rate": 99.92,
      "response_time_avg": 130.5
    }
  },
  "created_at": "2024-02-01T00:00:00Z",
  "updated_at": "2024-02-01T01:30:00Z"
}

Create Report

Create a new report. The report will be generated in the background and its status will be pending until generation is complete.

http
POST /api/v1/reports
Authorization: Bearer YOUR_PROJECT_API_TOKEN
Content-Type: application/json

Example with curl:

bash
curl -X POST https://app.uptinio.com/api/v1/reports \
  -H "Authorization: Bearer YOUR_PROJECT_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "report": {
      "name": "Q1 2024 Report",
      "start_date": "2024-01-01T00:00:00Z",
      "end_date": "2024-03-31T23:59:59Z",
      "resource_uuids": ["NM123", "NM456", "SRV789"]
    }
  }'

Request Body

ParameterTypeDescriptionRequired
reportobjectReport objectYes
report.namestringReport nameYes
report.start_datestringISO 8601 timestamp of the report start dateYes
report.end_datestringISO 8601 timestamp of the report end dateYes
report.resource_uuidsarrayArray of UUIDs of resources to include in the report (NetworkMonitors and Servers)Yes

Note:

  • start_date must be before end_date
  • resource_uuids must contain at least one UUID
  • Dates should be in ISO 8601 format (e.g., 2024-01-01T00:00:00Z or 2024-01-01T00:00:00+00:00)

Response

json
{
  "uuid": "RPT456",
  "name": "Q1 2024 Report",
  "status": "pending",
  "start_date": "2024-01-01T00:00:00Z",
  "end_date": "2024-03-31T23:59:59Z",
  "resource_uuids": ["NM123", "NM456", "SRV789"],
  "incident_uuids": [],
  "overall_uptime": null,
  "overall_downtime": null,
  "downtime_events": null,
  "average_response_time": null,
  "peak_response_time": null,
  "performance_data": {},
  "created_at": "2024-04-01T00:00:00Z",
  "updated_at": "2024-04-01T00:00:00Z"
}

Status Code: 201 Created

Error Response

If the request is invalid, you'll receive a 422 Unprocessable Entity response:

json
{
  "error": "Failed to create report",
  "errors": [
    "Name can't be blank",
    "Start date must be before end date"
  ]
}

Update Report

Update an existing report. Only pending reports should be updated, as complete reports contain generated data.

http
PATCH /api/v1/reports/:uuid
Authorization: Bearer YOUR_PROJECT_API_TOKEN
Content-Type: application/json

Example with curl:

bash
curl -X PATCH https://app.uptinio.com/api/v1/reports/RPT123 \
  -H "Authorization: Bearer YOUR_PROJECT_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "report": {
      "name": "Updated Report Name",
      "resource_uuids": ["NM123", "NM456"]
    }
  }'

Request Body

ParameterTypeDescriptionRequired
reportobjectReport objectYes
report.namestringReport nameNo
report.start_datestringISO 8601 timestamp of the report start dateNo
report.end_datestringISO 8601 timestamp of the report end dateNo
report.resource_uuidsarrayArray of UUIDs of resources to include in the reportNo

Note: All fields are optional. Only include the fields you want to update.

Response

json
{
  "uuid": "RPT123",
  "name": "Updated Report Name",
  "status": "pending",
  "start_date": "2024-01-01T00:00:00Z",
  "end_date": "2024-01-31T23:59:59Z",
  "resource_uuids": ["NM123", "NM456"],
  "incident_uuids": [],
  "overall_uptime": null,
  "overall_downtime": null,
  "downtime_events": null,
  "average_response_time": null,
  "peak_response_time": null,
  "performance_data": {},
  "created_at": "2024-02-01T00:00:00Z",
  "updated_at": "2024-02-01T02:00:00Z"
}

Error Response

If the request is invalid, you'll receive a 422 Unprocessable Entity response:

json
{
  "error": "Failed to update report",
  "errors": [
    "Start date must be before end date"
  ]
}

Delete Report

Delete a report.

http
DELETE /api/v1/reports/:uuid
Authorization: Bearer YOUR_PROJECT_API_TOKEN

Example with curl:

bash
curl -X DELETE https://app.uptinio.com/api/v1/reports/RPT123 \
  -H "Authorization: Bearer YOUR_PROJECT_API_TOKEN" \
  -H "Content-Type: application/json"

Response

json
{
  "message": "Report deleted successfully"
}

Status Code: 200 OK

Report Status

Reports have two possible statuses:

  • pending: The report is being generated. Metrics and performance data are not yet available.
  • complete: The report has been generated and all metrics are available.

When a report is created, it starts with status pending. A background job processes the report and updates it to complete when finished. Once complete, the report includes:

  • Overall uptime and downtime percentages
  • Average and peak response times
  • Downtime events count
  • Performance data per resource
  • Incident UUIDs that occurred during the report period

Error Codes

CodeDescription
report_not_foundThe specified report does not exist
invalid_requestThe request parameters are invalid
unauthorizedInvalid or missing authentication token

Next Steps