Integrations API
API endpoints for PagerDuty, Linear, Sentry, channel routing, and integration configuration.
Integrations API
Connect CodeSpar to third-party services for incident management, issue tracking, error monitoring, and alert routing. All integration endpoints require a valid x-org-id header for multi-tenant scoping.
Integration Status
Check which integrations are configured and active for the current organization.
Request
Response
Configure Integration
Set or update credentials and settings for a specific integration.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
integration | string | Yes | Integration ID: pagerduty, linear, sentry, slack |
config | object | Yes | Integration-specific configuration |
Request
Response
PagerDuty
Get On-Call Schedule
Retrieve the current on-call user for a PagerDuty service.
Request
Response
List Incidents
Retrieve open PagerDuty incidents.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
status | string | triggered,acknowledged | Comma-separated statuses |
limit | number | 25 | Max results |
Request
Response
Acknowledge Incident
Acknowledge a PagerDuty incident from CodeSpar.
Request
Response
Linear
List Teams
Retrieve Linear teams visible to the integration.
Request
Response
List Issues
Retrieve Linear issues with optional filtering.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
team | string | — | Filter by team ID |
status | string | — | Filter by status (e.g., In Progress, Todo) |
assignee | string | — | Filter by assignee ID |
limit | number | 25 | Max results |
Request
Response
Create Issue
Create a new Linear issue. Used by agents to track work items.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
title | string | Yes | Issue title |
teamId | string | Yes | Target team ID |
description | string | No | Markdown description |
priority | number | No | Priority (0=none, 1=urgent, 2=high, 3=medium, 4=low) |
labels | string[] | No | Label names |
Request
Response
Sentry
Get Sentry Issues
Proxy endpoint that retrieves unresolved issues from Sentry.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
project | string | — | Sentry project slug |
query | string | is:unresolved | Sentry search query |
limit | number | 25 | Max results |
Request
Response
Sentry Webhook
Receive Sentry alerts and route them to the appropriate Incident Agent.
This endpoint is called by Sentry when alert rules fire. The payload follows Sentry's webhook format and is automatically parsed and routed.
Request
Response
Channel Routing
Manage alert routing rules that determine which channels receive specific event types.
List Routes
Request
Response
Create Route
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
eventType | string | Yes | Event pattern (supports * wildcard) |
channel | string | Yes | Channel type: slack, whatsapp, telegram, discord |
channelId | string | Yes | Channel/group identifier |
projectId | string | No | Scope to specific project |
Request
Response
Delete Route
Request
Response
Error Responses
All integration endpoints return consistent error shapes.
Integration not configured:
Upstream service error:
Route not found:
Next Steps
- Observability API -- Health metrics and real-time events
- Webhooks API -- Incoming webhook configuration
- A2A API -- Agent-to-agent task submission