Pipeline API
The Intent Pipeline: a request in plain English, checked in stages, before any order exists.
Objects
A pipeline run is one request in plain English, processed in visible stages. Its intent is the structured interpretation (action, accounts, changes, constraints), its stages the outcome of each stage.
Life cycle
| Stage | Call | What happens |
|---|---|---|
| 0 Interpret | POST /pipeline/runs {"text": "…"} | The AI (or the built-in parser) turns the text into an intent. Status interpreted. Check intent before going on. |
| 1–3 Run | POST /pipeline/runs/{id}/run | Entitlements (accounts where the identity has propose), proposals (the optimizer), compliance pre-check (every trade against every active rule). Status checked. |
| 4 Orders | POST /pipeline/runs/{id}/orders | The orders are created and checked again; same-direction trades across accounts become one block order. Status orders_created. Nothing is executed. |
{"text": "…", "run": true} interprets and runs stages 1–3 in one call (it still stops before creating orders).
Typical sequence
RUN=$(curl -s -X POST https://vestoris.com/api/v1/pipeline/runs -H "Authorization: Bearer $VESTORIS_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" -H "Content-Type: application/json" \
-d '{"text":"Rebalance growth accounts without realizing gains over $25k"}' | jq -r .id)
curl -s -X POST https://vestoris.com/api/v1/pipeline/runs/$RUN/run -H "Authorization: Bearer $VESTORIS_TOKEN" -H "Idempotency-Key: $(uuidgen)"
# read stages: entitlements, proposals, compliance; then, if a person agrees:
curl -s -X POST https://vestoris.com/api/v1/pipeline/runs/$RUN/orders -H "Authorization: Bearer $VESTORIS_TOKEN" -H "Idempotency-Key: $(uuidgen)"Orders then follow the order life cycle: approval when above the thresholds, release by someone with trade. Every AI interpretation is in the AI log with the client it came through.
Endpoints
| Call | What it does | Scope |
|---|---|---|
GET/pipeline/runs | Your intent-pipeline requests | pipeline:read |
GET/pipeline/runs/{id} | A request with its stages | pipeline:read |
POST/pipeline/runs | Interpret a request in plain English (stage 0; the AI may be used) | pipeline:write |
POST/pipeline/runs/{id}/run | Run the stages: entitlements, proposals, compliance pre-check | pipeline:write |
POST/pipeline/runs/{id}/orders | Create the orders (each checked again; nothing is executed) | pipeline:write |