Skip to navigation

Override a behavior verdict

Records whether a behavior happened on a span, replacing the model’s score (Happened / Not happened in the app). The span must already have a verdict for the behavior. Span-level reads use it at once; rollup counts pick it up within 10 minutes for spans from the last 48 hours.

Authentication

AuthorizationBearer

Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.

Path parameters

unique_idstringRequired
Span ID.
behavior_keystringRequired

Behavior key: a built-in behavior's name (for example refusal) or a custom behavior's id.

Request

This endpoint expects an object.
probdoubleRequired0-1

The score to record in place of the model's. Send 1 for Happened and 0 for Not happened. The behavior fires when this is 0.65 or higher.

Response

The span's new verdict.
labelenum

1 when the behavior fired (prob is 0.65 or higher), else 0.

Allowed values:
probdouble
The score now on the span.
sourcestring

human after an override.

stateenum

detected at 0.65 or higher, uncertain from 0.35 up to 0.65, else not_detected.

Allowed values:
polarityenum or null

Whether the behavior firing is good or bad: negative (an Issue), positive (a Win) or neutral (Info). Display metadata only; it does not change how spans are scored.

Allowed values:

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
429
Too Many Requests Error