All docs
Start here
API basics
Agent setups
Resources
- Contacts
- Companies
- Lists
- Deals
- Tasks
- Notes
- Fields
- Quotes
- Stage Checklist Pipelines
- Sequences
- Sequence Lifecycle
- Inbox
- Meetings
- Appointments Management
- Voice & Dialer
- Skills (LLM + API)
- Workflows
- GTM Campaigns
- GTM Context
- GTM Knowledge Base
- Launch Helpers
- Landing Pages
- Intent & Signals
- Search
- Enrichment
- Assert / Upsert
- Agency Keys & Cross-Org Targeting
- CRM Syncs
- Audience Syncs
- Destinations
- Snippet
- Functions
Data pipeline
Webhooks
What's new
Snippet
Retrieve the org-level tracking snippet and embeddable lead-capture form configuration
The snippet endpoints return the org-level tracking code and embeddable lead-capture form that you place on your website. They use the organisation’s first stream, so no stream ID is required.
Get Tracking Snippet
GET /snippet
Returns the same payload shape as GET /repos/{repo_id}/snippet but automatically resolves to the organisation’s first stream. Use this when you do not need to target a specific stream.
Example
cURL
curl "https://be.graph8.com/api/v1/snippet" \
-H "Authorization: Bearer $API_KEY" Response
{
"data": {
"write_key": "wk_abc123...",
"tracking_host": "https://t.graph8.com",
"domains": ["example.com"],
"react_snippet": "import { G8Analytics } from '@graph8/nextjs'\n...",
"script_tag": "<script src=\"https://t.graph8.com/p.js\" data-write-key=\"...\" data-tracking-host=\"...\" defer></script>",
"config": {
"write_key": "wk_abc123...",
"tracking_host": "https://t.graph8.com",
"project_id": "proj_xyz",
"domains": ["example.com"]
}
}
}
| Field | Type | Description |
|---|---|---|
write_key | string | Public write key used to authenticate tracking events |
tracking_host | string | Base URL that the snippet sends events to |
domains | array of strings | Domains associated with this stream |
react_snippet | string | Ready-to-use React/Next.js import snippet |
script_tag | string | HTML script tag for non-React sites |
config | object | Machine-readable config object for custom integrations |
config.write_key | string | Write key (same as top-level write_key) |
config.tracking_host | string | Tracking host (same as top-level tracking_host) |
config.project_id | string | Internal project identifier |
config.domains | array of strings | Domains list (same as top-level domains) |
Get Form Snippet
GET /snippet/form
Returns the embeddable HTML lead-capture form along with its configuration — write key, tracking host, field list, and event name — ready to drop into any page.
Example
cURL
curl "https://be.graph8.com/api/v1/snippet/form" \
-H "Authorization: Bearer $API_KEY" Response
{
"data": {
"html": "<form id=\"g8-lead-form\">...</form><script>...</script>",
"write_key": "...",
"tracking_host": "https://t.graph8.com",
"fields": ["name", "email", "company"],
"event_name": "form_submitted",
"notes": "..."
}
}
| Field | Type | Description |
|---|---|---|
html | string | Ready-to-embed HTML string containing the form markup and inline script |
write_key | string | Public write key used by the snippet to authenticate tracking events |
tracking_host | string | Base URL that the snippet sends events to |
fields | array of strings | Ordered list of field names rendered in the form |
event_name | string | Event name fired when the form is submitted |
notes | string | Optional implementation notes or instructions |