picked 0.0.101-next.2 → 0.0.101

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.
Files changed (175) hide show
  1. package/README.md +27 -12
  2. package/docs/explanation/conditions-and-the-logic-engine.md +94 -0
  3. package/docs/explanation/content-references.md +99 -0
  4. package/docs/explanation/feature-flag-allocation.md +218 -0
  5. package/docs/explanation/how-picked-works.md +124 -0
  6. package/docs/explanation/how-pickedql-works.md +76 -0
  7. package/docs/explanation/pages-and-flows.md +64 -0
  8. package/docs/explanation/the-content-model.md +87 -0
  9. package/docs/explanation/the-two-apis.md +68 -0
  10. package/docs/explanation/why-server-side-rendering.md +76 -0
  11. package/docs/explanation/workspaces-and-versions.md +71 -0
  12. package/docs/how-to/add-a-step-field-or-action.md +56 -0
  13. package/docs/how-to/analytics/index.md +324 -0
  14. package/docs/how-to/archive-or-delete-a-workspace.md +59 -0
  15. package/docs/how-to/authenticate-the-cli.md +101 -0
  16. package/docs/how-to/authenticate-with-a-magic-link.md +56 -0
  17. package/docs/how-to/authenticate-with-a-password.md +68 -0
  18. package/docs/how-to/authenticate-with-an-api-key.md +60 -0
  19. package/docs/how-to/authenticate-with-oauth.md +49 -0
  20. package/docs/how-to/build-a-flow.md +106 -0
  21. package/docs/how-to/call-an-external-api-from-a-workflow.md +116 -0
  22. package/docs/how-to/connect-the-mcp-server.md +46 -0
  23. package/docs/how-to/create-a-content-entry.md +58 -0
  24. package/docs/how-to/create-a-project.md +40 -0
  25. package/docs/how-to/create-an-experience.md +51 -0
  26. package/docs/how-to/create-and-revoke-an-api-key.md +54 -0
  27. package/docs/how-to/debug-with-the-chrome-extension.md +57 -0
  28. package/docs/how-to/define-a-page-layout.md +54 -0
  29. package/docs/how-to/fill-and-publish-a-page.md +82 -0
  30. package/docs/how-to/install-the-gtm-template.md +84 -0
  31. package/docs/how-to/install-the-sdk.md +93 -0
  32. package/docs/how-to/install-the-vite-plugin.md +69 -0
  33. package/docs/how-to/invite-and-remove-members.md +45 -0
  34. package/docs/how-to/point-one-entry-at-another.md +75 -0
  35. package/docs/how-to/preview-a-workspace.md +39 -0
  36. package/docs/how-to/publish-a-workspace.md +42 -0
  37. package/docs/how-to/read-a-feature-flag.md +113 -0
  38. package/docs/how-to/read-a-referenced-entry.md +109 -0
  39. package/docs/how-to/register-a-component.md +55 -0
  40. package/docs/how-to/register-an-action-handler.md +85 -0
  41. package/docs/how-to/register-an-api-that-uses-oauth2.md +107 -0
  42. package/docs/how-to/render-a-step-form.md +131 -0
  43. package/docs/how-to/render-an-unpublished-preview.md +41 -0
  44. package/docs/how-to/retry-a-failed-call-with-a-loop.md +81 -0
  45. package/docs/how-to/reuse-a-section.md +64 -0
  46. package/docs/how-to/reuse-a-step-field-or-action.md +39 -0
  47. package/docs/how-to/roll-back-a-published-version.md +39 -0
  48. package/docs/how-to/run-an-ab-test.md +59 -0
  49. package/docs/how-to/run-code-on-a-form-submission.md +125 -0
  50. package/docs/how-to/server-render-a-page.md +81 -0
  51. package/docs/how-to/set-a-content-security-policy.md +32 -0
  52. package/docs/how-to/set-up-mfa.md +126 -0
  53. package/docs/how-to/switch-workspaces.md +122 -0
  54. package/docs/how-to/upload-and-use-an-asset.mdx +87 -0
  55. package/docs/how-to/validate-a-field.md +52 -0
  56. package/docs/how-to/wait-for-an-action-response.md +182 -0
  57. package/docs/how-to/write-a-condition.md +57 -0
  58. package/docs/how-to/write-a-predicate.md +60 -0
  59. package/docs/index.md +59 -0
  60. package/docs/reference/dashboard/actions.mdx +65 -0
  61. package/docs/reference/dashboard/api-keys.mdx +47 -0
  62. package/docs/reference/dashboard/conditions.mdx +51 -0
  63. package/docs/reference/dashboard/content/asset-library.mdx +74 -0
  64. package/docs/reference/dashboard/content/blocks.mdx +66 -0
  65. package/docs/reference/dashboard/content/content-entries.mdx +109 -0
  66. package/docs/reference/dashboard/content/models.mdx +119 -0
  67. package/docs/reference/dashboard/content/pages.mdx +72 -0
  68. package/docs/reference/dashboard/experiences.mdx +61 -0
  69. package/docs/reference/dashboard/external-apis.md +182 -0
  70. package/docs/reference/dashboard/features.mdx +165 -0
  71. package/docs/reference/dashboard/fields.mdx +120 -0
  72. package/docs/reference/dashboard/flow-builder/canvas.mdx +58 -0
  73. package/docs/reference/dashboard/flow-builder/condition-builder.md +69 -0
  74. package/docs/reference/dashboard/flow-builder/keyboard-shortcuts.md +72 -0
  75. package/docs/reference/dashboard/flow-builder/nodes.md +74 -0
  76. package/docs/reference/dashboard/labels.md +321 -0
  77. package/docs/reference/dashboard/lead-search.md +235 -0
  78. package/docs/reference/dashboard/projects.mdx +53 -0
  79. package/docs/reference/dashboard/reports.mdx +53 -0
  80. package/docs/reference/dashboard/steps.mdx +47 -0
  81. package/docs/reference/dashboard/team-management.md +38 -0
  82. package/docs/reference/dashboard/workflow-runs.md +157 -0
  83. package/docs/reference/dashboard/workflow-templates.md +182 -0
  84. package/docs/reference/dashboard/workflow-test-runs.md +85 -0
  85. package/docs/reference/dashboard/workspace-versioning.mdx +42 -0
  86. package/docs/reference/dashboard/workspaces.mdx +91 -0
  87. package/docs/reference/delivery-api/experience-content.md +152 -0
  88. package/docs/reference/delivery-api/index.md +45 -0
  89. package/docs/reference/delivery-api/preview-caching-crawling.md +79 -0
  90. package/docs/reference/delivery-api/project-config.md +65 -0
  91. package/docs/reference/delivery-api/workspace-schema.md +107 -0
  92. package/docs/reference/glossary.md +201 -0
  93. package/docs/reference/management-api/authentication.md +87 -0
  94. package/docs/reference/management-api/authorization-and-scopes.md +291 -0
  95. package/docs/reference/management-api/error-handling.md +232 -0
  96. package/docs/reference/management-api/pagination.md +192 -0
  97. package/docs/reference/management-api/schema/action.md +261 -0
  98. package/docs/reference/management-api/schema/analytics-session.md +363 -0
  99. package/docs/reference/management-api/schema/analytics.md +73 -0
  100. package/docs/reference/management-api/schema/api-key.md +170 -0
  101. package/docs/reference/management-api/schema/auth.md +1177 -0
  102. package/docs/reference/management-api/schema/cms-fields.md +954 -0
  103. package/docs/reference/management-api/schema/cms-models.md +1155 -0
  104. package/docs/reference/management-api/schema/common.md +362 -0
  105. package/docs/reference/management-api/schema/condition.md +254 -0
  106. package/docs/reference/management-api/schema/design-system.md +199 -0
  107. package/docs/reference/management-api/schema/experience.md +1098 -0
  108. package/docs/reference/management-api/schema/external-api.md +637 -0
  109. package/docs/reference/management-api/schema/feature.md +350 -0
  110. package/docs/reference/management-api/schema/feedback.md +103 -0
  111. package/docs/reference/management-api/schema/field.md +400 -0
  112. package/docs/reference/management-api/schema/index.md +243 -0
  113. package/docs/reference/management-api/schema/integration.md +272 -0
  114. package/docs/reference/management-api/schema/label.md +349 -0
  115. package/docs/reference/management-api/schema/lead.md +340 -0
  116. package/docs/reference/management-api/schema/mcp-server.md +299 -0
  117. package/docs/reference/management-api/schema/metric.md +223 -0
  118. package/docs/reference/management-api/schema/operation.md +96 -0
  119. package/docs/reference/management-api/schema/organization.md +749 -0
  120. package/docs/reference/management-api/schema/project.md +607 -0
  121. package/docs/reference/management-api/schema/report.md +243 -0
  122. package/docs/reference/management-api/schema/saved-view.md +288 -0
  123. package/docs/reference/management-api/schema/shopify.md +795 -0
  124. package/docs/reference/management-api/schema/step.md +273 -0
  125. package/docs/reference/management-api/schema/tenant-branding.md +185 -0
  126. package/docs/reference/management-api/schema/workbench.md +246 -0
  127. package/docs/reference/management-api/schema/workflow-run.md +263 -0
  128. package/docs/reference/management-api/schema/workflow.md +1110 -0
  129. package/docs/reference/management-api/schema/workspace-version.md +823 -0
  130. package/docs/reference/management-api/schema/workspace.md +917 -0
  131. package/docs/reference/pickedql/data-sources.md +174 -0
  132. package/docs/reference/pickedql/dimensions.md +103 -0
  133. package/docs/reference/pickedql/filtering.md +64 -0
  134. package/docs/reference/pickedql/index.md +18 -0
  135. package/docs/reference/pickedql/schema.md +172 -0
  136. package/docs/reference/pickedql/virtual-functions.md +248 -0
  137. package/docs/reference/sdk/actions.md +154 -0
  138. package/docs/reference/sdk/analytics-events.md +453 -0
  139. package/docs/reference/sdk/conditions.md +147 -0
  140. package/docs/reference/sdk/content-security-policy.md +21 -0
  141. package/docs/reference/sdk/content.md +253 -0
  142. package/docs/reference/sdk/experiences.md +51 -0
  143. package/docs/reference/sdk/features.md +256 -0
  144. package/docs/reference/sdk/fields.md +255 -0
  145. package/docs/reference/sdk/index.md +68 -0
  146. package/docs/reference/sdk/plugins/create-experience.md +123 -0
  147. package/docs/reference/sdk/plugins/dynamic-experiences.md +74 -0
  148. package/docs/reference/sdk/plugins/fingerprintjs.md +39 -0
  149. package/docs/reference/sdk/plugins/hotjar.md +60 -0
  150. package/docs/reference/sdk/plugins/index.md +33 -0
  151. package/docs/reference/sdk/plugins/sentry.md +51 -0
  152. package/docs/reference/sdk/plugins/shopify.md +109 -0
  153. package/docs/reference/sdk/plugins/window-object.md +25 -0
  154. package/docs/reference/sdk/predicates.md +43 -0
  155. package/docs/reference/sdk/react.md +61 -0
  156. package/docs/reference/sdk/ssr/index.md +33 -0
  157. package/docs/reference/sdk/ssr/rendering-and-hydration.md +103 -0
  158. package/docs/reference/sdk/ssr/serialize.md +80 -0
  159. package/docs/reference/sdk/ssr/slots-and-placements.md +113 -0
  160. package/docs/reference/sdk/steps.md +86 -0
  161. package/docs/reference/sdk/svelte.md +74 -0
  162. package/docs/reference/sdk/type-generation.md +265 -0
  163. package/docs/reference/tools/admin-api-client.md +89 -0
  164. package/docs/reference/tools/chrome-extension.md +16 -0
  165. package/docs/reference/tools/cli.md +319 -0
  166. package/docs/reference/tools/delivery-api-client.md +60 -0
  167. package/docs/reference/tools/image-optimisation-service.md +104 -0
  168. package/docs/reference/tools/mcp-run.md +121 -0
  169. package/docs/reference/tools/mcp.md +391 -0
  170. package/docs/reference/tools/vite-plugin.md +163 -0
  171. package/docs/tutorials/first-api-call.md +253 -0
  172. package/docs/tutorials/first-experience-in-the-dashboard.mdx +160 -0
  173. package/docs/tutorials/first-experience.mdx +254 -0
  174. package/docs/tutorials/first-server-rendered-page.mdx +186 -0
  175. package/package.json +8 -7
@@ -0,0 +1,349 @@
1
+ ---
2
+ type: reference
3
+ layout: docs
4
+ generated: true
5
+ ---
6
+
7
+ # Label schema
8
+
9
+ The operations and types that `label.graphql` adds to the Management API. See [Management API schema](/reference/management-api/schema) for every domain, the endpoint and authentication.
10
+
11
+ ## Mutations
12
+
13
+ ### `labelsSet`
14
+
15
+ Create or replace labels on an owner. Requires scope:
16
+ `ORGANIZATION_LEADS_UPDATE` on the lead's project for a `LEAD` owner, and
17
+ `ORGANIZATION_PROJECTS_UPDATE` on the project for a `PROJECT` or
18
+ `WORKFLOW_RUN` owner.
19
+
20
+ ```graphql
21
+ labelsSet(input: LabelsSetInput!): LabelsSetPayload! @auth
22
+ ```
23
+
24
+ ### `labelsDelete`
25
+
26
+ Remove labels from an owner. Requires scope: `ORGANIZATION_LEADS_UPDATE` on
27
+ the lead's project for a `LEAD` owner, and `ORGANIZATION_PROJECTS_UPDATE` on
28
+ the project for a `PROJECT` or `WORKFLOW_RUN` owner.
29
+
30
+ ```graphql
31
+ labelsDelete(input: LabelsDeleteInput!): LabelsDeletePayload! @auth
32
+ ```
33
+
34
+ ## Types
35
+
36
+ ### `LabelType`
37
+
38
+ ```graphql
39
+ """How to read a label's `value`."""
40
+ enum LabelType {
41
+ """A plain string."""
42
+ TEXT
43
+ """A number, serialised as a string."""
44
+ NUMBER
45
+ """A boolean, serialised as `true` or `false`."""
46
+ BOOLEAN
47
+ """A JSON document, serialised as a string."""
48
+ JSON
49
+ }
50
+ ```
51
+
52
+ ### `LabelOwnerType`
53
+
54
+ ```graphql
55
+ """
56
+ The kind of entity a label is attached to. Each kind is read under its own
57
+ scope and written under another:
58
+
59
+ | Owner type | Read scope | Write scope |
60
+ | --- | --- | --- |
61
+ | `LEAD` | `ORGANIZATION_LEADS_READ` | `ORGANIZATION_LEADS_UPDATE` |
62
+ | `PROJECT` | `ORGANIZATION_PROJECTS_READ` | `ORGANIZATION_PROJECTS_UPDATE` |
63
+ | `WORKFLOW_RUN` | `ORGANIZATION_PROJECTS_READ` | `ORGANIZATION_PROJECTS_UPDATE` |
64
+
65
+ A workflow run reads and writes its own labels without either scope.
66
+ """
67
+ enum LabelOwnerType {
68
+ """A captured lead. Its labels are deleted with it."""
69
+ LEAD
70
+ """A project, whose id is the owner id. Its labels outlive every lead."""
71
+ PROJECT
72
+ """A workflow run. Its labels outlive every lead."""
73
+ WORKFLOW_RUN
74
+ }
75
+ ```
76
+
77
+ ### `Label`
78
+
79
+ ```graphql
80
+ """
81
+ An annotation on an owner. Unique per owner, namespace and key, so setting one
82
+ that already exists replaces its value and type.
83
+
84
+ A label written with `expiresIn` expires that many seconds after the write.
85
+ Once it has expired it reads as absent: it leaves its owner's `labels`, matches
86
+ no lead query clause, and a later write to it creates a new label with a new id.
87
+ """
88
+ type Label {
89
+ """Unique label identifier."""
90
+ id: ID!
91
+ """Grouping for related keys, rendered as a section heading."""
92
+ namespace: String!
93
+ """Name of this label within its namespace."""
94
+ key: String!
95
+ """How to read `value`."""
96
+ type: LabelType!
97
+ """The value, always a string. Interpret it through `type`."""
98
+ value: String!
99
+ """When this label was first set."""
100
+ createdAt: DateTime!
101
+ """When this label was last changed."""
102
+ updatedAt: DateTime!
103
+ """When this label expires, or null when it does not expire."""
104
+ expiresAt: DateTime
105
+ """The owner this label annotates."""
106
+ owner: LabelOwner!
107
+ }
108
+ ```
109
+
110
+ ### `LabelOwner`
111
+
112
+ ```graphql
113
+ """The resource a label annotates: a lead, a project or a workflow run."""
114
+ union LabelOwner = Lead | Project | WorkflowRun
115
+ ```
116
+
117
+ ### `LabelOperation`
118
+
119
+ ```graphql
120
+ """
121
+ One entry in a label's log: something done to the label, by a workflow run
122
+ task, a person or an integration. `label` is null once the label has been
123
+ removed or has expired.
124
+ """
125
+ type LabelOperation implements Operation {
126
+ """Unique operation identifier."""
127
+ id: ID!
128
+ """What was done to the label."""
129
+ type: OperationType!
130
+ """When the operation happened."""
131
+ occurredAt: DateTime!
132
+ """
133
+ The workflow run task that performed the operation, or null when it was not a workflow.
134
+ """
135
+ task: WorkflowTask
136
+ """The label, or null once it has been removed or has expired."""
137
+ label: Label
138
+ }
139
+ ```
140
+
141
+ ### `LabelInput`
142
+
143
+ ```graphql
144
+ """
145
+ One label to set. Namespace and key must be 1-64 characters of lowercase
146
+ letters, digits, underscore or hyphen; a dot is rejected, because the leads
147
+ search query language splits `labels.<namespace>.<key>` on it.
148
+
149
+ Exactly one of `value` and `increment` is required; a label carrying both, or
150
+ neither, is refused with `LABEL_WRITE_INVALID`.
151
+
152
+ Example, a lock that holds the caller's id for an hour unless another caller
153
+ holds it already:
154
+
155
+ { namespace: "cms", key: "request-callback", type: TEXT, value: "wkrun_abc",
156
+ onlyIfAbsent: true, expiresIn: 3600 }
157
+
158
+ Example, a counter:
159
+
160
+ { namespace: "cms", key: "sent-today", type: NUMBER, increment: 1, expiresIn: 86400 }
161
+ """
162
+ input LabelInput {
163
+ """Grouping for related keys."""
164
+ namespace: String!
165
+ """Name of this label within its namespace."""
166
+ key: String!
167
+ """How to read `value`. Must be `NUMBER` with `increment`."""
168
+ type: LabelType!
169
+ """
170
+ The value, as a string. Must parse as `type`. A write with `value` and no
171
+ `expiresIn` makes the label permanent, clearing any expiry it had.
172
+ """
173
+ value: String
174
+ """
175
+ A finite number to add to the label's current value, in place of `value`; a
176
+ negative number subtracts.
177
+ An absent or expired label reads as 0. The label must be of type `NUMBER`:
178
+ an increment of a label of another type is refused with
179
+ `VALUE_INVALID_FOR_TYPE`, and the label is unchanged. Concurrent increments
180
+ all count. An increment keeps a live label's expiry, so its `expiresIn`
181
+ applies only when the increment creates the label. Each increment records an
182
+ operation, and cannot be combined with `onlyIfAbsent`.
183
+ """
184
+ increment: Float
185
+ """
186
+ Seconds from the write until the label expires: a whole number from 1 to
187
+ 31536000 (365 days). An expired label reads as absent everywhere.
188
+ """
189
+ expiresIn: Int
190
+ """
191
+ Writes the label only when the owner holds no unexpired label under this
192
+ namespace and key. The check and the write are one atomic step, so of
193
+ several concurrent writes to an absent label exactly one takes effect.
194
+
195
+ A live label that already holds this write's type and value counts as taken,
196
+ is left unchanged (its expiry included) and records no operation, so a
197
+ retried write reads the same result. A live label holding anything else is
198
+ left unchanged, is not taken, and is listed in `LabelsSetPayload.skipped`. A
199
+ lock's value should therefore be unique to its holder, such as a run id.
200
+ """
201
+ onlyIfAbsent: Boolean
202
+ }
203
+ ```
204
+
205
+ ### `LabelIdentifierInput`
206
+
207
+ ```graphql
208
+ """Names one label without its value, for deletion."""
209
+ input LabelIdentifierInput {
210
+ """Grouping for related keys."""
211
+ namespace: String!
212
+ """Name of this label within its namespace."""
213
+ key: String!
214
+ """
215
+ Removes the label only when it has not expired and its stored value equals
216
+ this. The check and the removal are one atomic step. A label holding another
217
+ value is left unchanged, records no operation, and is not counted as
218
+ removed: a holder releases its lock and never another holder's.
219
+ """
220
+ ifValue: String
221
+ }
222
+ ```
223
+
224
+ ### `LabelsSetInput`
225
+
226
+ ```graphql
227
+ """
228
+ Input for `labelsSet`. Creates or replaces each named label and leaves every
229
+ other label on the owner untouched, so a partial save cannot discard work
230
+ another writer did.
231
+
232
+ The labels are taken in (namespace, key) order, so two concurrent calls naming
233
+ the same labels cannot deadlock.
234
+ """
235
+ input LabelsSetInput {
236
+ """The kind of entity being annotated."""
237
+ ownerType: LabelOwnerType!
238
+ """ID of the entity being annotated."""
239
+ ownerId: ID!
240
+ """
241
+ Labels to create or replace, one per namespace and key. A label naming the
242
+ namespace and key of an earlier one is refused with `LABEL_WRITE_INVALID`.
243
+ """
244
+ labels: [LabelInput!]!
245
+ """
246
+ Takes every label or none. When any `onlyIfAbsent` label is skipped, the call
247
+ writes nothing, records no operation, returns no `labels`, and lists in
248
+ `skipped` the existing labels that blocked it. Of two concurrent
249
+ `atomic` calls that both write some label with `onlyIfAbsent`, each
250
+ with a value unique to its caller, at most one takes effect. Defaults to
251
+ false.
252
+ """
253
+ atomic: Boolean
254
+ }
255
+ ```
256
+
257
+ ### `LabelsSetPayload`
258
+
259
+ ```graphql
260
+ """Payload returned by `labelsSet`."""
261
+ type LabelsSetPayload {
262
+ """
263
+ The labels the call took, as they now stand: those it wrote, and those an
264
+ `onlyIfAbsent` label found already holding its own type and value. Empty when
265
+ input failed validation.
266
+ """
267
+ labels: [Label!]!
268
+ """
269
+ The existing labels an `onlyIfAbsent` label left in place, because they held
270
+ another type or value.
271
+ """
272
+ skipped: [Label!]!
273
+ """Per-label validation errors. Empty array indicates success."""
274
+ userErrors: [LabelUserError!]!
275
+ }
276
+ ```
277
+
278
+ ### `LabelsDeleteInput`
279
+
280
+ ```graphql
281
+ """
282
+ Input for `labelsDelete`. Deleting a label that is not set is a no-op success.
283
+ An expired label is deleted without being counted as removed.
284
+ """
285
+ input LabelsDeleteInput {
286
+ """The kind of entity being annotated."""
287
+ ownerType: LabelOwnerType!
288
+ """ID of the entity being annotated."""
289
+ ownerId: ID!
290
+ """Labels to remove."""
291
+ labels: [LabelIdentifierInput!]!
292
+ }
293
+ ```
294
+
295
+ ### `LabelsDeletePayload`
296
+
297
+ ```graphql
298
+ """Payload returned by `labelsDelete`."""
299
+ type LabelsDeletePayload {
300
+ """
301
+ IDs of the labels that were removed. A label `ifValue` spared is not listed.
302
+ """
303
+ deletedLabelIds: [ID!]!
304
+ """Per-label validation errors. Empty array indicates success."""
305
+ userErrors: [LabelUserError!]!
306
+ }
307
+ ```
308
+
309
+ ### `LabelUserErrorCode`
310
+
311
+ ```graphql
312
+ """Machine-readable error codes for the label mutations."""
313
+ enum LabelUserErrorCode {
314
+ """The namespace is outside the accepted character set."""
315
+ NAMESPACE_INVALID
316
+ """The key is outside the accepted character set."""
317
+ KEY_INVALID
318
+ """The value does not parse as the declared type."""
319
+ VALUE_INVALID_FOR_TYPE
320
+ """
321
+ No owner of that type exists with that id, or the id carries another owner
322
+ type's prefix.
323
+ """
324
+ OWNER_NOT_FOUND
325
+ """
326
+ The write is malformed: it carries both `value` and `increment` or neither,
327
+ an `increment` with `onlyIfAbsent` or with a type other than `NUMBER`, an
328
+ `expiresIn` outside 1 to 31536000 seconds, or the namespace and key of an
329
+ earlier label in the same call.
330
+ """
331
+ LABEL_WRITE_INVALID
332
+ }
333
+ ```
334
+
335
+ ### `LabelUserError`
336
+
337
+ ```graphql
338
+ """A user error from `labelsSet` or `labelsDelete`."""
339
+ type LabelUserError {
340
+ """
341
+ Path to the input field that caused the error, e.g. `['labels', '0', 'namespace']`.
342
+ """
343
+ field: [String!]
344
+ """Human-readable error message."""
345
+ message: String!
346
+ """Machine-readable error code."""
347
+ code: LabelUserErrorCode!
348
+ }
349
+ ```
@@ -0,0 +1,340 @@
1
+ ---
2
+ type: reference
3
+ layout: docs
4
+ generated: true
5
+ ---
6
+
7
+ # Lead schema
8
+
9
+ The operations and types that `lead.graphql` adds to the Management API. See [Management API schema](/reference/management-api/schema) for every domain, the endpoint and authentication.
10
+
11
+ ## Queries
12
+
13
+ ### `lead`
14
+
15
+ Get a lead by ID. Requires scope: `ORGANIZATION_LEADS_READ`.
16
+
17
+ ```graphql
18
+ lead(input: LeadInput!): Lead @auth
19
+ ```
20
+
21
+ ## Mutations
22
+
23
+ ### `leadDelete`
24
+
25
+ Permanently delete a lead and its labels. Requires scope: `ORGANIZATION_LEADS_DELETE`.
26
+
27
+ ```graphql
28
+ leadDelete(input: LeadDeleteInput!): LeadDeletePayload! @auth
29
+ ```
30
+
31
+ ## Types
32
+
33
+ ### `Lead`
34
+
35
+ ```graphql
36
+ """
37
+ A captured lead. Project-scoped, and the only place a visitor's responses are
38
+ readable.
39
+
40
+ `responses` is resolved against the field schema of `workspaceVersion`, so each
41
+ one carries the label and type an author gave the field. When a workspace
42
+ preview captured the lead there is no version to resolve against, and the
43
+ responses fall back to their raw keys.
44
+ """
45
+ type Lead {
46
+ """Unique lead identifier."""
47
+ id: ID!
48
+ """ID of the project that captured this lead."""
49
+ projectId: ID!
50
+ """
51
+ The visitor the SDK identified. Anonymous: a capture is not an account.
52
+ """
53
+ userId: String!
54
+ """
55
+ The published version whose schema names the response keys, or null when a workspace preview captured the lead.
56
+ """
57
+ workspaceVersionId: ID
58
+ """
59
+ The version this lead was captured against, or null for a preview capture.
60
+ """
61
+ workspaceVersion: WorkspaceVersion
62
+ """
63
+ The visitor's answers, each resolved to the label and type its field declares.
64
+ """
65
+ responses: [LeadResponse!]!
66
+ """Annotations on this lead, ordered by namespace then key."""
67
+ labels: [Label!]!
68
+ """
69
+ What was done to this lead and by whom, latest first: its capture, and each
70
+ later change, including a change to its labels, whether a workflow task, a
71
+ person or an integration made it.
72
+ Pass `reverse: false` for the capture first. Requires scope: `ORGANIZATION_LEADS_READ`.
73
+ """
74
+ operations(first: Int, after: String, sortKey: OperationSortKeys = OCCURRED_AT, reverse: Boolean = true): LeadOperationConnection! @auth
75
+ """
76
+ The workflow runs that created or changed this lead, each once, latest first.
77
+ Pass `reverse: false` for the earliest first. Requires scopes:
78
+ `ORGANIZATION_LEADS_READ` and `ORGANIZATION_PROJECTS_READ`.
79
+ """
80
+ workflowRuns(first: Int, after: String, last: Int, before: String, reverse: Boolean = true): WorkflowRunConnection! @auth
81
+ """
82
+ Every lead captured under this lead's SDK session id (`userId`), this lead
83
+ included, newest first unless `reverse` is false. A visitor who passes several
84
+ capture points in one flow leaves a lead at each, so this is how a lead that
85
+ `Project.leads(collapse: SESSION)` stands for reaches the others.
86
+ `matchCount` counts them, and `metrics` counts over them. Requires scope:
87
+ `ORGANIZATION_LEADS_READ`.
88
+ """
89
+ sessionLeads(first: Int, after: String, last: Int, before: String, reverse: Boolean = true): LeadConnection! @auth
90
+ """
91
+ The visitor session in which this lead was captured. Null when the lead has no
92
+ capture event, or analytics holds none for it: the event has yet to arrive, or was
93
+ captured outside production. Requires scope: `ORGANIZATION_LEADS_READ`.
94
+ """
95
+ session: AnalyticsSession @auth
96
+ """When this lead was captured."""
97
+ createdAt: DateTime!
98
+ """When this lead was last changed."""
99
+ updatedAt: DateTime!
100
+ }
101
+ ```
102
+
103
+ ### `LeadOperation`
104
+
105
+ ```graphql
106
+ """
107
+ One entry in a lead's log: something done to the lead, by a workflow run task,
108
+ a person or an integration. `lead` is null once the lead has been deleted.
109
+ """
110
+ type LeadOperation implements Operation {
111
+ """Unique operation identifier."""
112
+ id: ID!
113
+ """What was done to the lead."""
114
+ type: OperationType!
115
+ """When the operation happened."""
116
+ occurredAt: DateTime!
117
+ """
118
+ The workflow run task that performed the operation, or null when it was not a workflow.
119
+ """
120
+ task: WorkflowTask
121
+ """ID of the lead, present after the lead is deleted."""
122
+ leadId: ID!
123
+ """The lead, or null once it has been deleted."""
124
+ lead: Lead
125
+ }
126
+ ```
127
+
128
+ ### `LeadOperationConnection`
129
+
130
+ ```graphql
131
+ """Relay-style connection of a lead's operations, in the order asked."""
132
+ type LeadOperationConnection {
133
+ """List of operation edges."""
134
+ edges: [LeadOperationEdge!]!
135
+ """
136
+ Flat list of operations, equivalent to `edges[].node`. Convenience accessor.
137
+ """
138
+ nodes: [LeadOperation!]!
139
+ """Pagination metadata."""
140
+ pageInfo: PageInfo!
141
+ """Total number of operations on the lead."""
142
+ totalCount: Int!
143
+ }
144
+ ```
145
+
146
+ ### `LeadOperationEdge`
147
+
148
+ ```graphql
149
+ """Edge type for `LeadOperationConnection`."""
150
+ type LeadOperationEdge {
151
+ """Pagination cursor for this edge."""
152
+ cursor: String!
153
+ """The operation."""
154
+ node: LeadOperation!
155
+ }
156
+ ```
157
+
158
+ ### `LeadResponse`
159
+
160
+ ```graphql
161
+ """
162
+ One answer a visitor gave, joined to the field that requested it.
163
+
164
+ `label` and `type` come from the capturing version's field schema. For a
165
+ preview capture, `label` repeats `key` and `type` is `TEXT`, because there is no
166
+ schema to resolve against.
167
+ """
168
+ type LeadResponse {
169
+ """The field key this answer was stored under."""
170
+ key: String!
171
+ """The human-readable label the field declares."""
172
+ label: String!
173
+ """The kind of value the field captures."""
174
+ type: FieldType!
175
+ """The answer itself. Shape follows `type`."""
176
+ value: JSON
177
+ }
178
+ ```
179
+
180
+ ### `LeadConnection`
181
+
182
+ ```graphql
183
+ """
184
+ Relay-style connection of leads, with both an `edges` list and a flat `nodes` accessor.
185
+ """
186
+ type LeadConnection {
187
+ """List of lead edges."""
188
+ edges: [LeadEdge!]!
189
+ """
190
+ Flat list of leads, equivalent to `edges[].node`. Convenience accessor.
191
+ """
192
+ nodes: [Lead!]!
193
+ """Pagination metadata."""
194
+ pageInfo: PageInfo!
195
+ """
196
+ Total number of leads matching the query. A query with a `session.` clause
197
+ has no total, and this field fails for one.
198
+ """
199
+ totalCount: Int! @deprecated(reason: "Use matchCount, which is null for a query with a session. clause.")
200
+ """
201
+ The number of leads the query matches across every page; null when the query has a `session.` clause.
202
+ """
203
+ matchCount: Int
204
+ """
205
+ Metrics over every lead the connection's `query` matches, across all pages.
206
+ """
207
+ metrics: LeadMetrics!
208
+ }
209
+ ```
210
+
211
+ ### `LeadMetrics`
212
+
213
+ ```graphql
214
+ """
215
+ Metrics over the leads a `LeadConnection` matches. Every metric counts under
216
+ the connection's `query` and ignores its page window and `sort`, so pass
217
+ `first: 0` on `Project.leads` to read metrics without fetching a page.
218
+ """
219
+ type LeadMetrics {
220
+ """
221
+ Matching leads by capture time.
222
+
223
+ `groupBy` splits the count by a path in the lead query grammar: a label
224
+ (`labels.aia.status`, or `aia.status`) or a response (`responses.state`, or
225
+ `state`). Leads with no value at the path group under an empty key.
226
+
227
+ Under a `session.` clause the count reads the session of each capture event
228
+ of the leads created in the window.
229
+ """
230
+ count(groupBy: String): CountMetric!
231
+ }
232
+ ```
233
+
234
+ ### `LeadCollapse`
235
+
236
+ ```graphql
237
+ """
238
+ How `Project.leads` reads the leads captured under one SDK session id
239
+ (`Lead.userId`).
240
+
241
+ A visitor who passes several capture points in one flow, such as a short form and
242
+ then a longer one, leaves one lead at each. `SESSION` reads each session as its
243
+ newest lead the query matches, and `Lead.sessionLeads` on that lead reaches the
244
+ rest.
245
+ """
246
+ enum LeadCollapse {
247
+ """Every lead the query matches."""
248
+ NONE
249
+ """
250
+ One lead per SDK session id: the newest lead the query matches. `matchCount`
251
+ counts sessions, and `metrics` count each session once, at its newest lead in
252
+ the measured window. A query with a `session.` clause takes no collapse.
253
+ """
254
+ SESSION
255
+ }
256
+ ```
257
+
258
+ ### `LeadEdge`
259
+
260
+ ```graphql
261
+ """Edge type for `LeadConnection`."""
262
+ type LeadEdge {
263
+ """Pagination cursor for this edge."""
264
+ cursor: String!
265
+ """The lead."""
266
+ node: Lead!
267
+ }
268
+ ```
269
+
270
+ ### `LeadInput`
271
+
272
+ ```graphql
273
+ """Input for the top-level `lead` query."""
274
+ input LeadInput {
275
+ """ID of the lead to fetch."""
276
+ id: ID!
277
+ }
278
+ ```
279
+
280
+ ### `LeadDeleteInput`
281
+
282
+ ```graphql
283
+ """Input for `leadDelete`."""
284
+ input LeadDeleteInput {
285
+ """ID of the lead to delete."""
286
+ id: ID!
287
+ }
288
+ ```
289
+
290
+ ### `LeadDeletePayload`
291
+
292
+ ```graphql
293
+ """
294
+ Payload returned by `leadDelete`. The delete is permanent and takes the lead's
295
+ labels with it, because deleting the row is how an erasure request is honoured.
296
+ """
297
+ type LeadDeletePayload {
298
+ """ID of the deleted lead."""
299
+ deletedLeadId: ID
300
+ }
301
+ ```
302
+
303
+ ### `LeadReport`
304
+
305
+ ```graphql
306
+ """
307
+ A report on a project's leads, embedded with the project locked,
308
+ so the embed shows that project's leads and no other. Its date range is an
309
+ editable filter inside the embed.
310
+ """
311
+ type LeadReport {
312
+ """Which of the Leads reports this is."""
313
+ kind: LeadReportKind!
314
+ """
315
+ URL of a signed embed of the report, for an iframe. The
316
+ signature expires 3 hours after the field is read.
317
+ """
318
+ embedUrl: String!
319
+ }
320
+ ```
321
+
322
+ ### `LeadReportKind`
323
+
324
+ ```graphql
325
+ """The Leads reports."""
326
+ enum LeadReportKind {
327
+ """
328
+ How leads are acquired: volume, channel, referrer, campaign, landing page, device, place and time of arrival.
329
+ """
330
+ ACQUISITION
331
+ """
332
+ The paths behind leads: first touch to lead, step sequences, visits and time to capture.
333
+ """
334
+ JOURNEYS
335
+ """
336
+ How visits convert to leads: the funnel, the lead rate by week and by segment, and what leads did that others did not.
337
+ """
338
+ CONVERSION
339
+ }
340
+ ```