REST API reference
Base URL: https://api.denpex.com. All requests require a Bearer token in the Authorization header. See the agent docs for how to create a key, or generate one in your dashboard.
Authentication
Tokens are JWTs issued by the auth worker. They expire 30 days after issue. Rotation is supported by creating a new key and deleting the old one.
Endpoints
/api/diagnoseBearer tokenDiagnose a training log. Returns root cause, classification, originating rank (if distributed), and the exact fix.
{ logs: string, jobName?: string }{ success: true, diagnosisTimeMs: number, fix: { summary, action, resumeFrom? }, meta: { failureType, confidence, source, ... } }/api/diagnose/historyBearer tokenRecent diagnoses for the authenticated user. Default limit 50.
{ history: Diagnosis[] }/api/diagnose/quotaBearer tokenRemaining diagnoses for today. Free plan only; paid plans return unlimited.
{ quota: { remaining, limit, used } }/api/diagnosis/feedbackBearer tokenThumbs-up / thumbs-down feedback on a diagnosis. Confirmed fixes are added to the team knowledge base.
{ id: string, helpful: boolean, comment?: string }/api/ingest/heartbeatBearer tokenAgent heartbeat. Reports job status every 30s.
{ jobName, hostname, status, ts }/api/ingest/crashBearer tokenAgent crash report. Ships the last 500 log lines on non-zero exit. Mass-crash safe: reports sharing a cluster + failure signature within 5 minutes coalesce into ONE diagnosis — followers return the shared fix with coalesced: true and consume no quota. See Rate limits for details.
{ runId?, jobName, logs, exitCode, meta? }{ success: true, diagnosisId, coalesced?, crashCount?, fix: { summary, action, fallbackAction?, emergencyAction?, resumeFrom? }, meta: { failureType, confidence } }/api/keysBearer tokenList API keys for the authenticated user.
{ keys: ApiKey[] }/api/keysBearer tokenCreate a new API key. The full key is returned only once.
{ label?: string }/api/jobsBearer tokenList jobs the agent has reported heartbeats for.
{ jobs: Job[] }/api/alerts/channelsBearer tokenList alert channels for the authenticated user.
{ channels: AlertChannel[] }/api/alerts/channelsBearer tokenAdd a new alert channel.
{ channelType: 'slack' | 'webhook' | 'sms' | 'pagerduty' | 'email', config: object, enabled?: boolean }/api/alerts/channelsBearer tokenRemove an alert channel.
{ id: number }/api/billing/checkoutBearer tokenStart a Stripe Checkout Session for a paid plan.
{ plan: 'team' | 'scale' }{ url: string }/api/billing/subscriptionBearer tokenCurrent subscription, including plan, status, and period end.
{ plan, subscription: { id, plan, status, currentPeriodEnd, cancelAtPeriodEnd }, trial: { ... } | null }/api/billing/portalBearer tokenOpen the Stripe customer portal for self-service plan changes and invoice downloads.
{ url: string }/api/billing/webhookStripe signatureStripe webhook. Handles checkout.session.completed and customer.subscription.* events.
/api/redeemBearer tokenRedeem a trial code. Each account may redeem one code.
{ code: string }