Skip to main content

Content Correlation

This guide explains how to use external_reference to map generated commentaries back to your content (e.g., bet lines, articles, game events).

The Problem

When you create a topic through the API, you receive a topic_id. But how do you know which of your content items this commentary belongs to when it’s ready?

The Solution: external_reference

The external_reference field allows you to pass your own content identifier when creating topics. This ID is:
  • Stored with every share
  • Returned in all API responses
  • Included in webhook payloads

Creating Topics with external_reference

Validation Rules

Querying by external_reference

Retrieve all commentaries for a given reference:
Response:

Idempotency

If you create a topic with the same (external_reference, persona_id) combination, we return the existing share instead of creating a duplicate:
This is useful for:
  • Retry logic after network failures
  • Preventing duplicate commentary requests
  • Safely re-running batch jobs

1:N Correlation Model

One external_reference can have multiple commentaries (one per persona). This supports the common use case of getting multiple analysts’ takes on the same bet line.

Using with Webhooks

Webhooks include external_reference in every payload, making it easy to map callbacks to your content:

metadata Field

Use metadata to store additional context that’s returned with all responses:
The metadata field:
  • Accepts any valid JSON object
  • Has no size limit (but keep it reasonable)
  • Is returned in all responses and webhooks
  • Is stored with each share

Complete Integration Flow

Best Practices

  1. Use meaningful IDs: Make references human-readable for debugging
  2. Include metadata: Store context you’ll need when receiving webhooks
  3. Handle duplicates: Check for duplicate status in responses
  4. Query by reference: Use the by-reference endpoint rather than storing topic_ids