Set up an automation
sprkly_create_automation_from_templateSet up one ready-made automation on one Instagram account and turn it on. This is the same as Go live in the app. It starts replying to real people right away, so show the user the template, the account, the word and the link first. Pass template_id from sprkly_list_automation_templates and profile_id from sprkly_list_profiles. With one Instagram account that can run automations, profile_id can be left out. With several and no profile_id, it sets up nothing and returns needsAccountChoice with the accounts: ask the user which one, then call again with profile_id. If asks_for has post, pass post_id: the sprkly id of an Instagram post on that account, from sprkly_list_scheduled_posts. It can be posted already or still scheduled: a scheduled one starts answering once it is posted. If it does not, leave post_id out. If asks_for has link, pass a full https link. Links are checked: a link that looks like WhatsApp but is not wa.me, a link with look-alike or accented letters, and a link that hides where it goes with a part before an @ are refused (link_required). Links typed into message, comment_reply, faq answers and fallback get the same checks (link_refused, invalid_faq), and there http is fine too. If asks_for has whatsapp, pass phone (the full number with the country code, like 6591234567), whatsapp_username, or both: the DM gets a Chat on WhatsApp button for each. prefill is optional there: the first message typed in for them when WhatsApp opens, "" for none. WhatsApp usernames are still rolling out, so a phone number is the safe choice. If asks_for has telegram, pass telegram_link: a t.me link to the group or channel, or @name. The DM gets a Join on Telegram button. keyword is optional and defaults to the template's word. message is optional and replaces the DM, or the public reply on a template that only replies in the comments. comment_reply is optional on a template that fires on a comment and also sends a DM: the public reply under their comment. It replaces the reply the template comes with, and "" means no public reply. It is refused on every other template. On first-comment-on-post, message is required: the comment sprkly adds under each new Instagram post it publishes on that account (up to 2,200 characters). That one is on every paid plan, and an account can have one live. The coupon template is refused until message holds the real code instead of YOUR-CODE. If asks_for has faq, pass faq: 1 to 10 { keyword, answer } pairs. Each pair becomes its own automation that answers a DM of that word. fallback is optional there and becomes the account's default reply, for a DM with none of the words. It replaces any default reply already on that account, and turns it on if it was off, so tell the user first. A word another live automation already answers is refused. Calling again with the same list skips the words already live. ends_at is optional: when it switches itself off, as an ISO 8601 time with a time zone. It has to be in the future. With faq, the fallback default reply has no end: it stays on after ends_at. campaign is optional: a label up to 60 characters, to group automations by. name is optional: what it is called in the list, up to 100 characters. Left out, it is named after its word and post. Use sprkly_pause_automation to stop it sooner. One DM per person per post: someone who already got an automated DM on a post gets no second one there, even from another automation or a new comment. That skip is normal, not a fault. The owner gets an email when an automation goes live through here.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"template_id": "<template_id>"
},
"name": "sprkly_create_automation_from_template"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| faq | No | Only when asks_for has faq. The words people DM you and the answer each one gets. | |
| link | No | The https link the DM sends. Only when the template asks for a link. Refused: a link that does not start with https://, a link that looks like WhatsApp but is not wa.me, a link with look-alike or accented letters, and a link that hides where it goes with a part before an @. | |
| name | No | Optional. What the automation is called in the list, like "LINK on my spring reel". Up to 100 characters. Not used with faq. | |
| phone | No | Only when asks_for has whatsapp. The WhatsApp phone number with the country code, like 6591234567. Spaces, + and dashes are fine. | |
| ends_at | No | Optional. When it switches itself off, as an ISO 8601 time in the future with a time zone, like 2026-10-30T21:00:00+08:00. Leave it out for no end. The faq fallback stays on after it. | |
| keyword | No | The word people comment or send. Defaults to the template's word. | |
| message | No | Your own words for the DM, for the public reply on a reply-only template, or for the comment on first-comment-on-post. | |
| post_id | No | The sprkly id of the Instagram post to watch, posted or still scheduled. Only when the template asks for a post. | |
| prefill | No | Only when asks_for has whatsapp. The first message typed in for them when the chat opens. Defaults to "Hi! I saw your post on Instagram." "" means none. | |
| campaign | No | Optional. A campaign label, up to 60 characters, like "Spring launch". Shown in sprkly_list_automations. | |
| fallback | No | Only with faq. The reply to a DM with none of the words. It replaces any default reply on the account and turns it on. | |
| profile_id | No | The Instagram account to set it up on. Needed when more than one account can run automations. | |
| template_id | Yes | The template id from sprkly_list_automation_templates. | |
| comment_reply | No | Optional. The public reply under their comment, on a comment template that also sends a DM. "" means none. Leave it out to keep the reply the template comes with. | |
| telegram_link | No | Only when asks_for has telegram. The Telegram group or channel: https://t.me/yourgroup, an invite link like https://t.me/+AbC123, or @yourgroup. | |
| whatsapp_username | No | Only when asks_for has whatsapp. The WhatsApp username, with or without @. Pass phone, this, or both. |