Roles
Inbound: pulling inventory
- S3
- HTTPS webhook (inbound)
Required config:
bucket— bucket name (e.g.acme-inventory).prefix— key prefix to watch (e.g.daily-uploads/).region— AWS region (e.g.us-east-1).secretRef— vault id containingaccessKeyId+secretAccessKey(IAM keys withs3:GetObject+s3:ListBucket).
pull_inventory_from_source(sourceId) either on its scheduleCron (default the agent’s cron) or on demand. New files since lastSyncedAt are downloaded, uploaded via the standard inventory pipeline, and recorded in agent_data_source_sync.manifest_json.Auto-pull on schedule
Controlled by the rule set:DATA_SOURCE_PULL_FAILED pending item is filed, and configured channels are notified.
Outbound: pushing results
- S3
- HTTPS webhook (outbound)
Same shape as the inbound config (
bucket + prefix + region + secretRef), plus IAM keys with s3:PutObject permission. The agent writes {prefix}/job-{jobId}.{format} on successful job completion.Push actions are not undoable — outbound webhooks are external side effects. Use the test endpoint before flipping auto-push on.
Secret handling
All credentials live in the existing secret vault used byBillingService. They are:
- Never logged.
- Never returned in full from the API (
mt_byo_****1234redaction). - Encrypted at rest.
- Validated at save time via a low-cost ping (
OPTIONSfor webhooks,ListBucketfor S3).
Testing a source / sink
Every source has a Test button (and aPOST /api/v1/agents/{id}/data-sources/{sid}/test endpoint). It runs a read-only smoke check — no data moved, no sync record created. Returns a verbose pass/fail with the diagnostic message.
Sync history
The Inbound / Outbound subsections show the last N syncs per source. Per-row manifest, byte counts, errors. Drill in viaGET /api/v1/agents/{id}/data-sources/{sid}/syncs.
API: create a data source
POST /api/v1/agents/{agentId}/data-sources
Request body:
configJson is stored as-is and read by the transport adapter at pull/push/test time. Keys by type:
type: S3
For S3,
secret is a JSON string with AWS credentials: {"accessKey":"...","secretKey":"..."}.
type: HTTPS_WEBHOOK
For
HTTPS_WEBHOOK, secret holds the credential for the chosen auth.type: the token for bearer (sent as Authorization: Bearer <token>), the user:pass for basic, or the signing key for hmac_sha256 (requests carry X-Timestamp, X-Signature, X-Signature-Version: v1).
API: create a channel
POST /api/v1/agents/{agentId}/channels
Notification channels deliver agent events (pending items, failures, summaries). Request body:
eventSubscriptions is a free-form list of event-kind strings, not a fixed enum. The event kinds the agent runtime currently emits are cost_threshold, on_pause, on_action, and cycle_completed (plus test, used by the channel test endpoint). Leave the array empty to receive everything.
Related
- Agents overview — broader context.
- Recipes: Pull inventory from S3
- Recipes: Push results to webhook