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.

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 configured under Settings → Escalation for disputed transaction cases (see Step 4)

Steps

1. Find 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)

2. Create the agent

const agent = await bimpe.agents.create(
  {
    name: "Lost and stolen card agent",
    system_prompt:
      "You handle inbound calls from customers reporting a lost or stolen card. " +
      "Verify identity by asking for full name and date of birth. " +
      "Collect the last four digits of the affected card and the date it was lost or stolen. " +
      "Ask whether any unauthorised transactions have been noticed. " +
      "Confirm the block has been initiated via the card management integration. " +
      "Log the incident. Provide the replacement card delivery timeline from the policy knowledge base. " +
      "If the customer reports disputed transactions, escalate to the fraud team.",
    agent_workflow_id: workflow.id,
  },
  { idempotencyKey: "create-lost-card-agent-v1" },
);

console.log(agent.id);
agent = client.agents.create(
    name="Lost and stolen card agent",
    system_prompt=(
        "You handle inbound calls from customers reporting a lost or stolen card. "
        "Verify identity by asking for full name and date of birth. "
        "Collect the last four digits of the affected card and the date it was lost or stolen. "
        "Ask whether any unauthorised transactions have been noticed. "
        "Confirm the block has been initiated via the card management integration. "
        "Log the incident. Provide the replacement card delivery timeline from the policy knowledge base. "
        "If the customer reports disputed transactions, escalate to the fraud team."
    ),
    agent_workflow_id=workflow.id,
    idempotency_key="create-lost-card-agent-v1",
)

print(agent.id)

3. Add knowledge bases

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 configured in the dashboard

The API cannot create channel connections or integrations. Inbound voice is connected through the phone number you configure in the Console dashboard. There is no voice value in the SDK channel filter — voice conversations are routed through the dashboard phone number. The card management API, incident logging system, and escalation email are all connected and configured in the dashboard. Escalation email is set under Settings → Escalation.

  1. Open Console dashboardAgents → select your agent.
  2. Under Channels, connect an inbound voice phone number.
  3. Under Integrations, connect your card management API for real-time block confirmation.
  4. Under Integrations, connect your incident logging system for automatic case creation.
  5. Under Settings → Escalation, enter the fraud team email address for disputed transaction cases.

5. 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",
    system_prompt:
      "You handle inbound calls for lost or stolen cards. Verify identity, collect last four " +
      "card digits and date of loss, ask about unauthorised transactions, confirm the block, " +
      "log the incident, and give the replacement timeline. Escalate disputes to the fraud team.",
    agent_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",
    system_prompt=(
        "You handle inbound calls for lost or stolen cards. Verify identity, collect last four "
        "card digits and date of loss, ask about unauthorised transactions, confirm the block, "
        "log the incident, and give the replacement timeline. Escalate disputes to the fraud team."
    ),
    agent_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

Store your API key in BIMPEAI_API_KEY. Confirm that the card management API and incident logging system both appear in integrations.list before routing live calls — a missing card management connection means block confirmation will fail silently on the call. Update replacement timelines via knowledgeBases.update whenever your SLAs change.

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