Download the PHP package openstatus/sdk-php without Composer
On this page you can find all versions of the php package openstatus/sdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download openstatus/sdk-php
More information about openstatus/sdk-php
Files in openstatus/sdk-php
Package sdk-php
Short Description Official PHP SDK for Openstatus
License MIT
Homepage https://github.com/openstatusHQ/sdk-php
Informations about the package sdk-php
Openstatus PHP SDK
Official PHP SDK for Openstatus — the open-source status page with uptime monitoring.
Table of Contents
- Features
- Installation
- Quick Start
- Authentication
- SDK Reference
- Monitor Service
- Health Service
- Status Report Service
- Status Page Service
- Maintenance Service
- Notification Service
- Reference
- Monitor Options
- Assertions
- Regions
- Enums
- Working with int64 fields
- Error Handling
- Framework integration
- Related
Features
Monitoring
- HTTP Monitoring — monitor websites and APIs with customizable assertions.
- TCP Monitoring — check database connections and other TCP services.
- DNS Monitoring — verify DNS records and resolution.
- Global Regions — monitor from 28 locations worldwide.
Status Page
- Status Pages — create and manage public status pages with custom domains.
- Page Components — add monitor-based or static components with grouping.
- Subscribers — manage email subscriptions for status updates.
- Status Reports — manage incident reports with update timelines.
- Maintenance Windows — schedule and manage planned maintenance periods.
Notifications
- 12 providers — Slack, Discord, Email, PagerDuty, Opsgenie, Telegram, and more.
- Webhook Support — custom webhooks with headers for any integration.
- Monitor Alerts — get notified when monitors go down or recover.
Developer Experience
- Type-safe — strongly-typed request/response messages generated from
Openstatus protobuf schemas (
buf.build/openstatus/api). - PSR-18 transport — bring your own HTTP client, or use the bundled Guzzle implementation.
- No proto toolchain needed — pre-generated PHP classes ship with the
package;
composer requireis all you need.
Installation
Requires PHP 8.4 or later.
Quick Start
Authentication
All API requests require an API key. Get yours from the Openstatus dashboard.
Recommended: configure the client once
Alternative: per-call headers
Every service method accepts an optional second argument: an array of headers merged into the request. Useful for tracing IDs or one-off overrides.
Environment Variables
| Variable | Description | Default |
|---|---|---|
OPENSTATUS_API_KEY |
Your Openstatus API key | Required for authenticated calls |
OPENSTATUS_API_URL |
Custom API endpoint | https://api.openstatus.dev |
If apiKey is not passed in ClientOptions, the SDK falls back to
OPENSTATUS_API_KEY. Same for baseUrl / OPENSTATUS_API_URL.
SDK Reference
All examples below assume:
Monitor Service
Manage HTTP, TCP, and DNS monitors.
createHTTPMonitor(request)
Create an HTTP/HTTPS monitor.
updateHTTPMonitor(request)
Update an existing HTTP monitor.
createTCPMonitor(request) / updateTCPMonitor(request)
Monitor TCP services.
createDNSMonitor(request) / updateDNSMonitor(request)
Monitor DNS records.
getMonitor(request)
Fetch a single monitor (returns a MonitorConfig discriminated by type).
listMonitors(request)
List all monitors in the workspace, grouped by type.
triggerMonitor(request)
Manually run a monitor immediately. Rate-limited by the synthetic-checks quota.
deleteMonitor(request)
getMonitorStatus(request)
Per-region status snapshot.
getMonitorSummary(request)
Aggregated latency percentiles and request counts.
listMonitorHTTPResponseLogs(request)
Recent HTTP response log entries with pagination.
getMonitorHTTPResponseLog(request)
Single log entry with full headers and body assertions.
Health Service
check(request)
Returns the API's serving status. No authentication required — useful as a liveness check.
Status Report Service
Manage incident reports with a lifecycle:
investigating → identified → monitoring → resolved.
createStatusReport(request)
getStatusReport(request) / listStatusReports(request) / updateStatusReport(request) / deleteStatusReport(request)
addStatusReportUpdate(request)
Status Page Service
Manage public status pages with components, component groups, and subscribers.
createStatusPage(request)
getStatusPage(request) / listStatusPages(request) / updateStatusPage(request) / deleteStatusPage(request)
getStatusPageContent(request) / getOverallStatus(request)
Components
Add a monitor-backed component or a static component, update it, remove it.
Component groups
Subscribers
Maintenance Service
Schedule planned maintenance windows. Subscribers can be notified automatically.
Notification Service
Configure notification channels and check usage limits.
Other methods:
Reference
Monitor Options
| Field | Type | Notes |
|---|---|---|
name |
string |
Required, max 256 chars. |
url |
string |
Required, max 2048 chars. |
periodicity |
Periodicity (enum int) |
Required. See Enums. |
method |
HTTPMethod (enum int) |
HTTP monitors only. Defaults to HTTP_METHOD_GET. |
regions |
Region[] (enum int list) |
Required. See Regions. |
active |
bool |
Defaults to false. |
timeout |
int (ms) |
0–120000. Defaults to 45000. |
degraded_at |
int (ms) |
Optional latency threshold for "degraded" status. |
retry |
int |
0–10. Defaults to 3. |
follow_redirects |
bool |
Defaults to true. |
body |
string |
Request body (HTTP). |
headers |
Headers[] |
Custom request headers (HTTP). |
status_code_assertions |
StatusCodeAssertion[] |
See Assertions. |
body_assertions |
BodyAssertion[] |
See Assertions. |
header_assertions |
HeaderAssertion[] |
See Assertions. |
description |
string |
Optional description. |
public |
bool |
Whether the monitor is publicly visible. |
Assertions
Assertions are evaluated against each check response. All matching assertions must pass for a check to be successful.
Regions
28 regions are available via the Region enum:
Enums
All enums emitted by the protobuf compiler are plain classes with const int
values. The generated value getters return int; use the static name()
helper to convert to a string.
Notable enums you'll encounter:
Openstatus\Monitor\V1\HTTPMethodOpenstatus\Monitor\V1\PeriodicityOpenstatus\Monitor\V1\RegionOpenstatus\Monitor\V1\MonitorStatusOpenstatus\Monitor\V1\NumberComparatorOpenstatus\Monitor\V1\StringComparatorOpenstatus\Monitor\V1\TimeRangeOpenstatus\Monitor\V1\HTTPResponseLogRequestStatusOpenstatus\Monitor\V1\HTTPResponseLogTriggerOpenstatus\Health\V1\CheckResponse\ServingStatusOpenstatus\Status_report\V1\StatusReportStatusOpenstatus\Status_page\V1\OverallStatusOpenstatus\Status_page\V1\PageAccessTypeOpenstatus\Status_page\V1\PageThemeOpenstatus\Status_page\V1\PageComponentTypeOpenstatus\Notification\V1\NotificationProviderOpenstatus\Notification\V1\OpsgenieRegion
Working with int64 fields
int64 fields (timestamps, percentiles, latencies measured in nanoseconds)
return int|string from getters because protoc-gen-php falls back to strings
on 32-bit platforms to avoid silent overflow.
On 64-bit PHP — the default on macOS and Linux — the value is always an int.
If you need to be safe across both platforms:
The setter accepts either, so passing an int directly works.
Error Handling
All Connect RPC errors raise Openstatus\Sdk\Exception\OpenstatusException
(or a subclass). The exception carries the Connect error code, HTTP status,
parsed details array, and raw response body.
| Connect code | Exception |
|---|---|
unauthenticated |
Openstatus\Sdk\Exception\AuthenticationException |
not_found |
Openstatus\Sdk\Exception\NotFoundException |
invalid_argument |
Openstatus\Sdk\Exception\InvalidArgumentException |
permission_denied |
Openstatus\Sdk\Exception\PermissionDeniedException |
resource_exhausted |
Openstatus\Sdk\Exception\RateLimitException |
unavailable |
Openstatus\Sdk\Exception\ServiceUnavailableException |
| anything else | Openstatus\Sdk\Exception\OpenstatusException |
Framework integration
Symfony
Register the client as a service in config/services.yaml:
Inject into any controller or service:
Laravel
In a service provider's register() method:
Resolve from the container:
Custom PSR-18 client
Bring your own HTTP client (Symfony HttpClient, Saloon, Mock, etc.). Anything
implementing Psr\Http\Client\ClientInterface works.
Pair with a custom PSR-3 logger to log every request/response at DEBUG:
Related
- Openstatus — open-source status pages and uptime monitoring.
- Openstatus API docs
- Openstatus Node SDK
- Openstatus Proto schema
License
MIT — see LICENSE.
All versions of sdk-php with dependencies
ext-json Version *
google/protobuf Version ^4.29
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^2.0
psr/log Version ^3.0
guzzlehttp/guzzle Version ^7.8