Skip to content

AI webhook reference: model the metadata object on call log entries #617

Description

@hey-august

The conversation analytics guide (/docs/platform/ai/analytics) teaches readers to read eleven per-turn fields that the generated AI webhook reference does not document:

eos_to_push_latency      speaking_to_turn_detection    merge_count
stamps_us                turn_detection_to_final_event execution_latency
first_audio              text_spoken_total             function_latency
last_word_end            text_heard_approx

All eleven are real and were verified against the engine source. They arrive on a metadata object attached to each conversation log entry, where stamps_us is itself a nested object holding first_audio and last_word_end. Which fields are present depends on the entry: merge_count appears on merged caller turns, text_spoken_total and text_heard_approx on interrupted responses, and execution_latency / function_latency on tool entries.

AICallLogEntry in specs/signalwire-rest/webhooks/ai/models/common.tsp:127 models only role, content, timestamp, and tool_calls. It has no metadata member at all. Because the model is declared is Record<unknown>, the undocumented fields pass validation silently rather than failing the build, which is why the gap went unnoticed.

The practical effect: a reader following the analytics guide's link to look one of these up does not find it.

What to do

  • Add a metadata model to AICallLogEntry, covering these fields and noting which apply to caller turns, agent responses, and tool entries.
  • Run yarn build:specs and commit the regenerated fern/apis/signalwire-rest/openapi.yaml alongside the TypeSpec source.
  • Once it lands, the analytics guide's "documents the callback's core fields" can go back to promising the complete payload.

Precise engine source references are available on request rather than in a public issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions