Skip to main content

Embedding Annotations in Your UI

Annotations map compliance issues to specific locations in content. This guide shows how to use them to highlight issues natively in your application.

Annotation Types

Text Span

For scripts, ad copy, captions, descriptions.
How to use:
  • start and end are character offsets (0-indexed) into the original content.text
  • Highlight matchedText in the editor with the appropriate severity color
  • Show message on hover/click
  • Show suggestion as an inline fix option

Timeline

For video content with timestamps.
How to use:
  • Mark the flagged time range on the video timeline
  • track indicates which track (video, audio, subtitle)
  • Show a warning marker at startMs on the timeline scrubber

Image Region

For visual content with detected elements.
How to use:
  • Draw a highlight rectangle at the bounding box coordinates
  • boundingBox uses pixel coordinates relative to the original image dimensions

Global

Applies to the entire content, not a specific location.
How to use:
  • Show as a banner or top-level warning
  • Not tied to a specific content location

Severity Colors (Suggested)

Grouping Annotations

For a clean UI, group annotations by:
  1. By agent — “Advertising Law: 2 issues, Platform Policy: 1 issue”
  2. By severity — Show critical/high first
  3. By location — Sort text-span by start offset, timeline by startMs