@graph8/sdk 0.277.0 → 0.293.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +601 -11
- package/dist/index.d.ts +601 -11
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -2
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +593 -8
- package/dist/react.d.ts +593 -8
- package/dist/react.js +3 -1
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +3 -1
- package/dist/react.mjs.map +1 -1
- package/dist/types/version.d.ts +2 -2
- package/docs/agents.md +4 -4
- package/docs/api/README.md +3 -3
- package/docs/api/analytics.d.ts +26 -1
- package/docs/api/analytics.md +2 -0
- package/docs/api/assertUpsert.d.ts +2 -0
- package/docs/api/assertUpsert.md +1 -0
- package/docs/api/audienceSyncs.d.ts +8 -0
- package/docs/api/audienceSyncs.md +16 -0
- package/docs/api/by-path.md +2 -0
- package/docs/api/companies.d.ts +7 -1
- package/docs/api/companies.md +4 -1
- package/docs/api/contacts.d.ts +7 -1
- package/docs/api/contacts.md +4 -1
- package/docs/api/enrichment.d.ts +76 -2
- package/docs/api/enrichment.md +76 -1
- package/docs/api/fields.d.ts +24 -3
- package/docs/api/fields.md +15 -4
- package/docs/api/install.d.ts +26 -0
- package/docs/api/install.md +18 -0
- package/docs/api/intent.d.ts +26 -1
- package/docs/api/intent.md +23 -0
- package/docs/api/lists.d.ts +9 -0
- package/docs/api/lists.md +17 -2
- package/docs/api/marketingIntelligence.d.ts +40 -0
- package/docs/api/marketingIntelligence.md +20 -0
- package/docs/api/snippet.d.ts +66 -2
- package/docs/api/snippet.md +73 -4
- package/docs/api/suppressions.d.ts +4 -0
- package/docs/api/suppressions.md +2 -0
- package/docs/api/visitors.d.ts +26 -0
- package/docs/api/visitors.md +12 -0
- package/docs/api/webAnalytics.d.ts +288 -0
- package/docs/api/webAnalytics.md +144 -0
- package/docs/api/workflows.md +6 -0
- package/package.json +1 -1
|
@@ -69,6 +69,8 @@ Returns per campaign:
|
|
|
69
69
|
| `query.limit` | `integer` | no | Number of campaigns to return default `50` |
|
|
70
70
|
| `query.sort_by` | `"visitors" \| "meetings_booked" \| "reply_rate" \| "engaged_pct"` | no | Sort by this metric (descending) default `"visitors"` |
|
|
71
71
|
| `query.write_key` | `string \| null` | no | Comma-separated public keys to filter by |
|
|
72
|
+
| `query.include_bots` | `boolean` | no | Count bot and crawler traffic too. Off by default: page views from self-identified crawlers, headless browsers, HTTP libraries and datacenter/cloud networks are excluded. Set true for the raw, unfiltered counts these reports returned before the filter existed. default `false` |
|
|
73
|
+
| `query.include_internal` | `boolean` | no | Count internal traffic too. Off by default: page views on the graph8 app (app.graph8.com) and local development hosts, and browsers identified as your own team members (member emails and your company email domains), are excluded. default `false` |
|
|
72
74
|
| `headers.X-Org-Id` | `string \| null` | no | |
|
|
73
75
|
|
|
74
76
|
**Returns** `MarketingResponse`: the envelope `{ data: Record<string, unknown> | Array<unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
@@ -117,6 +119,8 @@ Only includes pages with at least 10 unique visitors.
|
|
|
117
119
|
| `query.limit` | `integer` | no | Number of pages to return default `50` |
|
|
118
120
|
| `query.sort_by` | `"views" \| "meetings_booked" \| "reply_rate" \| "unique_visitors"` | no | Sort by this metric (descending) default `"views"` |
|
|
119
121
|
| `query.write_key` | `string \| null` | no | Comma-separated public keys to filter by |
|
|
122
|
+
| `query.include_bots` | `boolean` | no | Count bot and crawler traffic too. Off by default: page views from self-identified crawlers, headless browsers, HTTP libraries and datacenter/cloud networks are excluded. Set true for the raw, unfiltered counts these reports returned before the filter existed. default `false` |
|
|
123
|
+
| `query.include_internal` | `boolean` | no | Count internal traffic too. Off by default: page views on the graph8 app (app.graph8.com) and local development hosts, and browsers identified as your own team members (member emails and your company email domains), are excluded. default `false` |
|
|
120
124
|
| `headers.X-Org-Id` | `string \| null` | no | |
|
|
121
125
|
|
|
122
126
|
**Returns** `MarketingResponse`: the envelope `{ data: Record<string, unknown> | Array<unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
@@ -154,6 +158,8 @@ Shows which entry pages drive best business outcomes.
|
|
|
154
158
|
| `query.days` | `integer` | no | Number of days to analyze default `30` |
|
|
155
159
|
| `query.limit` | `integer` | no | Number of pages to return default `50` |
|
|
156
160
|
| `query.write_key` | `string \| null` | no | Comma-separated public keys to filter by |
|
|
161
|
+
| `query.include_bots` | `boolean` | no | Count bot and crawler traffic too. Off by default: page views from self-identified crawlers, headless browsers, HTTP libraries and datacenter/cloud networks are excluded. Set true for the raw, unfiltered counts these reports returned before the filter existed. default `false` |
|
|
162
|
+
| `query.include_internal` | `boolean` | no | Count internal traffic too. Off by default: page views on the graph8 app (app.graph8.com) and local development hosts, and browsers identified as your own team members (member emails and your company email domains), are excluded. default `false` |
|
|
157
163
|
| `headers.X-Org-Id` | `string \| null` | no | |
|
|
158
164
|
|
|
159
165
|
**Returns** `MarketingResponse`: the envelope `{ data: Record<string, unknown> | Array<unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
@@ -197,6 +203,8 @@ Returns:
|
|
|
197
203
|
|---|---|---|---|
|
|
198
204
|
| `query.days` | `integer` | no | Number of days to analyze default `30` |
|
|
199
205
|
| `query.write_key` | `string \| null` | no | Comma-separated public keys to filter by |
|
|
206
|
+
| `query.include_bots` | `boolean` | no | Count bot and crawler traffic too. Off by default: page views from self-identified crawlers, headless browsers, HTTP libraries and datacenter/cloud networks are excluded. Set true for the raw, unfiltered counts these reports returned before the filter existed. default `false` |
|
|
207
|
+
| `query.include_internal` | `boolean` | no | Count internal traffic too. Off by default: page views on the graph8 app (app.graph8.com) and local development hosts, and browsers identified as your own team members (member emails and your company email domains), are excluded. default `false` |
|
|
200
208
|
| `headers.X-Org-Id` | `string \| null` | no | |
|
|
201
209
|
|
|
202
210
|
**Returns** `MarketingResponse`: the envelope `{ data: Record<string, unknown> | Array<unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
@@ -236,6 +244,8 @@ Campaign -> Visitors -> Identified -> Engaged -> Outbound -> Replies -> Meetings
|
|
|
236
244
|
| `query.days` | `integer` | no | Number of days to analyze default `30` |
|
|
237
245
|
| `query.limit` | `integer` | no | Number of campaigns to return default `50` |
|
|
238
246
|
| `query.write_key` | `string \| null` | no | Comma-separated public keys to filter by |
|
|
247
|
+
| `query.include_bots` | `boolean` | no | Count bot and crawler traffic too. Off by default: page views from self-identified crawlers, headless browsers, HTTP libraries and datacenter/cloud networks are excluded. Set true for the raw, unfiltered counts these reports returned before the filter existed. default `false` |
|
|
248
|
+
| `query.include_internal` | `boolean` | no | Count internal traffic too. Off by default: page views on the graph8 app (app.graph8.com) and local development hosts, and browsers identified as your own team members (member emails and your company email domains), are excluded. default `false` |
|
|
239
249
|
| `headers.X-Org-Id` | `string \| null` | no | |
|
|
240
250
|
|
|
241
251
|
**Returns** `MarketingResponse`: the envelope `{ data: Record<string, unknown> | Array<unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
@@ -272,6 +282,8 @@ Channels: Direct, Paid Search, Paid Social, Organic Search, Organic Social, etc.
|
|
|
272
282
|
|---|---|---|---|
|
|
273
283
|
| `query.days` | `integer` | no | Number of days to analyze default `30` |
|
|
274
284
|
| `query.write_key` | `string \| null` | no | Comma-separated public keys to filter by |
|
|
285
|
+
| `query.include_bots` | `boolean` | no | Count bot and crawler traffic too. Off by default: page views from self-identified crawlers, headless browsers, HTTP libraries and datacenter/cloud networks are excluded. Set true for the raw, unfiltered counts these reports returned before the filter existed. default `false` |
|
|
286
|
+
| `query.include_internal` | `boolean` | no | Count internal traffic too. Off by default: page views on the graph8 app (app.graph8.com) and local development hosts, and browsers identified as your own team members (member emails and your company email domains), are excluded. default `false` |
|
|
275
287
|
| `headers.X-Org-Id` | `string \| null` | no | |
|
|
276
288
|
|
|
277
289
|
**Returns** `MarketingResponse`: the envelope `{ data: Record<string, unknown> | Array<unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
@@ -309,6 +321,8 @@ Only includes pages with at least 10 visitors.
|
|
|
309
321
|
| `query.days` | `integer` | no | Number of days to analyze default `30` |
|
|
310
322
|
| `query.limit` | `integer` | no | Number of pages to return default `50` |
|
|
311
323
|
| `query.write_key` | `string \| null` | no | Comma-separated public keys to filter by |
|
|
324
|
+
| `query.include_bots` | `boolean` | no | Count bot and crawler traffic too. Off by default: page views from self-identified crawlers, headless browsers, HTTP libraries and datacenter/cloud networks are excluded. Set true for the raw, unfiltered counts these reports returned before the filter existed. default `false` |
|
|
325
|
+
| `query.include_internal` | `boolean` | no | Count internal traffic too. Off by default: page views on the graph8 app (app.graph8.com) and local development hosts, and browsers identified as your own team members (member emails and your company email domains), are excluded. default `false` |
|
|
312
326
|
| `headers.X-Org-Id` | `string \| null` | no | |
|
|
313
327
|
|
|
314
328
|
**Returns** `MarketingResponse`: the envelope `{ data: Record<string, unknown> | Array<unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
@@ -356,6 +370,8 @@ This is the key differentiator: connecting web behavior to outbound outcomes.
|
|
|
356
370
|
|---|---|---|---|
|
|
357
371
|
| `query.days` | `integer` | no | Number of days to analyze default `30` |
|
|
358
372
|
| `query.write_key` | `string \| null` | no | Comma-separated public keys to filter by |
|
|
373
|
+
| `query.include_bots` | `boolean` | no | Count bot and crawler traffic too. Off by default: page views from self-identified crawlers, headless browsers, HTTP libraries and datacenter/cloud networks are excluded. Set true for the raw, unfiltered counts these reports returned before the filter existed. default `false` |
|
|
374
|
+
| `query.include_internal` | `boolean` | no | Count internal traffic too. Off by default: page views on the graph8 app (app.graph8.com) and local development hosts, and browsers identified as your own team members (member emails and your company email domains), are excluded. default `false` |
|
|
359
375
|
| `headers.X-Org-Id` | `string \| null` | no | |
|
|
360
376
|
|
|
361
377
|
**Returns** `MarketingResponse`: the envelope `{ data: Record<string, unknown> | Array<unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
@@ -400,6 +416,8 @@ See the SITE FILTER SCOPE block in `queries/outbound_bridge.py`.
|
|
|
400
416
|
|---|---|---|---|
|
|
401
417
|
| `query.days` | `integer` | no | Number of days to analyze default `30` |
|
|
402
418
|
| `query.write_key` | `string \| null` | no | Comma-separated public keys to filter by |
|
|
419
|
+
| `query.include_bots` | `boolean` | no | Count bot and crawler traffic too. Off by default: page views from self-identified crawlers, headless browsers, HTTP libraries and datacenter/cloud networks are excluded. Set true for the raw, unfiltered counts these reports returned before the filter existed. default `false` |
|
|
420
|
+
| `query.include_internal` | `boolean` | no | Count internal traffic too. Off by default: page views on the graph8 app (app.graph8.com) and local development hosts, and browsers identified as your own team members (member emails and your company email domains), are excluded. default `false` |
|
|
403
421
|
| `headers.X-Org-Id` | `string \| null` | no | |
|
|
404
422
|
|
|
405
423
|
**Returns** `MarketingResponse`: the envelope `{ data: Record<string, unknown> | Array<unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
@@ -441,6 +459,8 @@ Use this to identify which web behaviors predict outbound success.
|
|
|
441
459
|
| `query.days` | `integer` | no | Number of days to analyze default `30` |
|
|
442
460
|
| `query.limit` | `integer` | no | Number of sources to return default `10` |
|
|
443
461
|
| `query.write_key` | `string \| null` | no | Comma-separated public keys to filter by |
|
|
462
|
+
| `query.include_bots` | `boolean` | no | Count bot and crawler traffic too. Off by default: page views from self-identified crawlers, headless browsers, HTTP libraries and datacenter/cloud networks are excluded. Set true for the raw, unfiltered counts these reports returned before the filter existed. default `false` |
|
|
463
|
+
| `query.include_internal` | `boolean` | no | Count internal traffic too. Off by default: page views on the graph8 app (app.graph8.com) and local development hosts, and browsers identified as your own team members (member emails and your company email domains), are excluded. default `false` |
|
|
444
464
|
| `headers.X-Org-Id` | `string \| null` | no | |
|
|
445
465
|
|
|
446
466
|
**Returns** `MarketingResponse`: the envelope `{ data: Record<string, unknown> | Array<unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
package/docs/api/snippet.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* Generated by sdk/js/scripts/generate-agent-docs.ts from developer-contract/openapi.json. Regenerated on every build. */
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Types for `g8.api.snippet` (Snippet):
|
|
4
|
+
* Types for `g8.api.snippet` (Snippet): 3 operations.
|
|
5
5
|
*
|
|
6
6
|
* For reading. In code, import from the package instead:
|
|
7
7
|
* import type { ApiInput, ApiOutput, G8Contract } from "@graph8/sdk";
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
export interface SnippetMembers {
|
|
16
16
|
getFormTemplate: "get_form_template_snippet_form_get";
|
|
17
17
|
getOrgSnippet: "get_org_snippet_snippet_get";
|
|
18
|
+
listOrgStreams: "list_org_streams_streams_get";
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
/** Input and output of every `g8.api.snippet` operation, keyed by operationId. */
|
|
@@ -26,6 +27,10 @@ export interface SnippetOperations {
|
|
|
26
27
|
*/
|
|
27
28
|
get_form_template_snippet_form_get: {
|
|
28
29
|
input: {
|
|
30
|
+
query?: {
|
|
31
|
+
/** Tracking stream whose write key the form uses (from GET /streams). Defaults as in GET /snippet. */
|
|
32
|
+
stream_id?: string | null;
|
|
33
|
+
};
|
|
29
34
|
headers?: {
|
|
30
35
|
"X-Target-Org-Id"?: string | null;
|
|
31
36
|
};
|
|
@@ -39,15 +44,38 @@ export interface SnippetOperations {
|
|
|
39
44
|
*/
|
|
40
45
|
get_org_snippet_snippet_get: {
|
|
41
46
|
input: {
|
|
47
|
+
query?: {
|
|
48
|
+
/** 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. */
|
|
49
|
+
stream_id?: string | null;
|
|
50
|
+
};
|
|
42
51
|
headers?: {
|
|
43
52
|
"X-Target-Org-Id"?: string | null;
|
|
44
53
|
};
|
|
45
54
|
};
|
|
46
55
|
output: ApiResponse_SnippetResponse_;
|
|
47
56
|
};
|
|
57
|
+
/**
|
|
58
|
+
* GET /streams
|
|
59
|
+
* List Org Streams
|
|
60
|
+
* tier: read · scope: integrations:read
|
|
61
|
+
*/
|
|
62
|
+
list_org_streams_streams_get: {
|
|
63
|
+
input: {
|
|
64
|
+
query?: {
|
|
65
|
+
/** Page number (1-indexed). Omit page and limit to get every stream. */
|
|
66
|
+
page?: number | null;
|
|
67
|
+
/** Streams per page (max 200). Omit page and limit to get every stream. */
|
|
68
|
+
limit?: number | null;
|
|
69
|
+
};
|
|
70
|
+
headers?: {
|
|
71
|
+
"X-Target-Org-Id"?: string | null;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
output: ApiResponse_list_StreamInfoResponse__;
|
|
75
|
+
};
|
|
48
76
|
}
|
|
49
77
|
|
|
50
|
-
//
|
|
78
|
+
// 6 schemas referenced above (the same as G8Contract.<Name>).
|
|
51
79
|
|
|
52
80
|
export interface ApiResponse_SnippetResponse_ {
|
|
53
81
|
data: SnippetResponse;
|
|
@@ -59,6 +87,11 @@ export interface ApiResponse_dict_ {
|
|
|
59
87
|
pagination?: PaginationMeta | null;
|
|
60
88
|
}
|
|
61
89
|
|
|
90
|
+
export interface ApiResponse_list_StreamInfoResponse__ {
|
|
91
|
+
data: Array<StreamInfoResponse>;
|
|
92
|
+
pagination?: PaginationMeta | null;
|
|
93
|
+
}
|
|
94
|
+
|
|
62
95
|
export interface PaginationMeta {
|
|
63
96
|
/** Whether there are more pages */
|
|
64
97
|
has_next: boolean;
|
|
@@ -79,6 +112,10 @@ export interface PaginationMeta {
|
|
|
79
112
|
}
|
|
80
113
|
|
|
81
114
|
export interface SnippetResponse {
|
|
115
|
+
/** 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. */
|
|
116
|
+
action_required?: boolean;
|
|
117
|
+
/** The organization's streams to choose from. Filled only when action_required is true. */
|
|
118
|
+
available_streams?: Array<StreamInfoResponse>;
|
|
82
119
|
/** Full configuration object for gtm/config.json */
|
|
83
120
|
config?: Record<string, unknown>;
|
|
84
121
|
domains?: Array<string>;
|
|
@@ -86,6 +123,33 @@ export interface SnippetResponse {
|
|
|
86
123
|
react_snippet: string;
|
|
87
124
|
/** Vanilla JS script tag for non-React apps */
|
|
88
125
|
script_tag: string;
|
|
126
|
+
/** ID of the tracking stream the write key belongs to, when known. */
|
|
127
|
+
stream_id?: string | null;
|
|
128
|
+
/** User-friendly name of that stream, when known. */
|
|
129
|
+
stream_name?: string | null;
|
|
130
|
+
/** How the stream was chosen: 'explicit' (stream_id given), 'repo_write_key' (the repository's stored key), 'only_stream', 'domain_match' (matches the organization's website), or 'first_stream_fallback' (ambiguous; see action_required). */
|
|
131
|
+
stream_selection?: string | null;
|
|
89
132
|
tracking_host?: string;
|
|
133
|
+
/** Human-readable explanation when action_required is true, or a stream setup advisory. */
|
|
134
|
+
warning?: string | null;
|
|
90
135
|
write_key: string;
|
|
91
136
|
}
|
|
137
|
+
|
|
138
|
+
export interface StreamInfoResponse {
|
|
139
|
+
/** Domains associated with this stream */
|
|
140
|
+
domains?: Array<string>;
|
|
141
|
+
/** Whether the stream lists allowed domains. False means its public write key is accepted from any website (see warning). */
|
|
142
|
+
domains_restricted?: boolean;
|
|
143
|
+
/** Stream ID used to select this stream */
|
|
144
|
+
id: string;
|
|
145
|
+
/** 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. */
|
|
146
|
+
is_default?: boolean;
|
|
147
|
+
/** User-friendly stream name (e.g. 'graph8.com', 'heyreach-graph8') */
|
|
148
|
+
name: string;
|
|
149
|
+
/** Connected repository whose stored write key belongs to this stream. Null when no connected repository uses it: streams are organization-level, not owned by a repo. */
|
|
150
|
+
repo_id?: string | null;
|
|
151
|
+
/** Read-only advisory about this stream's setup, e.g. no allowed domains. Nothing is enforced. */
|
|
152
|
+
warning?: string | null;
|
|
153
|
+
/** Public write key for this stream */
|
|
154
|
+
write_key?: string | null;
|
|
155
|
+
}
|
package/docs/api/snippet.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# `g8.api.snippet`: Snippet
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
3 operations (3 read).
|
|
6
6
|
|
|
7
7
|
1 of these also have a hand-written method (`g8.snippet`), marked **★** below. Prefer the hand-written method when one exists: it unwraps the `data` envelope and takes friendlier arguments. See [../sdk-clients.md](../sdk-clients.md).
|
|
8
8
|
|
|
@@ -24,6 +24,7 @@ Exact TypeScript types for every operation on this page, and every schema they u
|
|
|
24
24
|
|---|---|---|---|---|
|
|
25
25
|
| [`getFormTemplate`](#op-getformtemplate) | `GET /api/v1/snippet/form` | read | `integrations:read` | Get Form Template |
|
|
26
26
|
| [`getOrgSnippet`](#op-getorgsnippet) ★ | `GET /api/v1/snippet` | read | `integrations:read` | Get Org Snippet |
|
|
27
|
+
| [`listOrgStreams`](#op-listorgstreams) | `GET /api/v1/streams` | read | `integrations:read` | List Org Streams |
|
|
27
28
|
|
|
28
29
|
---
|
|
29
30
|
|
|
@@ -51,7 +52,11 @@ snippet (see ``GET /snippet``). The form POSTs to your tracking host by
|
|
|
51
52
|
default, but you can override ``action`` to route submissions to your own
|
|
52
53
|
backend.
|
|
53
54
|
|
|
54
|
-
**Input
|
|
55
|
+
**Input**
|
|
56
|
+
|
|
57
|
+
| Field | Type | Required | Description |
|
|
58
|
+
|---|---|---|---|
|
|
59
|
+
| `query.stream_id` | `string \| null` | no | Tracking stream whose write key the form uses (from GET /streams). Defaults as in GET /snippet. |
|
|
55
60
|
|
|
56
61
|
**Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
57
62
|
|
|
@@ -80,9 +85,16 @@ const result = await g8.api.snippet.getFormTemplate();
|
|
|
80
85
|
Get the tracking snippet for the authenticated organization.
|
|
81
86
|
|
|
82
87
|
Returns the write key and pre-built snippets without requiring a
|
|
83
|
-
connected repository.
|
|
88
|
+
connected repository. Pass `stream_id` to choose the stream; otherwise the
|
|
89
|
+
org's main stream is used (its only stream, or the one whose domain matches
|
|
90
|
+
the org's website). If that is ambiguous the first stream is used as before
|
|
91
|
+
and the response sets `action_required` with `available_streams` to pick from.
|
|
92
|
+
|
|
93
|
+
**Input**
|
|
84
94
|
|
|
85
|
-
|
|
95
|
+
| Field | Type | Required | Description |
|
|
96
|
+
|---|---|---|---|
|
|
97
|
+
| `query.stream_id` | `string \| null` | no | 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. |
|
|
86
98
|
|
|
87
99
|
**Returns** `ApiResponse_SnippetResponse_`: the envelope `{ data: SnippetResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
88
100
|
|
|
@@ -95,12 +107,69 @@ Other envelope fields: `pagination` (PaginationMeta).
|
|
|
95
107
|
| `react_snippet` | `string` | yes | Ready-to-use React component import for @graph8/nextjs |
|
|
96
108
|
| `script_tag` | `string` | yes | Vanilla JS script tag for non-React apps |
|
|
97
109
|
| `write_key` | `string` | yes | |
|
|
110
|
+
| `action_required` | `boolean` | no | 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. default `false` |
|
|
111
|
+
| `available_streams` | `Array<StreamInfoResponse>` | no | The organization's streams to choose from. Filled only when action_required is true. |
|
|
98
112
|
| `config` | `Record<string, unknown>` | no | Full configuration object for gtm/config.json |
|
|
99
113
|
| `domains` | `Array<string>` | no | |
|
|
114
|
+
| `stream_id` | `string \| null` | no | ID of the tracking stream the write key belongs to, when known. |
|
|
115
|
+
| `stream_name` | `string \| null` | no | User-friendly name of that stream, when known. |
|
|
116
|
+
| `stream_selection` | `string \| null` | no | How the stream was chosen: 'explicit' (stream_id given), 'repo_write_key' (the repository's stored key), 'only_stream', 'domain_match' (matches the organization's website), or 'first_stream_fallback' (ambiguous; see action_required). |
|
|
100
117
|
| `tracking_host` | `string` | no | default `"https://t.graph8.com"` |
|
|
118
|
+
| `warning` | `string \| null` | no | Human-readable explanation when action_required is true, or a stream setup advisory. |
|
|
101
119
|
|
|
102
120
|
**Example**
|
|
103
121
|
|
|
104
122
|
```ts
|
|
105
123
|
const result = await g8.api.snippet.getOrgSnippet();
|
|
106
124
|
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
<a id="op-listorgstreams"></a>
|
|
129
|
+
|
|
130
|
+
### `g8.api.snippet.listOrgStreams(input?)`
|
|
131
|
+
|
|
132
|
+
**List Org Streams**
|
|
133
|
+
|
|
134
|
+
- HTTP: `GET /api/v1/streams`
|
|
135
|
+
- operationId: `list_org_streams_streams_get` (also callable as `g8.api.call("list_org_streams_streams_get", input)`)
|
|
136
|
+
- Tier: `read`: reads data; safe to call and to retry
|
|
137
|
+
- API-key scope: `integrations:read`
|
|
138
|
+
|
|
139
|
+
List the organization's tracking streams (websites) without a repository.
|
|
140
|
+
|
|
141
|
+
Streams belong to the organization, not to a connected repository, so this
|
|
142
|
+
works even when the org has connected no repository. Each stream carries its
|
|
143
|
+
write key, its domains, `is_default` (the stream `GET /snippet` uses when no
|
|
144
|
+
`stream_id` is given), `repo_id` (the connected repository already using it,
|
|
145
|
+
or null), and a read-only `warning` when it has no allowed domains.
|
|
146
|
+
|
|
147
|
+
**Input**
|
|
148
|
+
|
|
149
|
+
| Field | Type | Required | Description |
|
|
150
|
+
|---|---|---|---|
|
|
151
|
+
| `query.page` | `integer \| null` | no | Page number (1-indexed). Omit page and limit to get every stream. |
|
|
152
|
+
| `query.limit` | `integer \| null` | no | Streams per page (max 200). Omit page and limit to get every stream. |
|
|
153
|
+
|
|
154
|
+
**Returns** `ApiResponse_list_StreamInfoResponse__`: the envelope `{ data: Array<StreamInfoResponse>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
155
|
+
|
|
156
|
+
Other envelope fields: `pagination` (PaginationMeta).
|
|
157
|
+
|
|
158
|
+
`StreamInfoResponse` fields:
|
|
159
|
+
|
|
160
|
+
| Field | Type | Required | Description |
|
|
161
|
+
|---|---|---|---|
|
|
162
|
+
| `id` | `string` | yes | Stream ID used to select this stream |
|
|
163
|
+
| `name` | `string` | yes | User-friendly stream name (e.g. 'graph8.com', 'heyreach-graph8') |
|
|
164
|
+
| `domains` | `Array<string>` | no | Domains associated with this stream |
|
|
165
|
+
| `domains_restricted` | `boolean` | no | Whether the stream lists allowed domains. False means its public write key is accepted from any website (see warning). default `false` |
|
|
166
|
+
| `is_default` | `boolean` | no | 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. default `false` |
|
|
167
|
+
| `repo_id` | `string \| null` | no | Connected repository whose stored write key belongs to this stream. Null when no connected repository uses it: streams are organization-level, not owned by a repo. |
|
|
168
|
+
| `warning` | `string \| null` | no | Read-only advisory about this stream's setup, e.g. no allowed domains. Nothing is enforced. |
|
|
169
|
+
| `write_key` | `string \| null` | no | Public write key for this stream |
|
|
170
|
+
|
|
171
|
+
**Example**
|
|
172
|
+
|
|
173
|
+
```ts
|
|
174
|
+
const result = await g8.api.snippet.listOrgStreams();
|
|
175
|
+
```
|
|
@@ -160,6 +160,8 @@ export interface ApiResponse_list_SuppressionRecord__ {
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
export interface BulkReinstateResponse {
|
|
163
|
+
/** Requested contact ids that match no contact (for example a mistyped id). They also appear in `skipped`. */
|
|
164
|
+
not_found?: Array<number>;
|
|
163
165
|
reinstated?: Array<number>;
|
|
164
166
|
skipped?: Array<ReinstateSkip>;
|
|
165
167
|
total_requested: number;
|
|
@@ -167,6 +169,8 @@ export interface BulkReinstateResponse {
|
|
|
167
169
|
|
|
168
170
|
export interface BulkSuppressResponse {
|
|
169
171
|
channel: string;
|
|
172
|
+
/** Requested contact ids that match no contact; nothing was written for them. */
|
|
173
|
+
not_found?: Array<number>;
|
|
170
174
|
suppressed: number;
|
|
171
175
|
total_requested: number;
|
|
172
176
|
}
|
package/docs/api/suppressions.md
CHANGED
|
@@ -73,6 +73,7 @@ Other envelope fields: `pagination` (PaginationMeta).
|
|
|
73
73
|
| `channel` | `string` | yes | |
|
|
74
74
|
| `suppressed` | `integer` | yes | |
|
|
75
75
|
| `total_requested` | `integer` | yes | |
|
|
76
|
+
| `not_found` | `Array<integer>` | no | Requested contact ids that match no contact; nothing was written for them. |
|
|
76
77
|
|
|
77
78
|
**Example**
|
|
78
79
|
|
|
@@ -219,6 +220,7 @@ Other envelope fields: `pagination` (PaginationMeta).
|
|
|
219
220
|
| Field | Type | Required | Description |
|
|
220
221
|
|---|---|---|---|
|
|
221
222
|
| `total_requested` | `integer` | yes | |
|
|
223
|
+
| `not_found` | `Array<integer>` | no | Requested contact ids that match no contact (for example a mistyped id). They also appear in `skipped`. |
|
|
222
224
|
| `reinstated` | `Array<integer>` | no | |
|
|
223
225
|
| `skipped` | `Array<ReinstateSkip>` | no | |
|
|
224
226
|
|
package/docs/api/visitors.d.ts
CHANGED
|
@@ -122,6 +122,10 @@ export interface VisitorsOperations {
|
|
|
122
122
|
/** Comma-separated public keys, or "all". Omit for every stream. */
|
|
123
123
|
stream_id?: string | null;
|
|
124
124
|
limit?: number;
|
|
125
|
+
/** Also count bot and crawler traffic. Off by default: events from self-identified crawlers, headless browsers, HTTP libraries and datacenter/cloud networks are excluded. */
|
|
126
|
+
include_bots?: boolean;
|
|
127
|
+
/** Also count internal traffic. Off by default: the graph8 app (app.graph8.com), local development hosts and your own team members (member emails and company email domains) are excluded. */
|
|
128
|
+
include_internal?: boolean;
|
|
125
129
|
};
|
|
126
130
|
headers?: {
|
|
127
131
|
"X-Target-Org-Id"?: string | null;
|
|
@@ -189,6 +193,10 @@ export interface VisitorsOperations {
|
|
|
189
193
|
/** Comma-separated public keys, or "all". Omit for every stream. */
|
|
190
194
|
stream_id?: string | null;
|
|
191
195
|
limit?: number;
|
|
196
|
+
/** Also count bot and crawler traffic. Off by default: events from self-identified crawlers, headless browsers, HTTP libraries and datacenter/cloud networks are excluded. */
|
|
197
|
+
include_bots?: boolean;
|
|
198
|
+
/** Also count internal traffic. Off by default: the graph8 app (app.graph8.com), local development hosts and your own team members (member emails and company email domains) are excluded. */
|
|
199
|
+
include_internal?: boolean;
|
|
192
200
|
};
|
|
193
201
|
headers?: {
|
|
194
202
|
"X-Target-Org-Id"?: string | null;
|
|
@@ -247,6 +255,12 @@ export interface VisitorsOperations {
|
|
|
247
255
|
/** What to count. */
|
|
248
256
|
resource: "contacts" | "companies";
|
|
249
257
|
};
|
|
258
|
+
query?: {
|
|
259
|
+
/** Also count bot and crawler traffic. Off by default: events from self-identified crawlers, headless browsers, HTTP libraries and datacenter/cloud networks are excluded. */
|
|
260
|
+
include_bots?: boolean;
|
|
261
|
+
/** Also count internal traffic. Off by default: the graph8 app (app.graph8.com), local development hosts and your own team members (member emails and company email domains) are excluded. */
|
|
262
|
+
include_internal?: boolean;
|
|
263
|
+
};
|
|
250
264
|
headers?: {
|
|
251
265
|
"X-Target-Org-Id"?: string | null;
|
|
252
266
|
};
|
|
@@ -303,6 +317,10 @@ export interface VisitorsOperations {
|
|
|
303
317
|
page?: number;
|
|
304
318
|
/** Items per page. */
|
|
305
319
|
limit?: number;
|
|
320
|
+
/** Also count bot and crawler traffic. Off by default: events from self-identified crawlers, headless browsers, HTTP libraries and datacenter/cloud networks are excluded. */
|
|
321
|
+
include_bots?: boolean;
|
|
322
|
+
/** Also count internal traffic. Off by default: the graph8 app (app.graph8.com), local development hosts and your own team members (member emails and company email domains) are excluded. */
|
|
323
|
+
include_internal?: boolean;
|
|
306
324
|
};
|
|
307
325
|
headers?: {
|
|
308
326
|
"X-Target-Org-Id"?: string | null;
|
|
@@ -348,6 +366,10 @@ export interface VisitorsOperations {
|
|
|
348
366
|
page?: number;
|
|
349
367
|
/** Items per page. */
|
|
350
368
|
limit?: number;
|
|
369
|
+
/** Also count bot and crawler traffic. Off by default: events from self-identified crawlers, headless browsers, HTTP libraries and datacenter/cloud networks are excluded. */
|
|
370
|
+
include_bots?: boolean;
|
|
371
|
+
/** Also count internal traffic. Off by default: the graph8 app (app.graph8.com), local development hosts and your own team members (member emails and company email domains) are excluded. */
|
|
372
|
+
include_internal?: boolean;
|
|
351
373
|
};
|
|
352
374
|
headers?: {
|
|
353
375
|
"X-Target-Org-Id"?: string | null;
|
|
@@ -370,6 +392,10 @@ export interface VisitorsOperations {
|
|
|
370
392
|
page?: number;
|
|
371
393
|
/** Items per page. */
|
|
372
394
|
limit?: number;
|
|
395
|
+
/** Also count bot and crawler traffic. Off by default: events from self-identified crawlers, headless browsers, HTTP libraries and datacenter/cloud networks are excluded. */
|
|
396
|
+
include_bots?: boolean;
|
|
397
|
+
/** Also count internal traffic. Off by default: the graph8 app (app.graph8.com), local development hosts and your own team members (member emails and company email domains) are excluded. */
|
|
398
|
+
include_internal?: boolean;
|
|
373
399
|
};
|
|
374
400
|
headers?: {
|
|
375
401
|
"X-Target-Org-Id"?: string | null;
|
package/docs/api/visitors.md
CHANGED
|
@@ -227,6 +227,8 @@ Live sessions rolled up per visitor. Same PII rule as `/live`.
|
|
|
227
227
|
| `query.time_window` | `"5min" \| "30min" \| "1hr"` | no | Live window. default `"30min"` |
|
|
228
228
|
| `query.stream_id` | `string \| null` | no | Comma-separated public keys, or "all". Omit for every stream. |
|
|
229
229
|
| `query.limit` | `integer` | no | default `1000` |
|
|
230
|
+
| `query.include_bots` | `boolean` | no | Also count bot and crawler traffic. Off by default: events from self-identified crawlers, headless browsers, HTTP libraries and datacenter/cloud networks are excluded. default `false` |
|
|
231
|
+
| `query.include_internal` | `boolean` | no | Also count internal traffic. Off by default: the graph8 app (app.graph8.com), local development hosts and your own team members (member emails and company email domains) are excluded. default `false` |
|
|
230
232
|
|
|
231
233
|
**Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
232
234
|
|
|
@@ -372,6 +374,8 @@ same principal.
|
|
|
372
374
|
| `query.time_window` | `"5min" \| "30min" \| "1hr"` | no | Live window. default `"30min"` |
|
|
373
375
|
| `query.stream_id` | `string \| null` | no | Comma-separated public keys, or "all". Omit for every stream. |
|
|
374
376
|
| `query.limit` | `integer` | no | default `10000` |
|
|
377
|
+
| `query.include_bots` | `boolean` | no | Also count bot and crawler traffic. Off by default: events from self-identified crawlers, headless browsers, HTTP libraries and datacenter/cloud networks are excluded. default `false` |
|
|
378
|
+
| `query.include_internal` | `boolean` | no | Also count internal traffic. Off by default: the graph8 app (app.graph8.com), local development hosts and your own team members (member emails and company email domains) are excluded. default `false` |
|
|
375
379
|
|
|
376
380
|
**Returns** `ApiResponse_dict_`: the envelope `{ data: Record<string, unknown>, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
377
381
|
|
|
@@ -478,6 +482,8 @@ not comparable row for row and should not be charted as if they were.
|
|
|
478
482
|
| Field | Type | Required | Description |
|
|
479
483
|
|---|---|---|---|
|
|
480
484
|
| `path.resource` | `"contacts" \| "companies"` | yes | What to count. |
|
|
485
|
+
| `query.include_bots` | `boolean` | no | Also count bot and crawler traffic. Off by default: events from self-identified crawlers, headless browsers, HTTP libraries and datacenter/cloud networks are excluded. default `false` |
|
|
486
|
+
| `query.include_internal` | `boolean` | no | Also count internal traffic. Off by default: the graph8 app (app.graph8.com), local development hosts and your own team members (member emails and company email domains) are excluded. default `false` |
|
|
481
487
|
| `body` | `Array<Record<string, unknown>>` | no | Request body; fields below. |
|
|
482
488
|
|
|
483
489
|
**Returns** `ApiResponse_VisitorStatisticsResponse_`: the envelope `{ data: VisitorStatisticsResponse, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
@@ -599,6 +605,8 @@ The B2BC variant of the contact feed.
|
|
|
599
605
|
| `query.filter` | `string \| null` | no | Serialised filter expression, passed through to the events query unchanged. Its grammar is the app's, not this contract's - a typed model here would freeze a filter language that still moves. |
|
|
600
606
|
| `query.page` | `integer` | no | Page number (1-indexed). default `1` |
|
|
601
607
|
| `query.limit` | `integer` | no | Items per page. default `50` |
|
|
608
|
+
| `query.include_bots` | `boolean` | no | Also count bot and crawler traffic. Off by default: events from self-identified crawlers, headless browsers, HTTP libraries and datacenter/cloud networks are excluded. default `false` |
|
|
609
|
+
| `query.include_internal` | `boolean` | no | Also count internal traffic. Off by default: the graph8 app (app.graph8.com), local development hosts and your own team members (member emails and company email domains) are excluded. default `false` |
|
|
602
610
|
|
|
603
611
|
**Returns** `ApiResponse_VisitorEventPage_`: the envelope `{ data: VisitorEventPage, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
604
612
|
|
|
@@ -685,6 +693,8 @@ Visits resolved to a company rather than a person.
|
|
|
685
693
|
| `query.filter` | `string \| null` | no | Serialised filter expression, passed through to the events query unchanged. Its grammar is the app's, not this contract's - a typed model here would freeze a filter language that still moves. |
|
|
686
694
|
| `query.page` | `integer` | no | Page number (1-indexed). default `1` |
|
|
687
695
|
| `query.limit` | `integer` | no | Items per page. default `50` |
|
|
696
|
+
| `query.include_bots` | `boolean` | no | Also count bot and crawler traffic. Off by default: events from self-identified crawlers, headless browsers, HTTP libraries and datacenter/cloud networks are excluded. default `false` |
|
|
697
|
+
| `query.include_internal` | `boolean` | no | Also count internal traffic. Off by default: the graph8 app (app.graph8.com), local development hosts and your own team members (member emails and company email domains) are excluded. default `false` |
|
|
688
698
|
|
|
689
699
|
**Returns** `ApiResponse_VisitorEventPage_`: the envelope `{ data: VisitorEventPage, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
690
700
|
|
|
@@ -733,6 +743,8 @@ it looks.
|
|
|
733
743
|
| `query.filter` | `string \| null` | no | Serialised filter expression, passed through to the events query unchanged. Its grammar is the app's, not this contract's - a typed model here would freeze a filter language that still moves. |
|
|
734
744
|
| `query.page` | `integer` | no | Page number (1-indexed). default `1` |
|
|
735
745
|
| `query.limit` | `integer` | no | Items per page. default `50` |
|
|
746
|
+
| `query.include_bots` | `boolean` | no | Also count bot and crawler traffic. Off by default: events from self-identified crawlers, headless browsers, HTTP libraries and datacenter/cloud networks are excluded. default `false` |
|
|
747
|
+
| `query.include_internal` | `boolean` | no | Also count internal traffic. Off by default: the graph8 app (app.graph8.com), local development hosts and your own team members (member emails and company email domains) are excluded. default `false` |
|
|
736
748
|
|
|
737
749
|
**Returns** `ApiResponse_VisitorEventPage_`: the envelope `{ data: VisitorEventPage, ... }`. `g8.api` returns the envelope as-is, so read `result.data`.
|
|
738
750
|
|