Choose | When you want the agent to… | Example |
API action | Call an external API and use the result in its reply, or update another system. | Look up today’s pickup hours for a specific store. |
Workflow action | Start an automation in Spur, with details collected from the conversation if needed. | Tag a wholesale inquiry, create a ticket, and send a confirmation. |
To get started, go to AI Agents, open your agent, and select Capabilities → Custom actions. If you haven’t created a custom action yet, you’ll see API action and Workflow action cards instead of the Add buttons.
Set up an API action
Have your API’s URL, HTTP method, authentication requirements, and a sample response handy.
Click Add API action. In Define, enter an Action name using lowercase letters, numbers, and underscores, such as
lookup_pickup_hours.Under When should your agent use this?, explain when to call the API and what to do if a detail is missing. For example: “Use this when a customer asks about pickup hours. If they haven’t specified a store, ask which location before calling. If the lookup fails, say you couldn’t verify the hours rather than guessing.”
Under Available channels, select where the action should be available. Under Parameters, add the inputs the API needs from the conversation. For this example, add
store_codeas a String and describe the expected value, such asdowntown.Click Next. In Configure, choose the HTTP method and enter the Endpoint. Use
{{parameter_name}}to insert a value from the conversation. For example, chooseGETand enterhttps://api.example.com/stores/{{store_code}}/pickup-hours(replace the example URL with your own). Add any required authentication under Headers, not in the agent’s instructions. If your endpoint expects a Request body, use Key-Value or Raw JSON and insert parameters where needed.Have your endpoint return only the data the agent needs, such as the store name and opening hours. Don’t include secrets or unrelated customer data in the response, and don’t rely on Map specific fields to remove sensitive fields.
Under Test request, enter a sample value such as
downtownand click Test. Check the HTTP status and response, then click Create action. The action is enabled when created; you can turn it off from the Custom actions list.
API tests send real requests. Use a sandbox endpoint and test records, especially if the request creates, changes, or deletes anything. A successful request test verifies the API call, not whether the agent chooses it or answers correctly.
Set up a workflow action
Click Add workflow action and enter a Name, such as
Wholesale inquiry.Under When should your agent use this?, describe the customer’s intent and any details to collect first. For example: “Use this when a customer asks to buy wholesale. Ask for the product category if it isn’t clear. Don’t use this for retail orders.”
Choose a Channel that this same agent is connected to. For example, if your workspace has two WhatsApp numbers, select the one where this agent handles wholesale inquiries. Check the agent’s Channels tab if you’re unsure. Use a one-to-one WhatsApp, Instagram, or Messenger conversation for workflow actions, not email, website live chat, or WhatsApp groups.
If the workflow needs information from the chat, click Add variable under Variables to collect. Give each variable a name, type (String, Number, or Boolean), and description. For this example, add
product_categoryas a String. You can refer to it in the workflow as{{trigger.product_category}}.Click Create & open workflow. Spur opens a new workflow in the builder with an AI Agent Trigger already in place. Add and connect the steps you want, such as Add Contact Tag, Create ticket, or Send Message. Click Save in the builder.
Decide who sends the confirmation
Click AI Agent Trigger in the workflow builder to find AI replies after triggering workflow. It’s on by default for new workflow actions. Leave it on if the workflow works behind the scenes and you want the agent to acknowledge the request. Turn it off if the workflow sends its own confirmation and you don’t want an extra AI message. If it’s off and the workflow has no message step, the customer won’t get a reply from that turn. Click Save after changing it.
Test the conversation before relying on it
API action: After testing the request, try a sample conversation in Test agent using a safe API endpoint. For example, ask “When can I pick up my order?” without a store name. Check that the agent asks for the location, uses the returned hours once you supply it, and does not invent hours if the lookup fails.
Workflow action: Test agent simulates starting a workflow; it doesn’t run the steps. For an end-to-end check, use a fresh test conversation on the exact channel you selected. Confirm that the workflow appears in its execution history, that the expected tag or ticket exists, and that the customer got the intended message.
If the action doesn’t run: Check that it’s enabled on the agent serving that conversation. For a workflow, also check that the workflow is saved and enabled and that it’s bound to the exact channel you tested. Make the When should your agent use this? instructions more specific if the customer’s request could match several actions.
