Skip to main content
TroopyDocs
Open Troopy
Troopy

API reference / Tests and incidents

Add an incident app

Adds an app that sends its errors to Troopy. Give its DSN to the app's Sentry SDK. Troopy keeps errors and crashes, and drops the rest that an SDK sends. Owners and admins.

post/api/v1/incident-apps

Authorization

HeaderAuthorization: Bearer <API key>
Or the headerX-API-Key: <API key>
API keyMake one in Troopy under Settings > API keys. It acts as you, in its workspace.

Other ways to call it

CLItroopy incidents add-app
MCP toolNone. Call it over REST or with the CLI.
Rate limit20 calls in 60 seconds, for each key
RetriesSend an Idempotency-Key header. A retry with the same key gets the first answer back, and the operation runs one time.

Body

application/json
name*string

At least 1 characters · At most 60 characters

platform*enum<string>

What it is built with: it picks the Sentry SDK of its setup

websitenextjsnodepythonother

originsarray<string>

Sites that may send its errors from a browser, like https://app.example.com. Empty: any site

At most 20 items

keepEmailsboolean

Keep the email of the person that an error names. On unless set

keepIpboolean

Keep the IP address of the person that an error names. Off unless set

Response

201 · application/json
data*object
18 properties
id*string

A 24-character id

name*string
slug*string

The name as an identifier, like web-app: unique in the workspace

platform*enum<string>

websitenextjsnodepythonother

projectId*integer

The number at the end of the DSN: a Sentry SDK needs a number

dsn*string | null

What the app's Sentry SDK takes, with its newest key. null when incidents are off on this server

keys*array<object>

Its keys, newest first. A rotation keeps the old key for a while

3 properties
key*string

The public key of the DSN: 32 hex. It is not a secret: it is in the app's code

createdAt*string

ISO 8601 date and time

retiresAt*string | null

When it stops working, after a new key came. null: it works

origins*array<string>

Sites that may send its errors from a browser, like https://app.example.com. Empty: any site

limits*object

Errors that it sends in a minute and in a day. Troopy drops the rest

2 properties
perMinute*integer
perDay*integer
keepEmails*boolean

Whether Troopy keeps the email of the person that an error names. Off: a code takes its place

keepIp*boolean

Whether Troopy keeps the IP address of the person that an error names

paused*boolean

A paused app's errors go nowhere: Troopy drops them

environments*array<string>

The environments that its errors named, like production

releases*array<object>

The releases that its errors named, newest first

2 properties
version*string
firstSeenAt*string

ISO 8601 date and time

lastEventAt*string | null

When its latest error came

createdBy*object

Who wrote it

3 properties
type*enum<string>

personagentapi

id*string
name*string
createdAt*string

ISO 8601 date and time

updatedAt*string

ISO 8601 date and time

Errors

400 invalid_inputFix the field named in detail. Each operation's schema is in /api/v1/openapi.json.
401 unauthorizedSend an API key as `Authorization: Bearer tr_live_...`. Create one in Troopy under Settings.
403 forbiddenThe key lacks a scope this operation needs, or its owner lacks the role. detail says which; create a key with the scope, or ask an organization owner or admin.
409 conflictThis Idempotency-Key was used for a different request, or that request is still running. Use a new key for a new request.
429 rate_limitedWait the number of seconds in Retry-After, then retry.