Skip to main content

Creating a Custom AI Action in Spur

Turn a chat request into a real‑world operation—collect data, trigger webhooks, push records into your CRM—without a single line of code.

Updated over a week ago

1 · Open the Actions Workspace

  1. In the left rail, choose AI → Actions.

  2. Click Create New Action under Create Custom Action.


2 · Step 1 — Define

Field

What to enter

Why it matters

Action Name

snake_case_identifier (earlyAccessSignup)

Must be unique; no spaces. Acts like a function name.

When to use this action

One sentence goal + 1‑2 trigger examples.Example: “Use when a user asks to join FlowRipple’s early‑access program.”

The LLM reads this to decide when to call the action. Clarity = accuracy.

Parameters

Click Add for each input you need.phone_numberSTRING – “The user’s phone number.”nameSTRING – “The user’s full name.”

Parameters become variables you can insert in the API request. If missing, the agent will ask the user.

Available Channels

Tick WhatsApp, Instagram, Facebook, Live Chat as needed.

Keeps the action from firing in channels that can’t support it.

After filling, it should look like this:

Click Next →.


3 · Step 2 — Configure the HTTP Request

  1. Request Method – choose POST (or GET, PUT, etc.).

  2. Request URL – paste your endpoint e.g. https://api.yourservice.com/early-access.

  3. Body / Query / Headers – Click + Add Field and type the JSON key (name, phone). In the value column, insert parameters via +Param{{name}}, {{phone_number}}.

  4. Authentication – add headers like Authorization: Bearer <token> if required.

Tip: Anything wrapped in {{double_curly_braces}} is replaced at runtime.

Click Save.


4 · Step 3 — Response Handling

Choose one of two modes:

  • Send Full Response – quickest. The entire JSON payload goes to the agent for summarisation.

  • Map Specific Fields – (advanced) expose only certain keys. Ideal for large or sensitive responses.

Press Run Test to fire a sample request; confirm the response shape. Then Save Configuration.


5 · Step 4 — Enable the Action

Return to AI → Actions and toggle your new card on.

Done! The action is live. From now on, any time a user expresses interest in early access, the agent will collect the name & phone, call your endpoint, and reply with a confirmation.


6 · See it in Action

Notice the ⚡️ “AI used earlyAccessSignup action” flag in the transcript. That line tells agents exactly which function was executed.


7 · Monitor & Debug

Open AI → Automations to view execution logs—payloads, timestamps, and outcomes:

Use View Trigger to inspect the exact request/response for any run.


8 · Best‑practice Checklist

  1. Crystal‑clear triggers – the “When to use” text is your primary guard‑rail.

  2. Validate with Test – catch 400s/401s before users do.

  3. Limit response size – under 20 KB keeps latency low.

  4. Secure keys – never hard‑code secrets in URLs; use headers or environment vars.

  5. Iterate – tweak prompts & parameters based on real logs.


9 · Troubleshooting

Symptom

Likely cause

Fix

Action never fires

Trigger description too vague

Add explicit keywords / phrases.

Agent keeps asking for a parameter

Field name typo or Type mismatch

Ensure param names exactly match {{variable}} placeholders.

401 Unauthorized

Missing/expired token

Add/update Authorization header.

AI response contains raw JSON

Use a follow‑up system prompt like “Summarise the success message to the user.”


10 · Next Steps

  • Replicate this flow for order tracking, subscription upgrade, or any custom workflow.

  • Combine multiple Custom Actions to create end‑to‑end automations.

Happy building! 🚀

Did this answer your question?