Use casesRecipes

Lost or Stolen Card Support

Answer inbound calls from customers who have lost their card or had it stolen, capture the details, initiate a block, log the incident, and confirm a replacement is on the way.

DifficultyIntermediate
TrackBuilder Track or Developer Track
ChannelsVoice (Inbound)
IntegrationsCard management APIIncident logging systemEscalation email

What you'll build

An agent that handles inbound calls from customers reporting a lost or stolen card. It verifies identity, captures the last four digits and date of loss, asks about any unauthorised transactions, confirms the block via your card management integration, logs the incident, and gives the customer a replacement card timeline — all without a human in the loop for standard reports.

Customer journey

A customer who lost their card calls your bank line. The agent verifies identity, captures card details and loss date, confirms the block through your card management integration, logs the incident, and gives a replacement card timeline — escalating disputed transactions to a human.

Loading diagram…

See Deploying and testing channels for connect and test steps per channel.

Prerequisites

  • BimpeAI account with an API key (sk_…)
  • Read Anatomy of a workflow agent first — this recipe skips steps covered there
  • Card management API and incident logging system connected in the Console dashboard (see Step 4)
  • Inbound voice phone number connected in the Console dashboard (see Step 4)
  • Escalation email for disputed transaction cases configured under Settings → Agent (see Step 4)

Steps

1. Find or create the workflow

import { BimpeAI } from "@bimpeai/sdk";

const bimpe = new BimpeAI({ apiKey: process.env.BIMPEAI_API_KEY! });

const page = await bimpe.workflows.list({ scope: "public", search: "lost stolen card" });
const workflow = page.data[0];
console.log(workflow.id, workflow.name);
import os
from bimpeai import BimpeAI

client = BimpeAI(api_key=os.environ["BIMPEAI_API_KEY"])

page = client.workflows.list(scope="public", search="lost stolen card")
workflow = page.data[0]
print(workflow.id, workflow.name)

Or build a new workflow from scratch with workflows.create instead of finding one. name and system_prompt are required; it returns the new Workflow whose id you bind the agent to. See Anatomy of a workflow agent for the full set of optional fields like rules and flows.

const workflow = await bimpe.workflows.create({
  name: "Lost and stolen card agent",
  system_prompt: "You handle inbound lost-or-stolen card calls, verify identity, confirm the block, log the incident, and give a replacement timeline.",
});
console.log(workflow.id);
workflow = client.workflows.create(
    name="Lost and stolen card agent",
    system_prompt="You handle inbound lost-or-stolen card calls, verify identity, confirm the block, log the incident, and give a replacement timeline.",
)
print(workflow.id)

2. Create the agent

const agent = await bimpe.agents.create(
  {
    name: "Lost and stolen card agent",
    description: "Handles inbound lost-or-stolen card calls, confirms the block, logs the incident, and escalates disputes.",
    workflow_id: workflow.id,
  },
  { idempotencyKey: "create-lost-card-agent-v1" },
);

console.log(agent.id);
agent = client.agents.create(
    name="Lost and stolen card agent",
    description="Handles inbound lost-or-stolen card calls, confirms the block, logs the incident, and escalates disputes.",
    workflow_id=workflow.id,
    idempotency_key="create-lost-card-agent-v1",
)

print(agent.id)

3. Add knowledge bases (optional)

Knowledge bases are optional; an agent whose workflow and integrations already cover everything it needs to say can skip this step. This recipe uses one to ground the agent in the details it must quote accurately.

Add the card replacement policy and block procedure so the agent gives accurate timelines and instructions without improvising.

await bimpe.agents.knowledgeBases.create(agent.id, {
  type: "text",
  name: "Card replacement policy",
  content:
    "Standard replacement: 3–5 business days by post.\n" +
    "Expedited replacement (lost abroad or critical need): 1–2 business days, £10 fee.\n" +
    "Temporary virtual card: issued immediately via the banking app after block is confirmed.\n" +
    "Replacement PIN sent separately by post, 1 business day after the card.",
});

await bimpe.agents.knowledgeBases.create(agent.id, {
  type: "text",
  name: "Block procedure",
  content:
    "Card blocks are initiated via the card management integration connected in the dashboard.\n" +
    "The block takes effect immediately once confirmed.\n" +
    "Pending authorised transactions will still clear.\n" +
    "A confirmation SMS is sent to the customer automatically once the block is active.",
});
client.agents.knowledge_bases.create(agent.id, {
    "type": "text",
    "name": "Card replacement policy",
    "content": (
        "Standard replacement: 3–5 business days by post.\n"
        "Expedited replacement (lost abroad or critical need): 1–2 business days, £10 fee.\n"
        "Temporary virtual card: issued immediately via the banking app after block is confirmed.\n"
        "Replacement PIN sent separately by post, 1 business day after the card."
    ),
})

client.agents.knowledge_bases.create(agent.id, {
    "type": "text",
    "name": "Block procedure",
    "content": (
        "Card blocks are initiated via the card management integration connected in the dashboard.\n"
        "The block takes effect immediately once confirmed.\n"
        "Pending authorised transactions will still clear.\n"
        "A confirmation SMS is sent to the customer automatically once the block is active."
    ),
})

4. Connect channels and integrations (dashboard)

Voice and integrations are connected in the dashboard

The API cannot create channel connections, but integrations can now be configured through it; see Configuring integrations. Connect telephony for inbound voice on the Deploy screen and your card management and incident logging integrations on the Integrations screen of the Console dashboard. Telephony conversations use the telephony channel value and are filterable through the SDK. The SDK lists what is active but cannot modify channel connections.

  1. In the Console dashboard, pick your agent from the switcher at the top, then open Deploy.
  2. Under Voice, click Set up on the Telephony card — it is an add-on with usage-based pricing. Provision or link an inbound number under Team settings → Phone numbers, then set the agent's voice and greeting under Settings → Voice.
  3. On the Integrations screen, open the Custom API tab and wire up your card management API (see Configuring integrations) so the agent can confirm the block in real time.
  4. In the same Custom API tab, wire up your incident logging system so the agent can create a case for each report.
  5. Under Settings → Agent, set the Escalation Email for disputed transaction cases.

Connect Telephony (inbound)

Customers dial your published support or sales line.

  1. Open Deploy and click Set up on the Telephony card (usage-based add-on).
  2. Under Team settings → Phone numbers, provision or link a number and assign it to this agent.
  3. Under Settings → Voice, choose the voice profile and greeting callers hear.
  4. Share the published phone number — inbound calls route to the agent automatically.

Full reference: Deploying and testing channels.

5. Test your agent

Before going live, place a test call — is_test_call: true uses BimpeAI test telephony and consumes no live minutes. Fetch the test code first to confirm telephony is enabled.

Test Telephony (inbound)

Human tester: dial the linked phone number from a mobile phone and walk through the script.

Playground: use Playground → Voice to hear the agent before publishing the number.

Full reference: Deploying and testing channels.

const { channels } = await bimpe.agents.getTestCode(agent.id);
console.log("Telephony enabled:", channels.telephony.is_enabled);

const call = await bimpe.calls.make(agent.id, {
  destination: "<tester-phone>",
  is_test_call: true,
});
console.log("Test call:", call.status);
test_code = client.agents.get_test_code(agent.id)
print("Telephony enabled:", test_code.channels.telephony.is_enabled)

call = client.calls.make(agent.id, {"destination": "<tester-phone>", "is_test_call": True})
print("Test call:", call.status)

See Test your agent for the other test channels and the pause-AI rule.

6. Verify and go live

const integrations = await bimpe.agents.integrations.list(agent.id);
console.log("Integrations:", integrations.map((i) => i.name));
integrations = client.agents.integrations.list(agent.id)
print("Integrations:", [i.name for i in integrations])

Full example

import { BimpeAI } from "@bimpeai/sdk";

const bimpe = new BimpeAI({ apiKey: process.env.BIMPEAI_API_KEY! });

// 1. Find workflow
const page = await bimpe.workflows.list({ scope: "public", search: "lost stolen card" });
const workflow = page.data[0];

// 2. Create agent
const agent = await bimpe.agents.create(
  {
    name: "Lost and stolen card agent",
    description: "Handles inbound lost-or-stolen card calls, confirms the block, logs the incident, and escalates disputes.",
    workflow_id: workflow.id,
  },
  { idempotencyKey: "create-lost-card-agent-v1" },
);

// 3. Add knowledge bases
await bimpe.agents.knowledgeBases.create(agent.id, {
  type: "text",
  name: "Card replacement policy",
  content:
    "Standard: 3–5 business days. Expedited: 1–2 days, £10 fee.\n" +
    "Virtual card available immediately via banking app after block.",
});

await bimpe.agents.knowledgeBases.create(agent.id, {
  type: "text",
  name: "Block procedure",
  content:
    "Block via card management integration. Immediate effect.\n" +
    "Pending authorised transactions still clear. SMS confirmation sent automatically.",
});

// 4. Verify integrations (must be connected in dashboard before going live)
const integrations = await bimpe.agents.integrations.list(agent.id);
console.log("Agent ID:", agent.id);
console.log("Integrations:", integrations.map((i) => i.name));

// 5. Voice calls arrive via the inbound number configured in the dashboard.
//    Completed conversations can be listed here.
const conversations = await bimpe.conversations.list(agent.id);
console.log("Conversations:", conversations.data.length);
import os
from bimpeai import BimpeAI

client = BimpeAI(api_key=os.environ["BIMPEAI_API_KEY"])

# 1. Find workflow
page = client.workflows.list(scope="public", search="lost stolen card")
workflow = page.data[0]

# 2. Create agent
agent = client.agents.create(
    name="Lost and stolen card agent",
    description="Handles inbound lost-or-stolen card calls, confirms the block, logs the incident, and escalates disputes.",
    workflow_id=workflow.id,
    idempotency_key="create-lost-card-agent-v1",
)

# 3. Add knowledge bases
client.agents.knowledge_bases.create(agent.id, {
    "type": "text",
    "name": "Card replacement policy",
    "content": (
        "Standard: 3–5 business days. Expedited: 1–2 days, £10 fee.\n"
        "Virtual card available immediately via banking app after block."
    ),
})

client.agents.knowledge_bases.create(agent.id, {
    "type": "text",
    "name": "Block procedure",
    "content": (
        "Block via card management integration. Immediate effect.\n"
        "Pending authorised transactions still clear. SMS confirmation sent automatically."
    ),
})

# 4. Verify integrations (must be connected in dashboard before going live)
integrations = client.agents.integrations.list(agent.id)
print("Agent ID:", agent.id)
print("Integrations:", [i.name for i in integrations])

# 5. Voice calls arrive via the inbound number configured in the dashboard.
#    Completed conversations can be listed here.
conversations = client.conversations.list(agent.id)
print("Conversations:", len(conversations.data))

Deploy and go live

Go-live checklist

  • Store your API key in BIMPEAI_API_KEY (server-side only).
  • Confirm Card management API appears in integrations.list or is connected in the dashboard.
  • Confirm Incident logging system appears in integrations.list or is connected in the dashboard.
  • Verify Telephony (inbound) is connected on the Deploy screen (agents.channels.list shows it enabled).
  • Set Escalation Email under Settings → Agent if humans must take over.
  • Switch the agent to live with updateLiveStatus / update_live_status.
  • Monitor the Conversations screen (or stream via SDK) after launch.
  • Set Escalation Email for disputed transaction cases.

After go-live

Update replacement timelines via knowledgeBases.update when SLAs change. Review call transcripts with conversations.list filtered by channel telephony.

Variations

  • Offer expedited replacement proactively to callers who say they are abroad by adding a prompt instruction checking for the keyword.
  • Pull the call transcript after each conversation using conversations.messages.list and attach it to the incident log record automatically.
  • Add a second identity verification knowledge base entry with acceptable formats for higher-risk callers who cannot confirm date of birth.

On this page