Skip to navigation

Zapier and the API

The API lets your other tools, such as a website form, your CRM or a Zap, send contacts into SparkOps, opt someone out, or end a campaign. Webhooks go the other way, telling those tools what happened next.

The full reference, with every request, field and webhook and examples to copy, is at app.sparkops.com/developers. Setup › API links to it as the API reference.

Where: Setup › API

Who can do it: owners and managers make, show and revoke keys, and add, test and remove endpoints. Everyone can see the page.

Make a key

  1. Go to Setup › API. Under Keys, press Create a key.
  2. Give it a Name for where it will be used, such as Zapier or your website, and press Create key.
  3. Press Copy, keep the key somewhere safe, and press I’ve copied it.

Anyone with the key can start campaigns, opt people out and end conversations for your business. Each row shows the key’s first characters, who made it, and when it was last used.

To see a key again, press Show beside it, and Hide to put it away. To stop a key working, press Revoke, then Revoke key. Every request with it is refused from then on, and anything using it stops working until it has a new key.

Connect SparkOps to Zapier

SparkOps has its own app in Zapier. It’s private: you add it to your Zapier account with SparkOps’s invitation.

  1. Make a key named Zapier.
  2. In Setup › API, under Connect Zapier, press Add SparkOps to Zapier, and accept the invitation in Zapier.
  3. In a Zap, choose SparkOps for a trigger or an action. When Zapier asks you to connect, paste the key.

No Connect Zapier card yet? Ask us to turn it on: email support@sparkops.com. Meanwhile, use Webhooks by Zapier (below).

Hear what happened, in a Zap

Choose one of SparkOps’s triggers. Each has a Campaign choice: All campaigns (the default), or one campaign by its name.

TriggerWhen it runs
New ConversationA conversation starts.
New ActivityA text arrives from a contact, or one goes to them.
New CallA call with a contact ends.
Contact Needs a PersonA conversation needs a person on your team.
Contact QualifiedA contact reaches a result: a booking, a time to call, the details you wanted, or a transfer.
Contact Not a FitA contact is closed as not a fit, with the reason.
Contact Opted OutSomeone asks to stop getting texts, however they say it.

Test trigger in Zapier shows your newest real ones of that kind, or an example when you have none yet. Each answer the contact gave arrives as a field of its own, and everything they told us arrives in Summary. A Zap runs the moment it happens. It shows in Zaps listening while it’s on.

Start, end or opt out, from a Zap

  • Start Conversation: pick the Campaign, the Phone, and any of the contact’s other details. How they came to you is Inquiry for someone who just asked you to get in touch (the first text goes at once) or Outreach for anyone else (the first text waits for their texting hours, and your business hours if you set them). Testing the step in Zapier is real: the campaign starts for that phone.
  • End a Conversation: finds the person by Contact ID, Phone, CRM ID or Conversation ID, and ends their active conversation now, as Closed, no result.
  • Opt Someone Out: finds the person by Contact ID, Phone or CRM ID, with an optional Note, and stops every text from your business to them. See Opt-outs and landlines.

When SparkOps says no for a reason you’d expect, such as the person already being in an active conversation, the Zap’s run is Stopped with SparkOps’s words, not an error.

Or use Webhooks by Zapier

Zaps built before the SparkOps app can keep using Zapier’s own Webhooks by Zapier steps. Setup › API’s card has everything to copy.

  1. After your Zap’s trigger, add the action Webhooks by Zapier, event POST.
  2. Set the URL from the card, and Payload Type to json.
  3. Under Data, add phone and campaign_id (copy it from Campaign ids), and any other details you have, such as first_name, last_name, email and crm_id.
  4. Add entry as outreach for anyone who didn’t just ask you to get in touch. Leave it out for someone who just asked.
  5. Under Headers, add Authorization with Bearer, a space, and your key.
  6. Test the step. A test is a real request: the campaign starts for the phone it sends.

Hear what happened next, at your own address

  1. Under Webhooks, press Add an endpoint.
  2. Paste the URL to send to, starting https://: your CRM’s webhook address, or a Zapier Catch Hook’s.
  3. Under Events, every one starts ticked. Untick any you don’t want, and press Add endpoint.
  4. Copy the signing secret and press I’ve copied it. SparkOps won’t show it again.
  5. Press Send a test event. It says “Delivered: it answered 200.”, or why not.

The events are New conversation, Activity, Call, Needs a person, Qualified, Not a fit and Opted out, matching the triggers above. An endpoint’s events are chosen when it’s added and can’t be changed after. To change them, add the endpoint again, then remove the old one. The new endpoint has a new signing secret.

A call sends one event when it’s over, with who answered, how long it lasted and, for a call the AI answered, what was said. The recording is never sent. Texts and calls are separate events: Activity carries a text, Call carries a call.

Zaps listening

When a Zap uses a SparkOps trigger, it shows under Webhooks, in Zaps, with its trigger, its campaign, and its last delivery. To stop one from SparkOps, press Remove, then Remove Zap. The Zap stays on in Zapier but hears nothing more, so turn it off in Zapier too.

Good to know

  • The signing secret lets your code check a webhook came from SparkOps. A plain Zapier Catch Hook doesn’t check signatures, so there you can ignore it.
  • A webhook that doesn’t get through is tried again for about a day.
  • Latest deliveries lists the newest 20: the event, the endpoint, whether it was Delivered, Waiting, Trying again, Failed or Not sent, and the last answer.
  • Remove beside an endpoint, then Remove endpoint, stops anything more going there.
  • The same contact sent twice while their conversation is going starts one conversation. A field left blank changes nothing about the contact.
  • Campaign ids lists only published, live campaigns.
  • Webhooks carry what the contact told us, each answer on its own and all of it in one text, named by each question’s Saves as name. See Questions and conditions.
  • Webhooks carry a text’s words, never its pictures. A text that’s only pictures or files reaches them as “[attachment]”.

Still need help? Email support@sparkops.com.