Marketplace

Import SMS template to multiple automations

POST
/api/marketplace/{id}/import-to-automations

Import the SMS template body of a marketplace listing into one or more automations owned by the caller, in a single Mongo transaction. Each target automation must be SMS-enabled; per-automation failures are returned in failed[] with a 207 partial-success status when at least one target imported cleanly.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/marketplace/string/import-to-automations" \  -H "Content-Type: application/json" \  -d '{    "automationIds": [      "5f7b1c2e8a1d4e0012c3b4a5",      "6a8c2d3f9b1e5a0023d4c5b6"    ]  }'
{  "success": true,  "message": "Template imported to 2 of 3 automations",  "results": [    {      "automationId": "64a1b2c3d4e5f6001234567a",      "automationName": "New lead - first reply",      "success": true,      "changes": {        "smsEnabled": true,        "phoneNumber": "+14165550100",        "message": "Hi {{contact.firstName}}!"      }    },    {      "automationId": "64a1b2c3d4e5f6001234567b",      "automationName": "Tour follow-up",      "success": false,      "error": "SMS notification already enabled and conflicts with existing settings"    }  ],  "stats": {    "total": 3,    "successful": 2,    "failed": 1  }}