Every API here is available over the APIs.io API and to AI agents over MCP.
openapi: 3.2.0
info:
title: TrustyCap Developer Platform Automation API
version: 1.0.0
summary: 'One platform, many capabilities: Digital Life, Protected Transactions (TRUSTY), Document Intelligence, Vehicle Intelligence, Financing Intelligence, one meter.'
description: 'The TrustyCap Developer Platform API is a thin, governed externalization of the primitives TrustyCap''s own products use. One developer account, organization, application and credential reach every enabled capability family; every call is authorized by namespaced scopes, executed by the TrustyCap platform, and metered by the Trusty Meter. The platform answers at https://api.trustycap.com. Every material action follows plan → validate → authorize → commit → verify → receipt. See https://developers.trustycap.com for the platform and https://docs.trustycap.com for the reference.
Conventions: prefixed ULID ids; cursor pagination (`limit`, `cursor` → `data`, `next_cursor`); `Idempotency-Key` on mutations; RFC 9457 problem responses; IETF `RateLimit-*` headers; CloudEvents webhooks signed with `TrustyCap-Signature`, also sent under its original name `Sweep-Signature`.'
termsOfService: https://app.trustycap.com/legal/developer-terms
contact:
name: TrustyCap Developer Support
url: https://developers.trustycap.com
email: hello@trustycap.com
license:
name: Apache-2.0
identifier: Apache-2.0
x-logo:
url: https://trustycap.com/brand/lockup-horizontal-light.png
altText: TrustyCap
servers:
- url: https://api.trustycap.com
description: TrustyCap Developer Platform (test mode via sk_test_ keys)
tags:
- name: Automation
paths:
/v1/automation/targets:
get:
operationId: listAutomationTargets
tags:
- Automation
summary: Autopilot / Auto-Rescue targets
responses:
'200':
description: OK
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
content:
application/json:
schema:
$ref: '#/components/schemas/AutomationTargets'
'400':
description: 'Problem: invalid_request, validation_failed, invalid_object_key'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'401':
description: 'Problem: unauthorized'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'402':
description: 'Problem: ceiling_reached, commercial_authorization_required, commercial_denied, payment_required, payment_method_required, budget_limit_reached, storage_read_suspended, billing_suspended'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'403':
description: 'Problem: action_denied, capability_not_enabled, phi_attestation_required, phi_channel_not_authorized, phi_lane_not_authorized, forbidden, insufficient_scope, live_mode_only, production_inactive, step_up_required, tenant_boundary, test_mode_only'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'404':
description: 'Problem: not_found'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'409':
description: 'Problem: conflict, idempotency_in_flight, idempotency_key_reused, plan_hash_mismatch, plan_not_authorized, plan_stale, plan_state_conflict, preservation_invariant, provider_reauth_required'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'410':
description: 'Problem: plan_expired'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'413':
description: 'Problem: object_too_large'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'422':
description: 'Problem: provider_unsupported'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'429':
description: 'Problem: provider_rate_limited, rate_limited'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
headers:
Retry-After:
$ref: '#/components/headers/Retry-After'
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
'500':
description: 'Problem: internal_error'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'501':
description: 'Problem: unsupported'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'502':
description: 'Problem: provider_error'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'503':
description: 'Problem: capability_unavailable, storage_backend_unavailable, unavailable'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
security:
- sessionCookie: []
- sessionToken: []
- apiKey:
- sources:read
- oauth2:
- sources:read
/v1/automation/targets/{sourceId}:
put:
operationId: updateAutomationTarget
tags:
- Automation
summary: Configure Autopilot / Auto-Rescue for a source (standing authorization)
parameters:
- name: sourceId
in: path
required: true
schema:
type: string
pattern: ^src_[0-9A-HJKMNP-TV-Z]{26}$
- $ref: '#/components/parameters/IdempotencyKey'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AutomationTargetUpdate'
responses:
'200':
description: OK
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
content:
application/json:
schema:
$ref: '#/components/schemas/AutomationTargetChanged'
'400':
description: 'Problem: invalid_request, validation_failed, invalid_object_key'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'401':
description: 'Problem: unauthorized'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'402':
description: 'Problem: ceiling_reached, commercial_authorization_required, commercial_denied, payment_required, payment_method_required, budget_limit_reached, storage_read_suspended, billing_suspended'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'403':
description: 'Problem: action_denied, capability_not_enabled, phi_attestation_required, phi_channel_not_authorized, phi_lane_not_authorized, forbidden, insufficient_scope, live_mode_only, production_inactive, step_up_required, tenant_boundary, test_mode_only'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'404':
description: 'Problem: not_found'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'409':
description: 'Problem: conflict, idempotency_in_flight, idempotency_key_reused, plan_hash_mismatch, plan_not_authorized, plan_stale, plan_state_conflict, preservation_invariant, provider_reauth_required'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'410':
description: 'Problem: plan_expired'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'413':
description: 'Problem: object_too_large'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'422':
description: 'Problem: provider_unsupported'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'429':
description: 'Problem: provider_rate_limited, rate_limited'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
headers:
Retry-After:
$ref: '#/components/headers/Retry-After'
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
'500':
description: 'Problem: internal_error'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'501':
description: 'Problem: unsupported'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'502':
description: 'Problem: provider_error'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'503':
description: 'Problem: capability_unavailable, storage_backend_unavailable, unavailable'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
security:
- sessionCookie: []
- sessionToken: []
x-sweep-operation-class: automate
x-sweep-risk: high
x-sweep-idempotent: true
/v1/automation/runs:
get:
operationId: listAutomationRuns
tags:
- Automation
summary: Automation run history
parameters:
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/cursor'
responses:
'200':
description: OK
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
content:
application/json:
schema:
type: object
required:
- data
- next_cursor
properties:
data:
type: array
items:
$ref: '#/components/schemas/AutomationRun'
next_cursor:
type:
- string
- 'null'
'400':
description: 'Problem: invalid_request, validation_failed, invalid_object_key'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'401':
description: 'Problem: unauthorized'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'402':
description: 'Problem: ceiling_reached, commercial_authorization_required, commercial_denied, payment_required, payment_method_required, budget_limit_reached, storage_read_suspended, billing_suspended'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'403':
description: 'Problem: action_denied, capability_not_enabled, phi_attestation_required, phi_channel_not_authorized, phi_lane_not_authorized, forbidden, insufficient_scope, live_mode_only, production_inactive, step_up_required, tenant_boundary, test_mode_only'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'404':
description: 'Problem: not_found'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'409':
description: 'Problem: conflict, idempotency_in_flight, idempotency_key_reused, plan_hash_mismatch, plan_not_authorized, plan_stale, plan_state_conflict, preservation_invariant, provider_reauth_required'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'410':
description: 'Problem: plan_expired'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'413':
description: 'Problem: object_too_large'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'422':
description: 'Problem: provider_unsupported'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'429':
description: 'Problem: provider_rate_limited, rate_limited'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
headers:
Retry-After:
$ref: '#/components/headers/Retry-After'
RateLimit-Limit:
$ref: '#/components/headers/RateLimit-Limit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimit-Remaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimit-Reset'
'500':
description: 'Problem: internal_error'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'501':
description: 'Problem: unsupported'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'502':
description: 'Problem: provider_error'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'503':
description: 'Problem: capability_unavailable, storage_backend_unavailable, unavailable'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
security:
- sessionCookie: []
- sessionToken: []
- apiKey:
- sources:read
- oauth2:
- sources:read
components:
schemas:
Quota:
type: object
properties:
source_id:
type: string
description: On GET /v1/sources/{id}/quota; a source's own `quota` omits it
used_bytes:
type: integer
limit_bytes:
oneOf:
- type: integer
- type: 'null'
trash_bytes:
oneOf:
- type: integer
- type: 'null'
breakdown:
type: object
additionalProperties:
type: integer
observed_at:
type: string
format: date-time
required:
- used_bytes
- limit_bytes
- observed_at
additionalProperties: false
description: A source's storage as the provider last reported it.
Source:
type: object
properties:
id:
type: string
pattern: ^src_[0-9A-HJKMNP-TV-Z]{26}$
description: Prefixed ULID (src_…)
examples:
- src_01J8Z3K9M2Q4R6S8T0V2W4X6Y8
provider:
type: string
enum:
- google_gmail
- google_drive
- microsoft_outlook
- microsoft_onedrive
- dropbox
- apple_local
- s3_compatible
- trusty_vault
- simulated
kind:
type: string
display_name:
type: string
email:
oneOf:
- type: string
- type: 'null'
status:
type: string
enum:
- connected
- reauth_required
- revoked
- disconnected
- error
- pending
granted_operations:
type: array
items:
type: string
enum:
- discover
- preserve
- write
- remove
- restore
- migrate
- monitor
- automate
- billable_execute
description: Operation classes drive least-privilege scope selection and consent tiers.
policy:
$ref: '#/components/schemas/SweepPolicy'
autopilot:
oneOf:
- type: object
additionalProperties: true
description: The source's Autopilot settings, when set
- type: 'null'
last_scan_at:
oneOf:
- type: string
format: date-time
- type: 'null'
connected_at:
type: string
format: date-time
connected_via_application_id:
oneOf:
- type: string
- type: 'null'
connection_id:
oneOf:
- type: string
pattern: ^cxn_[0-9A-HJKMNP-TV-Z]{26}$
description: Prefixed ULID (cxn_…)
examples:
- cxn_01J8Z3K9M2Q4R6S8T0V2W4X6Y8
- type: 'null'
simulated:
type: boolean
quota:
oneOf:
- $ref: '#/components/schemas/Quota'
- type: 'null'
inventory:
type: array
items:
type: object
properties:
storage_class:
oneOf:
- type: string
- type: 'null'
n:
type: integer
bytes:
type: integer
required:
- storage_class
- n
- bytes
additionalProperties: false
description: 'On a single source''s read: what its inventory holds, by storage class'
required:
- id
- provider
- kind
- display_name
- email
- status
- granted_operations
- policy
- autopilot
- last_scan_at
- connected_at
- connected_via_application_id
- connection_id
- simulated
additionalProperties: false
AutomationTargetUpdate:
type: object
properties:
enabled:
type: boolean
keepBelowPercent:
type: number
minimum: 50
maximum: 99
default: 80
scanCadenceHours:
type: integer
minimum: 6
maximum: 168
default: 24
autoRescue:
type: boolean
default: false
description: Needs a paid consumer plan and a monthly limit above zero. TrustyCap no longer sells one, so an account on the free plan is refused with payment_required.
rescueTriggerPercent:
type: number
minimum: 50
maximum: 100
default: 90
maxMonthlySpendCents:
type: integer
minimum: 0
default: 0
required:
- enabled
additionalProperties: false
description: A source's standing automation, as the person sets it.
Problem:
type: object
properties:
type:
type: string
format: uri
description: https://docs.trustycap.com/api/errors/#<code>
title:
type: string
status:
type: integer
detail:
type: string
code:
type: string
description: Machine-readable error code from errors.json
request_id:
type: string
errors:
type: array
items:
type: object
properties:
path:
type: string
message:
type: string
required:
- path
- message
additionalProperties: false
required:
- type
- title
- status
- code
- request_id
additionalProperties: true
description: RFC 9457 problem details. Extension members carry what the code needs to act on (for example required_scopes, retry_after, checklist, consent_url), as RFC 9457 allows.
SweepPolicy:
type: object
properties:
version:
type: string
minAgeDays:
type: integer
minSizeBytes:
type: integer
excludeSenders:
type: array
items:
type: string
excludeDomains:
type: array
items:
type: string
excludeLabels:
type: array
items:
type: string
excludeFolders:
type: array
items:
type: string
excludeStarred:
type: boolean
excludeShared:
type: boolean
excludeRecentDays:
type: integer
preserveMimeTypes:
type: array
items:
type: string
preserveKeywords:
type: array
items:
type: string
removePromotional:
type: boolean
duplicateHandling:
type: string
enum:
- keep_newest
- keep_oldest
- review
sourceAction:
type: string
enum:
- trash
- none
preservation:
type: string
enum:
- vault_all
- vault_preserve_class_only
additionalProperties: false
AutomationRun:
type: object
properties:
id:
type: string
pattern: ^exe_[0-9A-HJKMNP-TV-Z]{26}$
description: Prefixed ULID (exe_…)
examples:
- exe_01J8Z3K9M2Q4R6S8T0V2W4X6Y8
execution_id:
type: string
pattern: ^exe_[0-9A-HJKMNP-TV-Z]{26}$
description: Prefixed ULID (exe_…)
examples:
- exe_01J8Z3K9M2Q4R6S8T0V2W4X6Y8
plan_id:
type: string
pattern: ^pln_[0-9A-HJKMNP-TV-Z]{26}$
description: Prefixed ULID (pln_…)
examples:
- pln_01J8Z3K9M2Q4R6S8T0V2W4X6Y8
source_id:
oneOf:
- type: string
- type: 'null'
source_name:
oneOf:
- type: string
- type: 'null'
kind:
type: string
enum:
- autopilot
- auto_rescue
status:
type: string
description: The execution's status
bytes_preserved:
type: integer
bytes_removed:
type: integer
storage_percent_after:
oneOf:
- type: number
description: How full the source was afterwards, when its provider reports a limit
- type: 'null'
charge_cents:
oneOf:
- type: integer
description: From the run's signed receipt; null until it is issued
- type: 'null'
at:
type: string
format: date-time
required:
- id
- execution_id
- plan_id
- source_id
- source_name
- kind
- status
- bytes_preserved
- bytes_removed
- storage_percent_after
- charge_cents
- at
additionalProperties: false
AutomationTargetChanged:
type: object
properties:
source:
$ref: '#/components/schemas/Source'
target:
$ref: '#/components/schemas/AutomationTarget'
required:
- source
- target
additionalProperties: false
AutomationTargets:
type: object
properties:
data:
type: array
items:
type: object
properties:
source_id:
type: string
provider:
type: string
display_name:
oneOf:
- type: string
- type: 'null'
target:
oneOf:
- $ref: '#/components/schemas/AutomationTarget'
- type: 'null'
required:
- source_id
- provider
- display_name
- target
additionalProperties: false
pricing:
type: object
properties:
rescue_execution_cents:
type: integer
rescue_gb_cents:
type: integer
included_gb_per_rescue:
type: integer
required:
- rescue_execution_cents
- rescue_gb_cents
- included_gb_per_rescue
additionalProperties: false
ceiling_cents:
type: integer
plan:
type: string
required:
- data
- pricing
- ceiling_cents
- plan
additionalProperties: false
AutomationTarget:
type: object
properties:
sourceId:
type: string
enabled:
type: boolean
keepBelowPercent:
type: number
scanCadenceHours:
type: integer
autoRescue:
type: boolean
rescueTriggerPercent:
type: number
maxMonthlySpendCents:
type: integer
authorizedAt:
type: string
format: date-time
authorizedBy:
type: string
pricingVersion:
type: string
termsVersion:
type: string
coveredActions:
type: array
items:
type: string
version:
type: integer
required:
- sourceId
- enabled
- keepBelowPercent
- scanCadenceHours
- autoRescue
- rescueTriggerPercent
- maxMonthlySpendCents
additionalProperties: false
description: 'A source''s standing automation as authorized: the target, who set it, when, and on what terms.'
parameters:
IdempotencyKey:
name: Idempotency-Key
in: header
required: false
schema:
type: string
maxLength: 255
description: 'Unique key per logical operation. Same key + same body within 24h replays the original response with `Idempotent-Replayed: true`; same key + different body → 409 idempotency_key_reused.'
cursor:
name: cursor
in: query
schema:
type: string
description: Opaque cursor from `next_cursor`.
limit:
name: limit
in: query
schema:
type: integer
minimum: 1
maximum: 200
default: 50
headers:
RateLimit-Limit:
schema:
type: integer
description: Requests allowed in the current window.
RateLimit-Reset:
schema:
type: integer
description: Seconds until the window resets.
Retry-After:
schema:
type: integer
description: Seconds to wait before retrying.
RateLimit-Remaining:
schema:
type: integer
description: Requests remaining in the current window.
securitySchemes:
sessionCookie:
type: apiKey
in: cookie
name: sweep_session
description: Consumer web session (HttpOnly). Mutations require an allowlisted Origin.
sessionToken:
type: http
scheme: bearer
bearerFormat: sst_…
description: Consumer session token for native/PWA clients.
apiKey:
type: http
scheme: bearer
bearerFormat: sk_live_… | sk_test_…
description: Developer API key. Scopes fixed at creation. sk_test_ keys operate in the isolated test tenant.
oauth2:
type: oauth2
description: 'OAuth 2.1 with PKCE (S256), RFC 8707 resource indicators, refresh rotation. Discovery: /.well-known/oauth-authorization-server.'
flows:
authorizationCode:
authorizationUrl: https://api.trustycap.com/oauth/authorize
tokenUrl: https://api.trustycap.com/oauth/token
refreshUrl: https://api.trustycap.com/oauth/token
scopes:
sweep.sources:read: Read connected sources and quota
sweep.sources:write: Connect and disconnect sources
sweep.inventory:read: Read normalized inventory, diagnosis, and the Digital State Graph
sweep.plans:write: Create, validate, and price shadow plans; read executions and receipts
sweep.plans:commit: Authorize and commit plans (executes actions within the user's delegation)
sweep.vault:read: List, search, and download Vault objects and manifests
sweep.vault:write: Upload to the Vault
sweep.intel:read: Read trial, renewal, meter, and spend intelligence
sweep.creator:read: Read creator revenue audits
sweep.creator:write: Connect creator sources and upload statements
platform.usage:read: Read usage, charges, and the commercial envelope
platform.grants:manage: List and revoke delegation grants
platform.account:read: Read account identity and the events the application caused
sources:read: Read connected sources and quota
sources:write: Connect and disconnect sources
inventory:read: Read normalized inventory, diagnosis, and the Digital State Graph
plans:write: Create, validate, and price shadow plans; read executions and receipts
plans:commit: Authorize and commit plans (executes actions within the user's delegation)
vault:read: List, search, and download Vault objects and manifests
vault:write: Upload to the Vault
intel:read: Read trial, renewal, meter, and spend intelligence
creator:read: Read creator revenue audits
creator:write: Connect creator sources and upload statements
usage:read: Read usage, charges, and the commercial envelope
grants:manage: List and revoke delegation grants
account:read: Read account identity and the events the application caused
x-sweep:
contract: docs/architecture/API-SURFACE.md
receiptJwks: https://api.trustycap.com/.well-known/trustycap-receipts.json
mcp: https://mcp.trustycap.com/mcp
a2aAgentCard: https://api.trustycap.com/.well-known/agent-card.json
oauthMetadata: https://api.trustycap.com/.well-known/oauth-authorization-server