Uptime

Request

This endpoint retrieves the uptime in milliseconds for a specific identifier within a given time range (up to 14 days). It supports querying using the following identifiers: secret and partner_node_id.

Endpoint:

GET /api/v1/uptime

URL:

https://stats.api.datagram.network/api/v1/uptime

Query Parameters

Parameter
Type
Required
Description
Example

secret

string

✅ Yes

Unique secret token identifying partner.

"pt_sec_abc123XYZ*"

partner_node_id

string

✅ Yes

Unique identifier of the external partner node.

"partner_98765zyxw"

started_at

integer

❌ No

Start time in Unix timestamp (milliseconds).

1678901234567

ended_at

integer

❌ No

End time in Unix timestamp (milliseconds).

1678912345678

- If started_at or ended_at are not provided, the API will return the total uptime of the specified partner_node_id. - The maximum allowed time range between started_at and ended_at is 14 days (1209600000 ms). - All timestamps will be rounded down to the nearest hour.

Example: 1752727252516 (2025-07-17T04:40:52.516Z) will be rounded down to 1752724800000 (2025-07-17T04:00:00Z).

Authentication

Use a valid organization token in the request header.

Authorization: Bearer <organization-token>

Example Request

GET /api/v1/uptime?partner_node_id=dg-node-12&started_at=1741251728393&ended_at=1741252994872 HTTP/1.1
Host: stats.api.datagram.network
Authorization: <organization token>

Responses

When the request is valid and successful, the API returns the uptime duration in milliseconds.

Response Body

Field
Type
Description
Example

uptime

integer

Total uptime in Unix timestamp (ms).

866222

partner_node_id

string

Identifier of the external partner node.

"partner_98765zyxw"

Example Response

{
  "data": {
    "uptime": 866222
    "partner_node_id": "partner_98765zyxw"
  }
}

Last updated