Skip to main content
TroopyDocs
Open Troopy
Troopy

API reference / Tests and incidents

Change a place to test

Changes its name, address, test accounts, what the QA tester may press there, or its schedule: send only what changes. accounts replaces the whole list. A new address, or a change of what it allows, makes the QA tester test each test there again before Troopy replays it. Owners and admins.

patch/api/v1/test-environments/{id}

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 tests update-environment
MCP toolNone. Call it over REST or with the CLI.
Rate limit30 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.

Path parameters

id*string

A 24-character id

Body

application/json
namestring

At least 1 characters · At most 60 characters

urlstring

Where the product starts, like https://staging.example.com. Only https

At least 1 characters · At most 300 characters

accountsarray<object>

At most 5 items

2 properties
label*string

What tests call the account, like admin or customer

At least 1 characters · At most 40 characters

item*string

A login in the vault

allowActionsboolean
scheduleobject | null

When the QA tester checks it by itself, or null for no schedule

7 properties
every*enum<string>

hour: each hour at the minute. day: each day at the hour and minute. week: each week on the weekday, at the hour and minute

hourdayweek

hourinteger

A daily or weekly check's hour

Default 8 · At least 0 · At most 23

minuteinteger

Default 0 · At least 0 · At most 59

weekdayinteger

A weekly check's day: 0 is Sunday

Default 1 · At least 0 · At most 6

timezonestring

The IANA time zone of the hour, like Europe/Berlin. Left out: the workspace's, or UTC

At most 64 characters

testsenum<string>

main: the tests on the main path. all: every active test. On production, only the tests that are safe there

mainall

Default "main"

pausedboolean

A paused schedule starts no check

Default false

Response

200 · application/json
data*object
13 properties
id*string

A 24-character id

name*string
kind*enum<string>

production: the live product. staging: a copy of it to test on

productionstaging

url*string

Where the product starts, on https

accounts*array<object>

The test accounts that the QA tester signs in with. Their passwords stay in the vault

2 properties
label*string

What tests call the account, like admin or customer

item*object

The login in the vault

2 properties
id*string

A 24-character id

name*string | null

null when the login is gone from the vault

allowActions*boolean

Whether the QA tester may press buttons that change data there: staging only. It never pays

schedule*object | null

When the QA tester checks the place by itself. null: only when someone asks

7 properties
every*enum<string>

hour: each hour at the minute. day: each day at the hour and minute. week: each week on the weekday, at the hour and minute

hourdayweek

hour*integer

A daily or weekly check's hour

Default 8 · At least 0 · At most 23

minute*integer

Default 0 · At least 0 · At most 59

weekday*integer

A weekly check's day: 0 is Sunday

Default 1 · At least 0 · At most 6

timezonestring

The IANA time zone of the hour, like Europe/Berlin. Left out: the workspace's, or UTC

At most 64 characters

tests*enum<string>

main: the tests on the main path. all: every active test. On production, only the tests that are safe there

mainall

Default "main"

paused*boolean

A paused schedule starts no check

Default false

nextRunAt*string | null

When its next scheduled check starts. null with no schedule, or a paused one

failing*object | null

Its scheduled checks began to fail then. A scheduled check that passes ends it, and so do a pause and the end of the schedule

2 properties
since*string

ISO 8601 date and time

run*string

The latest scheduled test run that failed

missed*object | null

The latest scheduled check that couldn't start, and why, like the daily limit of test runs. A check that starts clears it

2 properties
at*string

ISO 8601 date and time

why*string
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.
404 not_foundCheck the path and any id in it. Every operation is listed in /api/v1/openapi.json.
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.