API Reference

Access your UptyBots monitoring data programmatically using the REST API.

Authentication

Create an API key in your Account → API Keys page. Then pass it with every request using one of two methods:

Option 1 — X-API-Key header

curl -H "X-API-Key: upty_YOUR_KEY_HERE" \
     https://uptybots.com/api/targets

Option 2 — Authorization Bearer header

curl -H "Authorization: Bearer upty_YOUR_KEY_HERE" \
     https://uptybots.com/api/targets

Both methods are equivalent. Use whichever your HTTP client or framework expects. API keys do not expire unless you set an expiration date. You can create up to 10 keys per account.

Base URL

https://uptybots.com/api

All endpoints below are relative to this base URL.

Response Format

By default the API returns JSON-LD (with @context, @id, @type fields). To get plain JSON, add the Accept header:

curl -H "X-API-Key: upty_YOUR_KEY" \
     -H "Accept: application/json" \
     https://uptybots.com/api/targets

Pagination

Collection endpoints return paginated results. Use the page query parameter:

GET /api/targets?page=2

The response includes totalItems and pagination links (first, last, next).

Content-Type for write operations

For POST requests, use Content-Type: application/json.
For PATCH requests, use Content-Type: application/merge-patch+json.

Endpoints — Monitors

GET /api/targets

List all your monitors. Paginated (10 per page).

Filters: type, search, isActive, statusSummary

GET /api/targets/{id}

Get a single monitor with full details (type-specific info, stats, SSL, domain).

POST /api/targets/type_ping

Create a Ping monitor.

POST /api/targets/type_port

Create a Port monitor.

POST /api/targets/type_ssl

Create an SSL certificate monitor.

POST /api/targets/type_domain

Create a Domain expiration monitor.

PATCH /api/targets/{id}

Update a monitor's settings.

PATCH /api/targets/{id}/is_active

Pause or resume a monitor.

DELETE /api/targets/{id}

Delete a monitor permanently.

Example — List all monitors

curl -H "X-API-Key: upty_YOUR_KEY" \
     -H "Accept: application/json" \
     https://uptybots.com/api/targets

Example — Filter by type

curl -H "X-API-Key: upty_YOUR_KEY" \
     "https://uptybots.com/api/targets?type=HTTP"

Example — Pause a monitor

curl -X PATCH \
     -H "X-API-Key: upty_YOUR_KEY" \
     -H "Content-Type: application/merge-patch+json" \
     -d '{"isActive": false}' \
     https://uptybots.com/api/targets/123/is_active

Endpoints — Stats & Incidents

GET /api/target_stats_hourlies

Hourly uptime and response time stats. Paginated (1000 per page).

Filters: target.id, date[before], date[after]

GET /api/target_stats_dailies

Daily uptime and response time stats. Paginated (1000 per page).

Filters: target.id, date[before], date[after]

GET /api/target_incidents

List of downtime incidents for your monitors.

Filters: target.id

Example — Get hourly stats for a monitor

curl -H "X-API-Key: upty_YOUR_KEY" \
     "https://uptybots.com/api/target_stats_hourlies?target.id=123&date[after]=2025-01-01"

Endpoints — Notifications

GET /api/user_notifications

List your notifications. Paginated.

Filters: channel, status, type

GET /api/user_notifications/{id}

Get a single notification.

GET /api/user_notifications/unread_count_web

Get unread notification count.

PATCH /api/user_notifications/{id}

Update a notification (e.g. mark as read).

DELETE /api/user_notifications/{id}

Delete a notification.

Endpoints — Account

GET /api/users/{id}

Get your user profile.

GET /api/users/{id}/target-stats

Get a summary of all your monitors' uptime statistics.

Endpoints — API Keys

GET /api/user/api-keys

List your API keys (prefix only, not the full key).

POST /api/user/api-keys

Create a new API key. The full key is returned only once in the response.

PATCH /api/user/api-keys/{id}

Rename an API key.

DELETE /api/user/api-keys/{id}

Revoke and delete an API key.

Example — Create a new key

curl -X POST \
     -H "X-API-Key: upty_YOUR_EXISTING_KEY" \
     -H "Content-Type: application/json" \
     -d '{"name": "My Mobile App"}' \
     https://uptybots.com/api/user/api-keys

Response

{
  "id": 5,
  "name": "My Mobile App",
  "keyPrefix": "upty_a1b2c3d",
  "createdAt": "2025-04-02T18:00:00+00:00",
  "key": "upty_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4"
}

Important: The key field is only returned when creating. Save it immediately — you will not be able to see it again.

Error Handling

Status Code Meaning
200 Success
201 Created successfully
401 Unauthorized — missing or invalid API key
403 Forbidden — you don't have access to this resource
404 Not found — the resource doesn't exist or doesn't belong to you
422 Validation error — check the violations array in the response

Example error response

{
  "type": "https://tools.ietf.org/html/rfc2616#section-10",
  "title": "An error occurred",
  "status": 422,
  "violations": [
    {
      "propertyPath": "name",
      "message": "This value should not be blank."
    }
  ]
}

Need Help?

If you have questions about the API, use our AI Support Assistant in the bottom-right corner or contact us.