This endpoint is used to validate the user's action configuration.
Wix calls this endpoint when a site contributor configures an automation with your action, and when they select the automation from the Your automations list in the Automations dashboard. Wix uses the returned response to display an error message to a site contributor if the action is invalid.
Implementing this endpoint is optional. To implement it, select the endpoint under Action's service plugin Endpoints when editing your action in the app dashboard. If you don't implement this endpoint, Wix assumes that the action is always valid.
As an example, a user configures an action called “Send gift card”, where a gift card is identified by a unique UUID. After some period of time the user deletes the gift card, making the action’s mapping with the current UUID invalid. Validate Configuration checks the validity of the action’s input values, and returns an error to the user if one or more of the values is not valid.
Action key as defined in your app's action configuration in the app dashboard.
For example, send-email
or generate-invoice
.
Stringified object representing the mapping a site contributor made between keys in the input schema and their expected values when running the automation. A field can be a static value mapping, or an expression that will be evaluated dynamically on each activation.
Whether the action configuration is valid.
Error details for an invalid action configuration. These are the errors displayed to the user.
Validate Configuration request with a sample response body
curl -X POST https://provider.example.com/v1/validate-configuration \
-H 'user-agent: Wix' \
-H 'accept-encoding: gzip, deflate' \
-H 'content-type: text/plain; charset=utf-8' \
-d '{
"actionKey": "email-client",
"inputMapping": "{
\"accountId\": \"some guid\",
\"to\": \"some-email@example.com\",
\"subject\": \"Welcome email\",
\"body\": \"Hello there!\"
}"
}'
{
"valid": false,
"configurationErrors": [
{
"fieldKey": "accountId",
"message": "accountId does not exist",
"ctaLabel": "Create an account",
"ctaUrl": "https://www.example.com/create-account",
"title": "Account not found."
}
]
}