Alert API Reference
Complete API reference for the Alert resource in the beeps SDK.
Alert Methods
Section titled “Alert Methods”client.alert.list()
Section titled “client.alert.list()”List all alerts in your organization.
Returns: Promise<Alert[]>
Example:
const alerts = await client.alert.list();client.alert.listActive()
Section titled “client.alert.listActive()”List all active (unresolved) alerts.
Returns: Promise<Alert[]>
Example:
const activeAlerts = await client.alert.listActive();client.alert.listResolved()
Section titled “client.alert.listResolved()”List all resolved alerts.
Returns: Promise<Alert[]>
Example:
const resolvedAlerts = await client.alert.listResolved();client.alert.get(alertId)
Section titled “client.alert.get(alertId)”Get a specific alert by ID.
Parameters:
alertId: string
Returns: Promise<Alert>
Example:
const alert = await client.alert.get("alr_abc123");client.alert.onIt(alertId, input?)
Section titled “client.alert.onIt(alertId, input?)”Signal that a user is responding to an alert. Creates a responder record. If userId is not provided, the authenticated user is used.
Parameters:
alertId: stringinput?: OnItInput
Returns: Promise<AlertResponder>
Example:
const responder = await client.alert.onIt("alr_abc123", { userId: "usr_alice",});
// Or as the authenticated userconst responder = await client.alert.onIt("alr_abc123");client.alert.listResponders(alertId)
Section titled “client.alert.listResponders(alertId)”List all responders for an alert.
Parameters:
alertId: string
Returns: Promise<AlertResponder[]>
Example:
const responders = await client.alert.listResponders("alr_abc123");client.alert.listAgents(alertId)
Section titled “client.alert.listAgents(alertId)”List agent jobs associated with an alert.
Parameters:
alertId: string
Returns: Promise<AgentJob[]>
Example:
const jobs = await client.alert.listAgents("alr_abc123");client.alert.getFixContext(alertId)
Section titled “client.alert.getFixContext(alertId)”Get a foreground fix context bundle for an alert, including responders, agent jobs, and suggested next actions.
Parameters:
alertId: string
Returns: Promise<AlertFixContext>
Example:
const fixContext = await client.alert.getFixContext("alr_abc123");console.log(fixContext.nextActions);client.alert.updateResponderStatus(alertId, responderId, input)
Section titled “client.alert.updateResponderStatus(alertId, responderId, input)”Update a responder’s status to done or dropped. Optionally attach a PR URL.
Parameters:
alertId: stringresponderId: stringinput: UpdateResponderStatusInput
Returns: Promise<AlertResponder>
Example:
const updated = await client.alert.updateResponderStatus( "alr_abc123", "rsp_def456", { status: "done", prUrl: "https://github.com/org/repo/pull/42" },);client.alert.resolve(alertId)
Section titled “client.alert.resolve(alertId)”Mark an alert as resolved.
Parameters:
alertId: string
Returns: Promise<Alert>
Example:
const alert = await client.alert.resolve("alr_abc123");client.alert.assign(alertId, userId)
Section titled “client.alert.assign(alertId, userId)”Assign an alert to a user.
Parameters:
alertId: stringuserId: string
Returns: Promise<Alert>
Example:
const alert = await client.alert.assign("alr_abc123", "usr_bob");Safe Methods
Section titled “Safe Methods”All methods have corresponding *Safe variants that return Result<T> instead of throwing:
client.alert.listSafe()client.alert.listActiveSafe()client.alert.listResolvedSafe()client.alert.getSafe(alertId)client.alert.onItSafe(alertId, input?)client.alert.listRespondersSafe(alertId)client.alert.listAgentsSafe(alertId)client.alert.getFixContextSafe(alertId)client.alert.updateResponderStatusSafe(alertId, responderId, input)client.alert.resolveSafe(alertId)client.alert.assignSafe(alertId, userId)
Example:
const result = await client.alert.onItSafe("alr_abc123", { userId: "usr_alice",});
if (result.error) { console.error(result.error.message);} else { console.log(`Responder joined: ${result.data.id}`);}AlertSeverity
Section titled “AlertSeverity”type AlertSeverity = "critical" | "high" | "medium" | "low" | "info";type Alert = { id: string; organizationId: string; webhookId: string; title: string; message: string | null; severity: AlertSeverity; source: string; externalId: string | null; metadata: Record<string, unknown> | null; assignedToUserId: string | null; resolvedAt: string | null; resolvedBy: ResolutionSource | null; resolvedByUserId: string | null; resolvedByProvider: string | null; createdAt: string; updatedAt: string;};ResolutionSource
Section titled “ResolutionSource”type ResolutionSource = "user" | "monitoring_system";AlertResponder
Section titled “AlertResponder”type AlertResponder = { id: string; alertId: string; organizationId: string; responderType: ResponderType; userId: string | null; integrationId: string | null; agentSessionId: string | null; status: ResponderStatus; prUrl: string | null; joinedAt: string; completedAt: string | null;};ResponderType
Section titled “ResponderType”type ResponderType = "user" | "agent";ResponderStatus
Section titled “ResponderStatus”type ResponderStatus = "on_it" | "done" | "dropped";OnItInput
Section titled “OnItInput”type OnItInput = { userId?: string;};UpdateResponderStatusInput
Section titled “UpdateResponderStatusInput”type UpdateResponderStatusInput = { status: "done" | "dropped"; prUrl?: string;};HTTP Endpoints
Section titled “HTTP Endpoints”List All Alerts
Section titled “List All Alerts”GET /v0/alertsList Active Alerts
Section titled “List Active Alerts”GET /v0/alerts/activeList Resolved Alerts
Section titled “List Resolved Alerts”GET /v0/alerts/resolvedGet Alert
Section titled “Get Alert”GET /v0/alerts/:alertIdRespond to Alert (On It)
Section titled “Respond to Alert (On It)”POST /v0/alerts/:alertId/on-itRequest Body:
{ "userId": "usr_alice"}List Responders
Section titled “List Responders”GET /v0/alerts/:alertId/respondersList Agent Jobs for Alert
Section titled “List Agent Jobs for Alert”GET /v0/alerts/:alertId/agentsGet Fix Context
Section titled “Get Fix Context”GET /v0/alerts/:alertId/fix-contextUpdate Responder Status
Section titled “Update Responder Status”PATCH /v0/alerts/:alertId/responders/:responderIdRequest Body:
{ "status": "done", "prUrl": "https://github.com/org/repo/pull/42"}Resolve Alert
Section titled “Resolve Alert”POST /v0/alerts/:alertId/resolveAssign Alert
Section titled “Assign Alert”POST /v0/alerts/:alertId/assignRequest Body:
{ "userId": "usr_bob"}Authentication
Section titled “Authentication”All API requests require authentication using your API key:
curl -H "Authorization: Bearer YOUR_API_KEY" \ https://api.beeps.dev/v0/alerts