Behaviors

Get behavior summary

Changed on

Returns how often each behavior fired in a time range, with totals and a rollup by polarity. Counts come from an hourly rollup refreshed every 10 minutes, so the range is widened to whole hours.

post/api/pulses/behaviors/

Request

  • Base URL
    https://api.respan.ai
  • URL
    https://api.respan.ai/api/pulses/behaviors/
  • Auth
    HTTP bearer

Request body

start_timestring date-time

Start of the range, ISO 8601. A time without an offset is read as UTC. Defaults to 7 days ago, which is also used if the value can't be parsed.

end_timestring date-time

End of the range, ISO 8601. A time without an offset is read as UTC. Defaults to now, which is also used if the value can't be parsed.

environmentstring

Only count spans from this environment, such as prod or test. Omit it to include every environment.

Example request

{
  "start_time": "2026-09-24T00:00:00Z",
  "end_time": "2026-10-01T00:00:00Z",
  "environment": "prod"
}

Response

Behavior counts for the range.

total_behaviors_trackedinteger required

Behaviors in behaviors that fired at least once.

total_classified_spansinteger required

Distinct spans scored in the range. A span scored for several behaviors counts once.

total_fired_spansinteger required

Distinct spans where at least one behavior fired.

net_sentimentinteger required

polarity_totals.positive minus polarity_totals.negative.

Example response

{
  "behaviors": [
    {
      "behavior": "instruction_miss",
      "fired_spans": 143,
      "classified_spans": 5210,
      "polarity": "negative",
      "is_builtin": true
    }
  ],
  "total_behaviors_tracked": 6,
  "total_classified_spans": 5210,
  "total_fired_spans": 1288,
  "polarity_totals": {
    "positive": 412,
    "negative": 187,
    "neutral": 960
  },
  "net_sentiment": 225
}

Changes