Behaviors

Get behavior signals over time

Changed on

Returns how many spans fired each behavior per time bucket, or per polarity with group_by: polarity. minute buckets use exact range edges; larger buckets read the hourly rollup.

post/api/pulses/behaviors/timeseries/

Request

  • Base URL
    https://api.respan.ai
  • URL
    https://api.respan.ai/api/pulses/behaviors/timeseries/
  • 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.

granularity'minute' | 'hour' | 'day' | 'week'

Bucket size.

group_by'behavior' | 'polarity'

behavior returns one series per behavior. polarity sums them into one series per polarity.

behaviorsstring[]

Only include these behavior keys (built-in names or custom behavior IDs). Omit for every behavior.

Example request

{
  "start_time": "2026-09-24T00:00:00Z",
  "end_time": "2026-10-01T00:00:00Z",
  "environment": "prod",
  "granularity": "hour",
  "group_by": "behavior",
  "behaviors": [
    "refusal",
    "instruction_miss"
  ]
}

Response

Fired counts per bucket.

granularity'minute' | 'hour' | 'day' | 'week' required
group_by'behavior' | 'polarity' required

Example response

{
  "granularity": "hour",
  "group_by": "behavior",
  "series": [
    {
      "bucket": "2026-09-30T14:00:00",
      "behavior": "instruction_miss",
      "polarity": "negative",
      "fired_spans": 12
    }
  ]
}

Changes

    • breaking

      the // response's property type changed from string to no type for status

    • info

      api operation id behaviors_getBehaviorTimeSeries removed and replaced with getBehaviorTimeSeries

    • info

      api tag Behaviors added

    • info

      api tag behaviors removed

    • info

      added to the // response property allOf list for the response status

    • info

      removed the negative enum value from the // response property for the response status

    • info

      removed the neutral enum value from the // response property for the response status

    • info

      removed the positive enum value from the // response property for the response status

    • info

      endpoint added