DocsIntegrations

Integrations

Segment

2 min readReviewed July 2026

The Segment integration forwards Segment payloads into a GraphJSON collection named segment. It is useful when Segment already receives your product events and you want to analyze the same stream in GraphJSON.

Set up GraphJSON#

  1. Open Integrations.
  2. Choose Segment.
  3. Select Create it now if the segment collection does not exist.
  4. Copy the API key shown by the setup page.

GraphJSON creates the collection before you configure the destination.

Security: Treat the API key as a secret. Store it only in Segment’s protected destination settings, not in event properties or client-side analytics code.

Configure Segment#

Configure a webhook-style destination that sends JSON events to:

https://api.graphjson.com/api/integrations/segment

The GraphJSON receiver reads the API key as the Basic Authentication username. Follow the setup values shown in the GraphJSON dashboard if they differ, because Segment’s destination interface can change.

Segment’s current Extensible Webhooks destination can send real-time event payloads to custom HTTP endpoints. See Segment’s Extensible Webhooks catalog entry for provider-side details.

Verify the connection#

Send a test track event from a Segment source, then open the GraphJSON segment collection and select Samples.

Confirm:

  • the event timestamp matches the source payload
  • the Segment event name is present
  • identity fields such as userId or anonymousId are present
  • nested properties appear as flattened dot-separated keys

If the event is missing, check Segment’s delivery log and the HTTP status returned by the destination before changing GraphJSON filters.

Query Segment events#

Start by inspecting the stored shape:

SELECT
  timestamp,
  json
FROM segment
ORDER BY timestamp DESC
LIMIT 20

Then extract fields using the exact names shown in Samples. Segment schemas differ by source and destination configuration, so avoid assuming a property path before you inspect a real event.

Control schema drift#

Segment payloads can include context, integrations, traits, and large property sets. Create a short data contract for the fields your GraphJSON metrics depend on:

event
userId or anonymousId
properties.account_id
properties.plan
properties.amount

Keep those types consistent at the Segment source. Provider forwarding cannot repair inconsistent application instrumentation.

Disconnect#

Remove or disable the destination in Segment first, then delete the GraphJSON integration or segment collection if you no longer need the stored events.

Important: Deleting the collection removes its events and cannot be undone. Export anything you must retain first.

Need a hand?

Tell us what you’re building and we’ll point you in the right direction.

Contact support