Behaviors

List spans where a behavior fired

Changed on

Lists the spans in a time range where one behavior fired, newest first. Use the span IDs with Get a span for the full request and response.

post/api/pulses/behaviors/logs/

Request

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

Request body

behaviorstring required

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

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.

pageinteger

Page number, starting at 1.

page_sizeinteger

Spans per page. Values above 1000 are capped at 1000.

Example request

{
  "behavior": "refusal",
  "start_time": "2026-09-24T00:00:00Z",
  "end_time": "2026-10-01T00:00:00Z",
  "environment": "prod",
  "page": 1,
  "page_size": 50
}

Response

A page of spans.

behaviorstring required

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

pageinteger required
page_sizeinteger required

Example response

{
  "behavior": "refusal",
  "page": 1,
  "page_size": 50,
  "logs": [
    {
      "unique_id": "c3a1f8e2b9d04e6f8a7b5c4d3e2f1a0b",
      "model": "gpt-4o-mini",
      "status": "success",
      "environment": "prod",
      "timestamp": "2026-09-30T14:22:05.381204"
    }
  ]
}

Changes

    • breaking

      request body became required

    • info

      api operation id behaviors_listBehaviorSpans removed and replaced with listBehaviorSpans

    • info

      api tag Behaviors added

    • info

      api tag behaviors removed

    • info

      endpoint added