Skip to main content
TroopyDocs
Open Troopy
Troopy

API reference / Troop

Hire a teammate

Hires a teammate into a role from GET /roles, or into the custom role a finished draft run proposed (POST /roles/drafts). It starts with its role's memory files. A lead can't be hired twice. Needs an owner or admin.

post/api/v1/agents

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 agents hire
MCP tooltroopy_hire_agent
Rate limit10 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
rolestring

A role's id from GET /roles

At most 40 characters

draftstring

A finished draft_role run, to hire the role it drafted

namestring

A name of its own. Without one, the theme of the organization names it, or else its job title

At least 1 characters · At most 60 characters

Response

201 · application/json
data*object
33 properties
handle*string
name*string
role*string

The role it was hired into, like writer, or custom

title*string

The job, like Content writer

tagline*string

What it does, in a few words, like Writes emails, articles and web copy in your voice

area*enum<string>

The area it works in: engineering, marketing or operations; lead for the troop's lead

leadengineeringmarketingoperations

lead*boolean

The troop's lead, whom a conversation goes to unless it names another teammate

avatar*object

Its face: a bot-avatars body type, colour (#RRGGBB), face and shading, a robot head, or an object with two eyes

6 properties
shape*enum<string>

cloverflowertrianglesquareblobghostcircledropstardroidmechalienhexagoncatcloudpilland 2 more

color*string
face*enum<string>

eyesmouth

shadingenum<string>

How its body is lit; fabric when unset

fabricplasticcrispsmoothflat

robotobject

A TV-headed robot (robot-heads) in place of the bot. shape, color, face and shading stay for the bot

5 properties
shape*enum<string>

rectanglesquarecirclehexagon

shell*string

The colour of its shell

trim*string

The colour of its ears and of the collar of its antenna

screen*string

The colour of the lights on its screen

antenna*boolean
objectobject

An object with two eyes in place of the bot. shape, color, face and shading stay for the bot

2 properties
shape*enum<string>

circlesquaretrianglepilldrophexagonpentagoncloudbeancloverflowersparkleburstapplechatbulband 13 more

color*string

The colour of the object

status*enum<string>

working: a run is going. paused: it won't start runs until resumed

idleworkingpaused

needsYou*boolean

It waits on a person: a task of its own waits in Needs you (a question, or a call to approve), or a call of its own waits for a yes (GET /approvals)

lastActiveAt*string | null

When it last finished a run

doing*string | null

While it works: what it is doing, in its own few words, like "Checking Acme's payment terms"; null before its first step says

plan*string | null

The id of the AI plan it starts on; null follows the organization's default

model*string | null

The model it runs on, from its plan's list (GET /ai-plans/{plan}/models); null uses the plan's model

effort*enum<string> | null

How hard its model thinks, one that its model takes; null uses the plan's effort on the plan's model, else the model's default

lowmediumhighxhighmax

summary*string
job*object
4 properties
goal*string
responsibilities*array<string>
done*array<string>
never*array<string>
tools*array<object>

Everything it can do. It acts as a plain member with only these tools' scopes

4 properties
id*string

The tool's id, like search_brain

label*string
approval*boolean

Calls to it wait for a person's approval

off*boolean

A person switched it off for the troop (PATCH /teammate-tools), so the teammate can't use it now

skills*array<object>

The skills of its role. Every teammate can also open the skills of the workspace (GET /skills)

4 properties
name*string

What it opens the skill by, and what a person types after / to ask for it

title*string
when*string

When it uses the skill

about*string | null

What the skill does, in one plain sentence for people

routinePresets*array<object>

Routines its role offers to run on a schedule

5 properties
name*string
task*string
days*array<integer>

Days of the week it runs on, 0 is Sunday

At most 7 items

hour*integer
minute*integer
limits*object

What one run of it may do: its role's limits, with each one that an owner or admin set in their place

3 properties
rounds*integer

Model calls in one run

runsPerDay*integer

Runs a day, whatever started them

usdPerRun*number

What one run may spend, on plans billed per token

roleLimits*object

The limits of its role

3 properties
rounds*integer

Model calls in one run

runsPerDay*integer

Runs a day, whatever started them

usdPerRun*number

What one run may spend, on plans billed per token

roleVersion*integer
voice*enum<string>

The voice it has on a voice call. A teammate with no voice set has one that Troopy picks from its id

alloyashballadcoralechosageshimmerversemarincedar

sites*array<string>

Sites its read_web_page tool may open, besides the business's own and any a person names in a request

needs*array<object>

Apps its tools read from; it can't work until each is connected (POST /apps/{provider})

3 properties
id*enum<string>

stripeposthoggithubnotionhunterlemonsqueezypolarpaddledodopaymentssearchconsolemetaadsgooglecalendargeminiopenaifalreplicate

name*string
connected*boolean
identity*string

Who it is, in markdown, at most 20,000 characters. The teammate reads it at the start of every run

At most 20000 characters

personality*string

How it works, in markdown, at most 20,000 characters. The teammate reads it at the start of every run

At most 20000 characters

notes*string

Facts it must always know, in markdown, at most 20,000 characters. The teammate reads it at the start of every run

At most 20000 characters

expertise*array<string>

What it is good at, as short tags

starters*array<string>

Ideas for a first message

stats*object
8 properties
runs*integer
done*integer
failed*integer
inFlight*integer

Runs going now

waiting*integer

Calls waiting for a person's approval

drafts*integer

Drafts waiting for a person to use or discard

conversations*integer
successRate*integer | null

Finished runs out of all that ended, in percent. Null before the first

createdAt*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.