# Ingest from a Clay HTTP API column
curl -X POST https://api.tryaware.ai/functions/v1/tally-api/v1/scores \
-H "Authorization: Bearer tally_..." \
-H "Content-Type: application/json" \
-d '{
"scope_key": "acme-q2-outbound",
"rule_key": "intent_score",
"scores": [
{ "row_key": "lead_123", "score": 87.4 }
]
}'
# Then ask: where does this row rank?
curl "https://api.tryaware.ai/functions/v1/tally-api/v1/rank?\
scope_key=acme-q2-outbound&rule_key=intent_score&row_key=lead_123&top_n=10"
# => { "rank": 3, "percentile": 0.992, "in_top_n": true, ... }Re-running a Clay table won't double-count. Upsert by (scope, rule, row_key) with TTLs.
Postgres window functions handle competition, dense, all, and none tie modes — never in app code.
Per-workspace API keys, RLS on every table, audit log for every destructive action.