Evaluate a custom moment
Runs a saved custom moment, its current or an earlier version, over up to 1,000 turns as it would run live. Returns where it fired and, when expected labels the turns it should fire on, hits, misses, false fires, precision and a suggestion. Also returns the threshold a turn needed and up to 3 near misses: the turns that scored highest without firing, each with its score and why it did not fire. Gives up after 90 seconds. An organization starts at most 10 evaluations a minute.
Authorization
apiKey API key (prefix spk_test_ or spk_live_) or personal access token (prefix pat_)
In: header
Path Parameters
Custom moment ID
Header Parameters
Idempotency key that prevents processing a request twice. Use a unique UUID v4 per request.
length <= 255Request Body
application/json
A conversation whose stored final turns to read, up to 1,000. Send this or turns.
Your ids of the turns it should fire on; every other turn should not. Absent leaves the label fields of the result null.
Up to 1,000 turns under the turn contract; only final ones are read. Send these or conversation_id.
items <= 1000The version to evaluate; the current one when absent
int64Response Body
application/json
application/json
curl -X POST "https://example.com/moments/mdef_2jxsy8cc8v0348asy6t1/evaluate" \ -H "Idempotency-Key: string" \ -H "Content-Type: application/json" \ -d '{}'{ "expected": 0, "false": [ { "text": "string", "turn": "t_12" } ], "false_fires": 0, "fires": [ { "at": 0.1, "confidence": 0.1, "text": "string", "turn": "t_88" } ], "hits": 0, "misses": [ { "text": "string", "turn": "t_12" } ], "near_misses": [ { "reason": "below_threshold", "score": 0.1, "threshold": 0.1, "turn_id": "t_12" } ], "precision": 0, "stats": { "fires": 0, "ms": 0, "turns": 0 }, "suggestion": "string", "threshold": 0.1}