# List authorable trigger fields `POST /platform/v1/campaigns/trigger-schema` Project the trigger fields authorable for a targeting set without persisting anything. Resolves the same effective scope a write would (`422` on an invalid targeting set, problems in `exception_details.problems`), then returns, per unprefixed trigger field, the operators a write accepts for it across that whole scope. A field numeric in one scoped catalog but string (or absent) in another is reported with the string operator set, since that is what a write accepts for it. Each item carries its `source` (`catalog` attribute vs the `request`). The four request-owned fields (`request:query`, `request:intent`, `request:type`, `request:anchor_id`) are always included; add the `trigger.` prefix to a name to build a leaf. Items are sorted by name; `query` narrows to a case-insensitive substring on the name, and the result is paginated. ## Request example ```bash curl --request POST \ --url 'https://api.eu1.luigisbox.ai/platform/v1/campaigns/trigger-schema?page=1&size=20' \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data '{ "catalog_ids": [ "example" ], "catalog_tags": [ "example" ], "channel_ids": [ "example" ], "channel_tags": [ "example" ], "intents": [ "search" ], "organization_id": "example", "surface_ids": [ "example" ], "surface_tags": [ "example" ] }' ``` ## Query Parameters | Name | Type | Required | Description | Constraints | |---|---|---|---|---| | `query` | `anyOf(string, null)` | No | Query | — | | `page` | `integer` | No | Page | >= 1 | | `size` | `integer` | No | Size | >= 1; <= 100 | ## Request Body **Required.** ### application/json Schema: `object` #### Attributes | Attribute | Type | Required | Description | Constraints | |---|---|---|---|---| | `catalog_ids` | `Array` | No | Catalog Ids | — | | `catalog_tags` | `Array` | No | Catalog Tags | — | | `channel_ids` | `Array` | No | Channel Ids | — | | `channel_tags` | `Array` | No | Channel Tags | — | | `intents` | `Array` | No | Surface Intents this campaign targets — the kind of discovery it applies to. Empty means **every** Intent, not none. Narrowing by Intent is mutually exclusive with narrowing by `surface_ids` / `surface_tags`: an Intent targets whole families of surfaces, so combining the two is rejected with `intents_conflict`. A targeted Intent no scoped catalog hosts a surface for is rejected with `catalog_without_targeted_intent` — it could never trigger. | — | | `organization_id` | `string` | Yes | Organization Id | — | | `surface_ids` | `Array` | No | Surface Ids | — | | `surface_tags` | `Array` | No | Surface Tags | — | #### Request body example ```json { "catalog_ids": [ "example" ], "catalog_tags": [ "example" ], "channel_ids": [ "example" ], "channel_tags": [ "example" ], "intents": [ "search" ], "organization_id": "example", "surface_ids": [ "example" ], "surface_tags": [ "example" ] } ``` ## Responses | Status | Description | Content | |---|---|---| | `200` | Successful Response | application/json: object | | `401` | Missing or invalid credentials | application/json: object | | `403` | Authenticated but not permitted | application/json: object | | `422` | Request validation failed. A targeting rejection lists every problem at once in `exception_details.problems`. | application/json: anyOf(object, object) | | `503` | The catalog's attribute types could not be read, so the request could not be type-checked; retryable. | application/json: object | ### 200 Successful Response #### application/json Schema: `object` ##### Attributes | Attribute | Type | Required | Description | Constraints | |---|---|---|---|---| | `items` | `Array` | Yes | Items | — | | `items[].name` | `string` | Yes | Unprefixed trigger field name. Add the `trigger.` prefix to build a `match` leaf — `brand` here is authored as `trigger.brand`. | — | | `items[].operators` | `Array` | Yes | Every operator a write accepts for this field anywhere in the scope. Range and comparison operators are offered on a numeric field; a keyword field offers membership operators only. | — | | `items[].source` | `string` | Yes | Where the value comes from when a campaign is matched: a `catalog` attribute of the matched anchor/collection document, or the `request` itself. Derived from the name — the reserved `request:` prefix cannot be occupied by catalog data. | allowed values: catalog, request | | `items[].value_domain` | `string` | Yes | How far `values` binds: `closed` is a fixed choice and anything else is rejected on save, `suggested` lists what the scope carries today while a value outside it is still accepted, and `open` is free input with `values` empty. | allowed values: closed, suggested, open | | `items[].values` | `Array` | Yes | The literals this field admits, sorted. **Populated only for `request:`-source fields**, whose vocabularies are known here; a catalog attribute always reports `[]` because its values are catalog data, not schema — read those from `GET /catalog/v1/{catalog_id}/types/{object_type}/attributes/{attribute_name}/values`. An empty list never means the field accepts nothing. | — | | `page` | `integer` | Yes | Page | — | | `size` | `integer` | Yes | Size | — | | `total` | `integer` | Yes | Total | — | ##### Response example ```json { "items": [ { "name": "example", "operators": [ "eq" ], "source": "catalog", "value_domain": "closed", "values": [ "example" ] } ], "page": 1, "size": 1, "total": 1 } ``` ### 401 Missing or invalid credentials #### application/json Schema: `object` ##### Attributes | Attribute | Type | Required | Description | Constraints | |---|---|---|---|---| | `exception_details` | `object` | No | Machine-readable error context; empty object when there is nothing to add. | — | | `exception_details.validation_errors` | `anyOf(Array, null)` | No | Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value. | — | | `exception_details.validation_errors[].loc` | `Array` | Yes | Path to the offending value from the request root, e.g. `["body", "filters", 0, "operator"]`. | — | | `exception_details.validation_errors[].msg` | `string` | Yes | What is wrong with the value at `loc`. | — | | `exception_details.validation_errors[].type` | `string` | Yes | Stable machine code for the problem, e.g. `missing` or `string_too_short`. | — | | `exception_details.*` | `any` | No | Additional property. | — | | `reason` | `string` | Yes | Human-readable, actionable error message. | — | | `request_id` | `anyOf(string, null)` | No | Request correlation ID (matches the X-Request-Id response header). | — | ##### Response example ```json { "exception_details": { "validation_errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ] }, "reason": "example", "request_id": "example" } ``` ### 403 Authenticated but not permitted #### application/json Schema: `object` ##### Attributes | Attribute | Type | Required | Description | Constraints | |---|---|---|---|---| | `exception_details` | `object` | No | Machine-readable error context; empty object when there is nothing to add. | — | | `exception_details.validation_errors` | `anyOf(Array, null)` | No | Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value. | — | | `exception_details.validation_errors[].loc` | `Array` | Yes | Path to the offending value from the request root, e.g. `["body", "filters", 0, "operator"]`. | — | | `exception_details.validation_errors[].msg` | `string` | Yes | What is wrong with the value at `loc`. | — | | `exception_details.validation_errors[].type` | `string` | Yes | Stable machine code for the problem, e.g. `missing` or `string_too_short`. | — | | `exception_details.*` | `any` | No | Additional property. | — | | `reason` | `string` | Yes | Human-readable, actionable error message. | — | | `request_id` | `anyOf(string, null)` | No | Request correlation ID (matches the X-Request-Id response header). | — | ##### Response example ```json { "exception_details": { "validation_errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ] }, "reason": "example", "request_id": "example" } ``` ### 422 Request validation failed. A targeting rejection lists every problem at once in `exception_details.problems`. #### application/json Schema: `anyOf(object, object)` ##### Attributes | Attribute | Type | Required | Description | Constraints | |---|---|---|---|---| | `exception_details` | `object` | Yes | The ``exception_details`` of a rejected targeting set: every problem found at once. | — | | `exception_details.problems` | `Array` | Yes | Every targeting violation found in one pass; never truncated. | — | | `exception_details.problems[].code` | `string` | Yes | Stable machine code of the violated rule. | allowed values: catalog_scope_required, intents_conflict, catalog_not_in_organization, channel_not_in_organization, tag_not_found, tag_dimension_mismatch, surface_not_in_catalog_scope, catalog_without_targeted_surface, channel_outside_catalog_scope, catalog_without_targeted_intent | | `exception_details.problems[].dimension` | `string` | Yes | The targeting axis the violation is about. | allowed values: catalog, channel, surface, intent | | `exception_details.problems[].message` | `string` | Yes | Human-readable explanation of the violation. | — | | `exception_details.problems[].values` | `Array` | Yes | The offending values on that axis. | — | | `reason` | `string` | Yes | Human-readable, actionable error message. | — | | `request_id` | `anyOf(string, null)` | No | Request correlation ID (matches the X-Request-Id response header). | — | | `exception_details.validation_errors` | `anyOf(Array, null)` | No | Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value. | — | | `exception_details.validation_errors[].loc` | `Array` | Yes | Path to the offending value from the request root, e.g. `["body", "filters", 0, "operator"]`. | — | | `exception_details.validation_errors[].msg` | `string` | Yes | What is wrong with the value at `loc`. | — | | `exception_details.validation_errors[].type` | `string` | Yes | Stable machine code for the problem, e.g. `missing` or `string_too_short`. | — | | `exception_details.*` | `any` | No | Additional property. | — | ##### Response example ```json { "exception_details": { "problems": [ { "code": "catalog_scope_required", "dimension": "catalog", "message": "example", "values": [ "example" ] } ] }, "reason": "example", "request_id": "example" } ``` ### 503 The catalog's attribute types could not be read, so the request could not be type-checked; retryable. #### application/json Schema: `object` ##### Attributes | Attribute | Type | Required | Description | Constraints | |---|---|---|---|---| | `exception_details` | `object` | No | Machine-readable error context; empty object when there is nothing to add. | — | | `exception_details.validation_errors` | `anyOf(Array, null)` | No | Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value. | — | | `exception_details.validation_errors[].loc` | `Array` | Yes | Path to the offending value from the request root, e.g. `["body", "filters", 0, "operator"]`. | — | | `exception_details.validation_errors[].msg` | `string` | Yes | What is wrong with the value at `loc`. | — | | `exception_details.validation_errors[].type` | `string` | Yes | Stable machine code for the problem, e.g. `missing` or `string_too_short`. | — | | `exception_details.*` | `any` | No | Additional property. | — | | `reason` | `string` | Yes | Human-readable, actionable error message. | — | | `request_id` | `anyOf(string, null)` | No | Request correlation ID (matches the X-Request-Id response header). | — | ##### Response example ```json { "exception_details": { "validation_errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ] }, "reason": "example", "request_id": "example" } ```