Skip to content

Get Org Snippet

GET
/snippet

Get the tracking snippet for the authenticated organization.

Returns the write key and pre-built snippets without requiring a connected repository. Pass stream_id to choose the stream; otherwise the org’s main stream is used (its only stream, or the one whose domain matches the org’s website). If that is ambiguous the first stream is used as before and the response sets action_required with available_streams to pick from.

Authorizations

Parameters

Query Parameters

stream_id
Any of:
string

Tracking stream to use (from GET /streams). When omitted, the organization’s main stream is used: its only stream, or the one matching its website domain.

Header Parameters

X-Target-Org-Id
Any of:
string

Responses

200

Successful Response

object
data
required
object
action_required

True when the organization has several streams and none could be identified as its main website. The write key is the first stream’s (unchanged legacy default); pick the right one from available_streams and call again with stream_id.

boolean
available_streams

The organization’s streams to choose from. Filled only when action_required is true.

Array<object>
object
domains

Domains associated with this stream

Array<string>
domains_restricted

Whether the stream lists allowed domains. False means its public write key is accepted from any website (see warning).

boolean
id
required

Stream ID used to select this stream

string
is_default

True for the stream GET /snippet uses when no stream_id is given: the only stream, or the one whose domain matches the organization’s website. False on every stream when that choice is ambiguous; pass stream_id explicitly then.

boolean
name
required

User-friendly stream name (e.g. ‘graph8.com’, ‘heyreach-graph8’)

string
repo_id
Any of:
string
warning
Any of:
string
write_key
Any of:
string
config

Full configuration object for gtm/config.json

object
key
additional properties
any
domains
Array<string>
react_snippet
required

Ready-to-use React component import for @graph8/nextjs

string
script_tag
required

Vanilla JS script tag for non-React apps

string
stream_id
Any of:
string
stream_name
Any of:
string
stream_selection
Any of:
string
tracking_host
string
default: https://t.graph8.com
warning
Any of:
string
write_key
required
string
pagination
Any of:
object
has_next
required

Whether there are more pages

boolean
limit
required

Items per page

integer
next_cursor
Any of:
string
notes
Any of:
Array<string>
page
required

Current page number (1-indexed)

integer
total
required

Total number of items

integer
total_available
Any of:
integer
total_is_lower_bound
Any of:
boolean

422

Validation Error

object
detail
Array<object>
object
loc
required
Array
msg
required
string
type
required
string