> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# GetTriggerByAppIdAndKey

# Package: triggers

# Namespace: TriggerCatalogService

# Method link: https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-catalog/get-trigger-by-app-id-and-key.md

## Permission Scopes:
Set Up Automations: SCOPE.CRM.SETUP-AUTOMATIONS

## Introduction

Retrieves a trigger by app ID and trigger key.

Use this to retrieve the full details of a single trigger provided by an app, including its payload schema and filter fields.

---

## REST API

### Schema

```
 Method: getTriggerByAppIdAndKey
 Description: Retrieves a trigger by app GUID and trigger key.  Use this to retrieve the full details of a single trigger provided by an app, including its payload schema and filter fields.
 URL: https://www.wixapis.com/v1/triggers/apps/{appId}/keys/{triggerKey=**}
 Method: GET
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  appId, triggerKey
 Method parameters: 
   param name: appId | type:   none | required: true 
   query param name: enrichWithIdentitySchema | type: enrichWithIdentitySchema | description: When the trigger payload schema includes the [`identityType` annotation](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/the-trigger-payload-schema.md#identitytype), whether to include the full schema of that identity type. For example, when `true` and the `identityType` is `contact`, the full [contact schema](https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/contacts/contact-v4/contact-object.md) is returned.  Default: `false`  
   query param name: triggerKey | type: triggerKey | description: Trigger key.  Learn more about [adding a trigger to your app](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/add-a-trigger-to-your-app.md). | required: true 
 Return type: GetTriggerByAppIdAndKeyResponse
  - name: trigger | type: Trigger | description: The requested trigger.  
     - name: id | type: string | description: Trigger GUID. (per component version)  | read-only: true | validation: format GUID
     - name: appId | type: string | description: GUID of the [app that created the trigger](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/add-a-trigger-to-your-app.md).  | validation: format GUID, immutable
     - name: triggerKey | type: string | description: Trigger key.  Learn about [setting up a trigger](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/add-a-trigger-to-your-app.md#step-1--set-up-the-trigger).  | validation: minLength 1, maxLength 100, immutable
     - name: payloadDataSchema | type: object | description: Trigger [payload schema](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/the-trigger-payload-schema.md).  | validation: immutable
     - name: displayName | type: string | description: Trigger display name. Users see this name when they [choose a trigger for an automation](https://support.wix.com/en/article/wix-automations-creating-an-automation-with-the-new-builder#step-2-choose-a-trigger).  | read-only: true | validation: minLength 5, maxLength 80
     - name: filters | type: array<Filter> | description: [Filter fields](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/about-triggers.md#filter-fields) applied to the trigger payload schema.  | validation: maxItems 5
        - ONE-OF: 
           - name: staticFieldKey | type: string | description: The static field key.  
           - name: dynamicFieldKey | type: DynamicFieldKey | description: Dynamic field key data.  
              - name: label | type: string | description: Field key label.  
              - name: description | type: string | description: Field key description.  
              - name: entitySelector | type: EntitySelector | description: Selects the entity to be used as a dynamic field key.  
                 - name: id | type: string | description: Entity selector GUID.  
                 - name: queryFieldToFilterIdMapping | type: object | description: Mapping of the entity selector query fields to filter GUIDs.  For example, let's say the Workflows `Card moved` trigger has 2 filters:  - Select a workflow, with filter GUID `466d2067-05bd-44f9-99c7-d029b93e4feb`. - Select a step, with filter GUID `b45f8475-bd44-4971-8820-7031ee12a708`.  The step entity selector requires the workflow GUID as input in order to return the list of relevant steps. We can map the `workflowId` field to the workflow filter in `queryFieldToFilterIdMapping`.  When the Wix user selects a workflow in the workflow filter in the automation builder, Wix passes the selected workflow's GUID in the `workflowId` field to the step entity selector. The step filter then shows the relevant steps of the selected workflow for the user to select.  | validation: format map
                 - name: multiSelect | type: boolean | description: Whether a Wix user can select multiple items.  Default: `false`  
                 - name: queryFieldToValueMapping | type: object | description: Mapping of the entity selector query fields to predefined values. This is useful when using the same entity selector in different triggers.  For example: Let's say the `RSVPed to event` trigger has one filter, `Select a specific event`. This filter has an GUID `e91733fc-81b7-45ca-b50c-f0c292a23af5`.  The events entity selector has a query field of `eventType`, that should be passed in order to return the list of relevant events. Otherwise, all events will be returned regardless of type. Map the `eventType` field to `RSVP`.  When the Wix user selects an event in the event filter in the automation builder, the client shows only `RSVP` events in the selection options because the `eventType` field was set to `RSVP`.  | validation: format map
        - name: id | type: string | description: Filter GUID.  | validation: format GUID
        - name: fieldKeyType | type: FieldKeyType | description: Field key type.  
             - enum:
             -     UNKNOWN_FIELD_KEY_TYPE: The field key type is unknown.
             -     STATIC_FIELD_KEY: The field key is a static value.
             -     DYNAMIC_FIELD_KEY: The field key changes depending on the filter selection.
        - name: valueInput | type: ValueInput | description: Input field metadata.  
           - ONE-OF: 
              - name: entitySelector | type: EntitySelector | description: Entity selector details.  
              - name: userInput | type: UserInput | description: User input details.  
                 - ONE-OF: 
                    - name: numberInputOptions | type: NumberInputOptions | description: Options for user input of type `number`.  
                       - name: defaultValue | type: integer | description: Default number value.  | validation: format int32
                       - name: minValue | type: integer | description: Minimum number value.  | validation: format int32
                       - name: maxValue | type: integer | description: Maximum number value.  | validation: format int32
                    - name: booleanInputOptions | type: BooleanInputOptions | description: Options for user input of type `boolean`.  
                       - name: defaultValue | type: boolean | description: Default boolean value.  
                 - name: type | type: Type | description: User input type.  
                         - enum:
                         -     UNKNOWN_USER_INPUT: Unknown input type.
                         -     NUMBER: Number input type.
                         -     BOOLEAN: Boolean input type.
              - name: staticItems | type: StaticItems | description: Static value details.  
                 - name: multiSelect | type: boolean | description: Whether the Wix user can select multiple items  Default: `false`.  
                 - name: staticValues | type: array<StaticItemValue> | description: Static list of values for the Wix user to select.  The value is saved on the automation-level trigger filter, and shown to Wix users at setup time if `displayName` is missing. `displayName` is optionally shown to users to help select a value.  
                    - name: id | type: string | description: item identifier  | validation: format GUID
                    - name: value | type: string | description: static value  
                    - name: displayName | type: string | description: optional displayName for the value  
           - name: type | type: Type | description: Input value type.  
                 - enum:
                 -     UNKNOWN_VALUE_INPUT: Unknown filter field input.
                 -     ENTITY_SELECTOR: Filter field input is a selection of one from multiple entities, such as a form.
                 -     USER_INPUT: Filter field value is input from a Wix user.
                 -     STATIC_ITEMS: Filter field value is a static value defined in the payload schema.
           - name: label | type: string | description: Input field label.  
           - name: description | type: string | description: Input field description. May be used for a tooltip.  
           - name: required | type: boolean | description: Whether the Wix user is required to enter a value in the field.  Default: `false`  
           - name: reevaluateDynamicSchema | type: boolean | description: Whether Wix should reevaluate the dynamic schema when the field value changes.  Default: `false`  
        - name: followUpFilters | type: array<Filter> | description: Filters to display after first selection is made.  | validation: maxItems 5
     - name: implementedMethods | type: ImplementedMethods | description: Additional [service plugin methods](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/introduction.md#implement-the-service-plugin-methods) implemented for this trigger.  
        - name: validateConfiguration | type: boolean | description: Whether [Validate Configuration](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/validate-configuration.md) is implemented.  Default: `false`.  
        - name: getDynamicSchema | type: boolean | description: Whether [Get Dynamic Schema](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/get-dynamic-schema.md) is implemented.  Default: `false`.  
        - name: refreshPayload | type: boolean | description: Whether [Refresh Payload](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/refresh-payload.md) is implemented.  Default: `false`.  
     - name: createdDate | type: string | description: Date and time the trigger was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the trigger was last updated.  | read-only: true | validation: format date-time
     - name: baseUri | type: string | description: Trigger base URI. Wix calls your trigger at this base address.  Learn more about the [Wix Automations Trigger Provider service plugin](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/introduction.md).  | validation: maxLength 256


```

### Examples

### Get Trigger By App Id And Key
```curl
curl -X GET "https://www.wixapis.com/v1/triggers/apps/c721a744-80ea-4305-b0b2-00af08d3a6ed/keys/{trigger_key=**}?appId=c721a744-80ea-4305-b0b2-00af08d3a6ed&triggerKey=wix_e_commerce-order_placed"
    -H "Authorization: <AUTH>" \
    -H "Content-Type:application/json"
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.automations.triggerCatalog.getTriggerByAppIdAndKey(identifiers, options)
 Description: Retrieves a trigger by app GUID and trigger key.  Use this to retrieve the full details of a single trigger provided by an app, including its payload schema and filter fields.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  identifiers.appId, identifiers.triggerKey, identifiers
 Method parameters: 
   param name: identifiers | type: GetTriggerByAppIdAndKeyIdentifiers  none | required: true 
        - name: appId | type: string | description: GUID of the [app that created the trigger](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/add-a-trigger-to-your-app.md). | required: true 
        - name: triggerKey | type: string | description: Trigger key.  Learn more about [adding a trigger to your app](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/add-a-trigger-to-your-app.md). | required: true 
   param name: options | type: GetTriggerByAppIdAndKeyOptions  none  
        - name: enrichWithIdentitySchema | type: boolean | description: When the trigger payload schema includes the [`identityType` annotation](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/the-trigger-payload-schema.md#identitytype), whether to include the full schema of that identity type. For example, when `true` and the `identityType` is `contact`, the full [contact schema](https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/contacts/contact-v4/contact-object.md) is returned.  Default: `false`  
 Return type: PROMISE<GetTriggerByAppIdAndKeyResponse>
  - name: trigger | type: Trigger | description: The requested trigger.  
     - name: _id | type: string | description: Trigger GUID. (per component version)  | read-only: true | validation: format GUID
     - name: appId | type: string | description: GUID of the [app that created the trigger](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/add-a-trigger-to-your-app.md).  | validation: format GUID, immutable
     - name: triggerKey | type: string | description: Trigger key.  Learn about [setting up a trigger](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/add-a-trigger-to-your-app.md#step-1--set-up-the-trigger).  | validation: minLength 1, maxLength 100, immutable
     - name: payloadDataSchema | type: object | description: Trigger [payload schema](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/the-trigger-payload-schema.md).  | validation: immutable
     - name: displayName | type: string | description: Trigger display name. Users see this name when they [choose a trigger for an automation](https://support.wix.com/en/article/wix-automations-creating-an-automation-with-the-new-builder#step-2-choose-a-trigger).  | read-only: true | validation: minLength 5, maxLength 80
     - name: filters | type: array<Filter> | description: [Filter fields](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/about-triggers.md#filter-fields) applied to the trigger payload schema.  | validation: maxItems 5
        - ONE-OF: 
           - name: staticFieldKey | type: string | description: The static field key.  
           - name: dynamicFieldKey | type: DynamicFieldKey | description: Dynamic field key data.  
              - name: label | type: string | description: Field key label.  
              - name: description | type: string | description: Field key description.  
              - name: entitySelector | type: EntitySelector | description: Selects the entity to be used as a dynamic field key.  
                 - name: _id | type: string | description: Entity selector GUID.  
                 - name: queryFieldToFilterIdMapping | type: object | description: Mapping of the entity selector query fields to filter GUIDs.  For example, let's say the Workflows `Card moved` trigger has 2 filters:  - Select a workflow, with filter GUID `466d2067-05bd-44f9-99c7-d029b93e4feb`. - Select a step, with filter GUID `b45f8475-bd44-4971-8820-7031ee12a708`.  The step entity selector requires the workflow GUID as input in order to return the list of relevant steps. We can map the `workflowId` field to the workflow filter in `queryFieldToFilterIdMapping`.  When the Wix user selects a workflow in the workflow filter in the automation builder, Wix passes the selected workflow's GUID in the `workflowId` field to the step entity selector. The step filter then shows the relevant steps of the selected workflow for the user to select.  | validation: format map
                 - name: multiSelect | type: boolean | description: Whether a Wix user can select multiple items.  Default: `false`  
                 - name: queryFieldToValueMapping | type: object | description: Mapping of the entity selector query fields to predefined values. This is useful when using the same entity selector in different triggers.  For example: Let's say the `RSVPed to event` trigger has one filter, `Select a specific event`. This filter has an GUID `e91733fc-81b7-45ca-b50c-f0c292a23af5`.  The events entity selector has a query field of `eventType`, that should be passed in order to return the list of relevant events. Otherwise, all events will be returned regardless of type. Map the `eventType` field to `RSVP`.  When the Wix user selects an event in the event filter in the automation builder, the client shows only `RSVP` events in the selection options because the `eventType` field was set to `RSVP`.  | validation: format map
        - name: _id | type: string | description: Filter GUID.  | validation: format GUID
        - name: fieldKeyType | type: FieldKeyType | description: Field key type.  
             - enum:
             -     UNKNOWN_FIELD_KEY_TYPE: The field key type is unknown.
             -     STATIC_FIELD_KEY: The field key is a static value.
             -     DYNAMIC_FIELD_KEY: The field key changes depending on the filter selection.
        - name: valueInput | type: ValueInput | description: Input field metadata.  
           - ONE-OF: 
              - name: entitySelector | type: EntitySelector | description: Entity selector details.  
              - name: userInput | type: UserInput | description: User input details.  
                 - ONE-OF: 
                    - name: numberInputOptions | type: NumberInputOptions | description: Options for user input of type `number`.  
                       - name: defaultValue | type: integer | description: Default number value.  | validation: format int32
                       - name: minValue | type: integer | description: Minimum number value.  | validation: format int32
                       - name: maxValue | type: integer | description: Maximum number value.  | validation: format int32
                    - name: booleanInputOptions | type: BooleanInputOptions | description: Options for user input of type `boolean`.  
                       - name: defaultValue | type: boolean | description: Default boolean value.  
                 - name: type | type: Type | description: User input type.  
                         - enum:
                         -     UNKNOWN_USER_INPUT: Unknown input type.
                         -     NUMBER: Number input type.
                         -     BOOLEAN: Boolean input type.
              - name: staticItems | type: StaticItems | description: Static value details.  
                 - name: multiSelect | type: boolean | description: Whether the Wix user can select multiple items  Default: `false`.  
                 - name: staticValues | type: array<StaticItemValue> | description: Static list of values for the Wix user to select.  The value is saved on the automation-level trigger filter, and shown to Wix users at setup time if `displayName` is missing. `displayName` is optionally shown to users to help select a value.  
                    - name: _id | type: string | description: item identifier  | validation: format GUID
                    - name: value | type: string | description: static value  
                    - name: displayName | type: string | description: optional displayName for the value  
           - name: type | type: Type | description: Input value type.  
                 - enum:
                 -     UNKNOWN_VALUE_INPUT: Unknown filter field input.
                 -     ENTITY_SELECTOR: Filter field input is a selection of one from multiple entities, such as a form.
                 -     USER_INPUT: Filter field value is input from a Wix user.
                 -     STATIC_ITEMS: Filter field value is a static value defined in the payload schema.
           - name: label | type: string | description: Input field label.  
           - name: description | type: string | description: Input field description. May be used for a tooltip.  
           - name: required | type: boolean | description: Whether the Wix user is required to enter a value in the field.  Default: `false`  
           - name: reevaluateDynamicSchema | type: boolean | description: Whether Wix should reevaluate the dynamic schema when the field value changes.  Default: `false`  
        - name: followUpFilters | type: array<Filter> | description: Filters to display after first selection is made.  | validation: maxItems 5
     - name: implementedMethods | type: ImplementedMethods | description: Additional [service plugin methods](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/introduction.md#implement-the-service-plugin-methods) implemented for this trigger.  
        - name: validateConfiguration | type: boolean | description: Whether [Validate Configuration](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/validate-configuration.md) is implemented.  Default: `false`.  
        - name: getDynamicSchema | type: boolean | description: Whether [Get Dynamic Schema](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/get-dynamic-schema.md) is implemented.  Default: `false`.  
        - name: refreshPayload | type: boolean | description: Whether [Refresh Payload](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/refresh-payload.md) is implemented.  Default: `false`.  
     - name: _createdDate | type: Date | description: Date and time the trigger was created.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date and time the trigger was last updated.  | read-only: true 
     - name: baseUri | type: string | description: Trigger base URI. Wix calls your trigger at this base address.  Learn more about the [Wix Automations Trigger Provider service plugin](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/introduction.md).  | validation: maxLength 256


```

### Examples

### Get a trigger by app ID and trigger key
```javascript
import { triggerCatalog } from "@wix/automations";

const identifiers = {
  appId: "c721a744-80ea-4305-b0b2-00af08d3a6ed",
  triggerKey: "wix_e_commerce-order_placed",
};

const options = {
  enrichWithIdentitySchema: false,
};

async function getTriggerByAppIdAndKey() {
  const response = await triggerCatalog.getTriggerByAppIdAndKey(
    identifiers,
    options,
  );
  return response;
}

/* Promise resolves to:
 * {
 *   "trigger": {
 *     "appId": "c721a744-80ea-4305-b0b2-00af08d3a6ed",
 *     "triggerKey": "wix_e_commerce-order_placed",
 *     "payloadDataSchema": {
 *       "$schema": "http://json-schema.org/draft-07/schema",
 *       "type": "object",
 *       "properties": {
 *         "orderNumber": { "type": "string", "title": "Order number" },
 *         "currency": { "type": "string", "title": "Currency" },
 *         "contactId": { "type": "string", "format": "uuid", "title": "Contact ID" }
 *       },
 *       "required": ["orderNumber"]
 *     },
 *     "displayName": "Order placed",
 *     "filters": [],
 *     "implementedMethods": {
 *       "validateConfiguration": false,
 *       "getDynamicSchema": false,
 *       "refreshPayload": false
 *     },
 *     "_id": "2315a306-a2f6-4c3e-ac52-08da7c552f2b",
 *     "_createdDate": "2024-01-15T10:30:00.000Z",
 *     "_updatedDate": "2024-01-15T10:30:00.000Z"
 *   }
 * }
 */

```

### getTriggerByAppIdAndKey (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { triggerCatalog } from '@wix/automations';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { triggerCatalog },
  // Include the auth strategy and host as relevant
});


async function getTriggerByAppIdAndKey(identifiers,options) {
  const response = await myWixClient.triggerCatalog.getTriggerByAppIdAndKey(identifiers,options);
};
```

---