Scrubbe Logo

Build on Scrubbe

Official clients for the Scrubbe Operational Intelligence Platform — across five runtimes and the command line. Create incidents, stream live events, run governed playbooks, and query the knowledge base against api.scrubbe.com.

Read Documentation
A network globe representing Scrubbe's connected operational intelligence platform

The four stages of Scrubbe adoption

1

Connect

Authenticate, read incidents, and open your first one. No writes to production systems.

▸incident.create
▸incident.list
▸service.health
2

Instrument

Ingest signals, enrich timelines, and stream live events into your own tooling.

▸event.ingest
▸timeline.add
▸incident.subscribe
3

Automate

Run governed playbooks behind named-operator approval. Gates surface as typed errors.

▸playbook.run
▸approval.approve
▸workbench.complete
4

Operate

Close the loop at scale: audit, postmortems, and knowledge queries across the corpus.

▸postmortem.publish
▸mcp.query
▸audit.export
An engineer reviewing operational dashboards while adopting Scrubbe

Choose the SDK that matches
your stack

SDK & CLI reference
~/incident-botscrubbe-sdk · v1.0.0
$pip install scrubbe-sdk
✓ Successfully installed scrubbe-sdk-1.0.0
SDK Language
Requires Python ≥ 3.10 · httpx
PyPIscrubbe-sdk
On this page
01

Installation

Install from PyPI. No build step required.

bash
sh
1pip install scrubbe-sdk
02

Quick start

An async client built on httpx. Paginate lazily and subscribe to live event streams.

main.py
py
1import asyncio
2from scrubbe import Scrubbe
3​
4async def main():
5 async with Scrubbe(api_key="sk-...") as client:
6 # Create an incident
7 incident = await client.incident.create(
8 title="Payment gateway degraded",
9 priority="P1",
10 service="payment-api",
11 )
12 print(incident["incident_id"]) # SI-000042
13​
14 # List open incidents (lazy pagination)
15 async for inc in client.incident.list(state="INVESTIGATING"):
16 print(inc["incident_id"], inc["title"])
17​
18 # Subscribe to live events
19 async for event in client.incident.subscribe(incident["incident_id"]):
20 print(event["type"], event["data"])
21​
22asyncio.run(main())
03

Authentication

Resolution paths: explicit key, OAuth2 client credentials, or environment configs.

auth.py
py
1# 1. Explicit API key
2client = Scrubbe(api_key="sk-...")
3​
4# 2. OAuth2 client credentials (auto-refresh)
5client = Scrubbe(client_id="...", client_secret="...")
6​
7# 3. Environment variables (recommended for CI)
8client = Scrubbe()
9​
10# 4. Named profile in ~/.scrubbe/credentials
11client = Scrubbe(profile="production")
04

Configuration

Tune connection timeouts and jitter retry distributions.

client.py
py
1from scrubbe import Scrubbe
2from scrubbe.utils.retry import RetryOptions
3​
4client = Scrubbe(
5 api_key="sk-...",
6 base_url="https://api.scrubbe.com", # default
7 connect_timeout_ms=5_000,
8 read_timeout_ms=30_000,
9 retry=RetryOptions(
10 max_attempts=3,
11 base_delay_ms=500,
12 max_delay_ms=30_000,
13 respect_retry_after=True, # honour 429 headers
14 ),
15)
05

Error handling

Governance gates raise GovernanceApprovalRequiredError — never a silent null.

errors.py
py
1from scrubbe import (
2 GovernanceApprovalRequiredError,
3 RateLimitedError,
4 UnauthenticatedError,
5 ScrubbeAPIError,
6)
7​
8try:
9 await client.playbook.run("PB-0001", incident_id="SI-000042")
10except GovernanceApprovalRequiredError as e:
11 print(f"Approval required: {e.approval_id}")
12 print(f"Approve at: {e.approval_url}")
13except RateLimitedError as e:
14 print(f"Rate limited. Retry after {e.retry_after}s")
06

Incident operations

The full core lifecycle: create, annotate timeline logs, and resolve.

incident.py
py
1async with Scrubbe(api_key="sk-...") as client:
2 inc = await client.incident.create(
3 title="DB replica lag spike",
4 priority="P2",
5 service="orders-db",
6 )
7 await client.timeline.add(
8 incident_id=inc["incident_id"],
9 message="Replica lag reached 42s at 14:03 UTC",
10 source="monitoring",
11 )
12 await client.incident.resolve(
13 incident_id=inc["incident_id"],
14 resolution="Replica re-synced after network blip.",
15 )
07

MCP queries

Ask the knowledge base in natural language; responses cite source incidents.

mcp.py
py
1async with Scrubbe(api_key="sk-...") as client:
2 answer = await client.mcp.query(
3 q="What caused the payment outages in Q2?",
4 )
5 print(answer["answer"])
08

Development

Set up local developer orchestration packages safely.

bash
sh
1pip install -e ".[dev]"
2ruff check src/ tests/ # lint
3mypy src/scrubbe # type-check
4pytest --cov=scrubbe tests/ # tests
— Webhooks

Scrubbe pushes real-time event payloads to any HTTPS endpoint you register . Signatures are verified securely with HMAC-SHA256 filters using your generated webhook secret .

Payload signature verification sample
webhook_verify.py
python
1import hashlib, hmac
2​
3def verify_signature(payload: bytes, sig: str, secret: str) -> bool:
4 expected = hmac.new(secret.encode(), payload, hashlib.sha256).hexdigest()
5 return hmac.compare_digest(f"sha256={expected}", sig)
Event catalogue matrix
Event NameDescription ContextPayload Schema
incident.createdA new incident was opened.IncidentCreatedPayload
incident.updatedPriority, state, or service assignment changed.IncidentUpdatedPayload
incident.resolvedIncident marked resolved with an optional summary.IncidentResolvedPayload
playbook.executedA playbook run completed (executed, parked, blocked).PlaybookExecutedPayload
playbook.approval_requiredExecution gated pending human approval.ApprovalRequiredPayload
approval.grantedA pending approval was approved by an operator.ApprovalGrantedPayload
handover.createdA new shift handover was generated.HandoverCreatedPayload
postmortem.publishedA post-mortem was finalised and published.PostmortemPublishedPayload
agent.investigation_completedAn AI investigation finished.InvestigationPayload

SDK Comparison.
Capability matrix across clients

Capability
Lazy cursor pagination
Event streaming (SSE)
OAuth2 client credentials
Credential configuration profiles
Retry logic with full jitter
Automatic idempotency keys
Governance approval error types
MCP knowledge query modules
Native Dependency injection
Edge serverless runtime support
Python
✓
✓
✓
✓
✓
✓
✓
✓
—
—
TS / JS
✓
✓
✓
✓
✓
✓
✓
✓
—
✓
Java
Planned
Planned
✓
—
✓
Planned
✓
Planned
—
—
C#
✓
✓
✓
✓
✓
✓
✓
✓
✓
—
Go
✓
✓
✓
✓
✓
✓
✓
✓
—
—

Cookie preferences

We use essential cookies to keep Scrubbe secure and functional. You can choose whether to allow analytics, preferences, and marketing cookies, and update your choices at any time.

Essential cookies

Required for security, session continuity, consent state, and core site functionality. These are always on.

Always active

Analytics cookies

Help us understand usage patterns so we can improve product pages, onboarding paths, and documentation quality.

Allow analytics

Preference cookies

Remember selected settings such as region, UI preferences, and previously chosen site options.

Remember preferences

Marketing cookies

Enable campaign measurement and more relevant follow-up communications across trusted channels.

Allow marketing

Your choices are stored locally in this browser and can be updated at any time from the cookie settings button.