Skip to main content
TroopyDocs
Open Troopy
Troopy

API reference / Vault

Add a vault item

Adds a login, API key, secret or note to a collection you may use (the default one unless you name another). Values go in sealed and never come out through the API. Cards are added in the app only. A login's urls say where it may be used; they can't be changed through the API later.

post/api/v1/vault/items

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 vault add
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
collectionstring

The collection to add it to; the default one if left out

kind*enum<string>

loginapi_keysecretnote

name*string

At least 1 characters · At most 200 characters

tagsarray<string>

At most 10 items

urlsarray<string>

Logins: the pages it signs in on. API keys: the service's address

At most 10 items

environmentenum<string>

testlive

expiresAtstring

date-time

valuesobject

Field values by key, like {"username": "ops@acme.com", "password": "..."}. Each kind's keys: VAULT_TEMPLATES

customarray<object>

Fields of your own, added after the kind's

At most 20 items

4 properties
label*string

At least 1 characters · At most 60 characters

value*string

At most 20000 characters

concealedboolean

Default true

typeenum<string>

textemailurlpasswordmultiline

Default "text"

Response

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

A 24-character id

collection*object
2 properties
id*string

A 24-character id

name*string
kind*enum<string>

loginapi_keysecretnotecard

name*string
tags*array<string>
urls*array<string>

Logins: the pages it signs in on. API keys: the service's address

sites*array<string>

The domains of urls: where a teammate may use a login

environment*enum<string> | null

API keys: test or live

testlive

expiresAt*string | null
fields*array<object>
7 properties
key*string

Stable: references (troopy://vault/<item>/<key>) name it

label*string
type*enum<string>

textemailurlpasswordtotpmonthmultiline

concealed*boolean

Concealed values never leave through the API; people see them in the app after unlocking

value*string | null

The value when it isn't concealed; null when concealed or empty

hint*string | null

A long key's or card number's last four characters

set*boolean

Whether it has a value

status*enum<string>

unconfirmed: a login a teammate made signing up, until it signs in with it or a person confirms it

activeunconfirmed

importedFrom*enum<string> | null

1passwordbitwardenlastpasschrome

createdBy*object

Who added it: a person, a teammate (type agent) or an API key

3 properties
type*enum<string>

personagentapi

id*string
name*string
updatedBy*object

Who wrote it

3 properties
type*enum<string>

personagentapi

id*string
name*string
level*enum<string>

What you may do with it

viewusemanage

createdAt*string

ISO 8601 date and time

updatedAt*string

ISO 8601 date and time

lastUsedAt*string | null

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.