support_rule_create
Write a delivery rule: where a survey should be shown (a URL match), on which devices, when (immediately, after a delay, or on the client’s own event) and how often.
Write a delivery rule: where a survey should be shown (a URL match), on which devices, when (immediately, after a delay, or on the client’s own event) and how often. Nothing here runs on this side — the rule is configuration a client’s own runtime reads back through the public edge and acts on. A rule reaches that edge only while its survey is published, so a rule may be written against a draft and simply waits
Behavior
- HTTP
POST /support/rules
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
| device | string | — | Which devices this rule applies to (default any) |
| enabled | boolean | — | Whether the rule is live. A rule is created enabled unless this says otherwise |
| trigger | object | • | When to show the survey once the page matches |
| surveyId | string | • | The survey this rule delivers. It must belong to this product |
| urlMatch | object | • | Which pages this rule applies to |
| frequency | object | • | How often the same person may see this survey |
| attributeConditions | array | — | Conditions on the visitor’s attributes. Omit for a rule that applies to everyone |
Response
| Field | Type | Always | Description |
|---|---|---|---|
| id | string | • | Rule id |
| device | string | • | Which devices the rule applies to. any is the rule that does not care and is the default |
| enabled | boolean | • | Whether the rule is live |
| trigger | object | • | |
| surveyId | string | • | The survey this rule delivers |
| urlMatch | object | • | Which pages match |
| createdAt | string | • | ISO-8601 creation timestamp |
| frequency | object | • | |
| updatedAt | string | • | ISO-8601 last-modification timestamp |
| attributeConditions | array | • | Conditions on the visitor’s attributes, ALL of which must hold |
Try it
Write a delivery rule: where a survey should be shown (a URL match), on which devices, when (immediately, after a delay, or on the client’s own event) and how often.