Skip to main content

GraphQL API

Pulsar provides a GraphQL API for accessing your monitoring data.

Endpoint

POST https://pulsar.byte8.io/graphql

Authentication

The API uses session-based authentication. See Authentication for details.

Schema Overview

Queries

type Query {
# Current user
me: User

# Sites
sites: [Site!]!
site(id: ID!): Site

# Site pages
sitePages(siteId: ID!): [SitePage!]!

# Checks
checks(siteId: ID!, limit: Int): [Check!]!
recentActivity(siteId: ID!, limit: Int): [Check!]!

# Alerts
alerts(siteId: ID, unresolvedOnly: Boolean, limit: Int): [Alert!]!

# Statistics
dashboardStats: DashboardStats!
siteStats(siteId: ID!): SiteStats!
uptimeData(siteId: ID!, days: Int): [UptimeDataPoint!]!
responseTimeData(siteId: ID!, days: Int): [ResponseTimeDataPoint!]!
quotaUsage: QuotaInfo!

# Notification settings
notificationSettings: NotificationSettings

# Error patterns (per site or page)
siteErrorPatterns(siteId: ID!): [ErrorPattern!]!
pageErrorPatterns(pageId: ID!): [ErrorPattern!]!
}

Mutations

type Mutation {
# Sites
createSite(input: CreateSiteInput!): Site!
updateSite(id: ID!, input: UpdateSiteInput!): Site!
deleteSite(id: ID!): Boolean!
muteSite(id: ID!): Site!
unmuteSite(id: ID!): Site!

# Checkout flow
updateCheckoutFlowConfig(id: ID!, input: CheckoutFlowInput!): Site!
disableCheckoutFlow(id: ID!): Site!

# Site pages
createSitePage(input: CreateSitePageInput!): SitePage!
updateSitePage(id: ID!, input: UpdateSitePageInput!): SitePage!
deleteSitePage(id: ID!): Boolean!

# Alerts
resolveAlert(id: ID!): Alert!
triggerCheck(siteId: ID!): Boolean!

# Notifications
updateNotificationSettings(input: NotificationSettingsInput!): NotificationSettings!
testNotification(channel: String!): Boolean!

# Error patterns
createSiteErrorPattern(input: CreateErrorPatternInput!): ErrorPattern!
updateSiteErrorPattern(id: ID!, input: UpdateErrorPatternInput!): ErrorPattern!
deleteSiteErrorPattern(id: ID!): Boolean!
createPageErrorPattern(input: CreateErrorPatternInput!): ErrorPattern!
updatePageErrorPattern(id: ID!, input: UpdateErrorPatternInput!): ErrorPattern!
deletePageErrorPattern(id: ID!): Boolean!
}

Types

Site

type Site {
id: ID!
name: String!
url: String!
status: SiteStatus!
muted: Boolean!
checkIntervalSeconds: Int!
browserChecks: Boolean!
checkoutFlowEnabled: Boolean!
basicAuthUsername: String
createdAt: DateTime!
updatedAt: DateTime!
}

enum SiteStatus {
UP
DOWN
DEGRADED
PAUSED
UNKNOWN
}

SitePage

type SitePage {
id: ID!
siteId: ID!
name: String!
path: String!
checkIntervalSeconds: Int!
browserCheck: Boolean!
enabled: Boolean!
status: SiteStatus!
createdAt: DateTime!
}

Check

type Check {
id: ID!
siteId: ID!
pageId: ID
checkType: CheckType!
status: CheckStatus!
responseTimeMs: Int
statusCode: Int
errorMessage: String
jsErrors: [JsError!]
createdAt: DateTime!
}

enum CheckType {
HTTP
BROWSER
CHECKOUT_FLOW
}

enum CheckStatus {
UP
DOWN
}

type JsError {
source: String!
message: String!
stackTrace: String
url: String
line: Int
column: Int
}

Alert

type Alert {
id: ID!
siteId: ID!
alertType: AlertType!
status: AlertStatus!
message: String!
createdAt: DateTime!
resolvedAt: DateTime
}

enum AlertType {
SITE_DOWN
PAGE_DOWN
JS_ERROR
CHECKOUT_FAILED
}

enum AlertStatus {
OPEN
RESOLVED
}

DashboardStats

type DashboardStats {
totalSites: Int!
sitesUp: Int!
sitesDown: Int!
sitesPaused: Int!
totalChecks24h: Int!
avgResponseTimeMs: Float
}

QuotaInfo

type QuotaInfo {
sitesUsed: Int!
sitesLimit: Int!
pagesUsed: Int!
pagesLimit: Int!
browserChecksUsed: Int!
browserChecksLimit: Int!
checkoutFlowsUsed: Int!
checkoutFlowsLimit: Int!
}

NotificationSettings

type NotificationSettings {
emailEnabled: Boolean!
emailAddresses: [String!]!
slackEnabled: Boolean!
slackWebhookUrl: String
discordEnabled: Boolean!
discordWebhookUrl: String
pagerdutyEnabled: Boolean!
pagerdutyIntegrationKey: String
webhookEnabled: Boolean!
webhookUrl: String
}

Example Queries

Get All Sites with Status

query {
sites {
id
name
url
status
muted
checkIntervalSeconds
}
}

Get Site with Pages

query GetSiteDetails($siteId: ID!) {
site(id: $siteId) {
id
name
url
status
}
sitePages(siteId: $siteId) {
id
name
path
status
}
}

Get Dashboard Stats

query {
dashboardStats {
totalSites
sitesUp
sitesDown
totalChecks24h
avgResponseTimeMs
}
quotaUsage {
sitesUsed
sitesLimit
browserChecksUsed
browserChecksLimit
}
}

Get Recent Checks

query {
checks(siteId: "uuid-here", limit: 10) {
id
status
responseTimeMs
errorMessage
createdAt
}
}

Example Mutations

Create a Site

mutation {
createSite(input: {
name: "My Store"
url: "https://mystore.com"
checkIntervalSeconds: 60
}) {
id
name
status
}
}

Update Notification Settings

mutation {
updateNotificationSettings(input: {
emailEnabled: true
emailAddresses: ["alerts@company.com"]
slackEnabled: true
slackWebhookUrl: "https://hooks.slack.com/..."
}) {
emailEnabled
slackEnabled
}
}

GraphQL Playground

Explore the API interactively when logged in:

https://pulsar.byte8.io/graphql

Use the GraphQL Playground in your browser's developer tools or a client like Altair.