> 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

# CopyInputMapping

# Package: actions

# Namespace: ActionCatalogService

# Method link: https://dev.wix.com/docs/api-reference/business-management/automations/actions/action-catalog/copy-input-mapping.md

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

## Introduction

Retrieves a copy of an action's input mapping, with any per-action unique values regenerated.

Used by the automations editor when a Wix user duplicates an action that contains values, such as IDs, that must remain unique across multiple actions. If the action's service plugin implements `DuplicateInputMapping`, the input mapping is passed through it; otherwise, the original input mapping is returned unchanged.

---

## REST API

### Schema

```
 Method: copyInputMapping
 Description: Retrieves a copy of an action's input mapping, with any per-action unique values regenerated.  Used by the automations editor when a Wix user duplicates an action that contains values, such as GUIDs, that must remain unique across multiple actions. If the action's service plugin implements `DuplicateInputMapping`, the input mapping is passed through it; otherwise, the original input mapping is returned unchanged.
 URL: https://www.wixapis.com/v1/actions/copy
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  appId, actionKey, inputMapping
 Method parameters: 
   param name: actionKey | type: actionKey | description: Action key.  Learn about [adding an action to your app](https://dev.wix.com/docs/api-reference/business-management/automations/actions/add-an-action-to-your-app.md). | required: true | validation: maxLength 100
   param name: appId | type: appId | description: GUID of the app that defines the action. | required: true | validation: format GUID
   param name: inputMapping | type: inputMapping | description: Input mapping to copy. | required: true 
 Return type: CopyInputMappingResponse
  - name: inputMapping | type: object | description: Copied input mapping, with any per-action unique values regenerated.  

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: ACTION_SPI_NOT_FOUND | Description: The requested action does not have a matching service plugin implementer.


```

### Examples

### Copy input mapping
```curl
curl -X POST 'https://www.wixapis.com/v1/actions/copy' \
    -H 'Authorization: <AUTH>' \
    -H 'Content-Type: application/json' \
    -d '{
      "appId": "e4c3e640-0b63-4bd9-8574-53f8c14e0236",
      "actionKey": "send-gift-card",
      "inputMapping": {
        "contactId": "{{var(\"contact.id\")}}",
        "amount": 50,
        "giftCardId": "b7e2f8a1-3c4d-4e5f-a6b7-8c9d0e1f2a3b"
      }
    }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.automations.actionCatalog.copyInputMapping(appId, options)
 Description: Retrieves a copy of an action's input mapping, with any per-action unique values regenerated.  Used by the automations editor when a Wix user duplicates an action that contains values, such as GUIDs, that must remain unique across multiple actions. If the action's service plugin implements `DuplicateInputMapping`, the input mapping is passed through it; otherwise, the original input mapping is returned unchanged.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  appId, options.actionKey, options.inputMapping, options
 Method parameters: 
   param name: appId | type: string | description: GUID of the app that defines the action. | required: true | validation: format GUID
   param name: options | type: CopyInputMappingOptions  none | required: true 
        - name: actionKey | type: string | description: Action key.  Learn about [adding an action to your app](https://dev.wix.com/docs/api-reference/business-management/automations/actions/add-an-action-to-your-app.md). | required: true | validation: maxLength 100
        - name: inputMapping | type: object | description: Input mapping to copy. | required: true 
 Return type: PROMISE<CopyInputMappingResponse>
  - name: inputMapping | type: object | description: Copied input mapping, with any per-action unique values regenerated.  

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: ACTION_SPI_NOT_FOUND | Description: The requested action does not have a matching service plugin implementer.


```

### Examples

### Copy input mapping
Copies an action's input mapping with unique values regenerated.

```javascript
import { actionCatalog } from "@wix/automations";

async function copyInputMapping() {
  const response = await actionCatalog.copyInputMapping({
    appId: "e4c3e640-0b63-4bd9-8574-53f8c14e0236",
    actionKey: "send-gift-card",
    inputMapping: {
      contactId: "{{var(\"contact.id\")}}",
      amount: 50,
      giftCardId: "b7e2f8a1-3c4d-4e5f-a6b7-8c9d0e1f2a3b",
    },
  });
  return response;
}

/* Promise resolves to:
 * {
 *   "inputMapping": {
 *     "contactId": "{{var(\"contact.id\")}}",
 *     "amount": 50,
 *     "giftCardId": "d9f4a2c3-5e6f-7a8b-c9d0-1e2f3a4b5c6d"
 *   }
 * }
 */

```

### copyInputMapping (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 { actionCatalog } from '@wix/automations';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function copyInputMapping(appId,options) {
  const response = await myWixClient.actionCatalog.copyInputMapping(appId,options);
};
```

---