Webhook tool

Dynamics 365 AI voice agents that create leads on the call

The agent checks whether the caller is a Dynamics 365 contact, qualifies new callers, and creates a lead through a service of yours that calls the Web API.

Inbound sales agent

Finds the caller in Dynamics 365 and creates leads.

Instructions

Look up the caller by phone number. If they are not a contact, ask for their name, company and what they need, then create a lead. Transfer to sales if they ask for a person, after the lead is created.

Handoff
Sales rep

Connected tools

  • Find contactWebhook
  • Create leadWebhook
  • Transfer to salesTransfer

What a Microsoft Dynamics 365 AI voice agent can do

Open one to watch a call. The grey lines are the tools the agent calls mid-sentence.

Your service filters contacts on telephone1 for the caller's number and returns the name, so the agent can greet them by it.

Tool definitions

Webhook tools go to POST /v1/agents/tools. Transfers are a system tool on the agent. Replace the placeholder values in capitals with your own.

Webhook

Find contact

Looks up a contact by the caller's number.

Show the JSON definition
find_contact
{
  "type": "webhook",
  "name": "find_contact",
  "description": "Finds the caller's Dynamics 365 contact by phone number. Returns the contact's full name, or nothing if there is no match.",
  "pre_tool_speech": "auto",
  "execution_mode": "immediate",
  "response_timeout_secs": 20,
  "api_schema": {
    "url": "https://api.your-company.com/dynamics/contacts",
    "method": "GET",
    "query_params_schema": {
      "properties": {
        "phone": {
          "type": "string",
          "dynamic_variable": "system__caller_id"
        }
      }
    },
    "authentication": {
      "mode": "bearer",
      "token": {
        "type": "secret",
        "secret_value": "YOUR_SERVICE_TOKEN"
      }
    }
  }
}

Webhook

Create lead

Creates a lead through your service.

Show the JSON definition
create_lead
{
  "type": "webhook",
  "name": "create_lead",
  "description": "Creates a lead for a new caller with what they need.",
  "pre_tool_speech": "auto",
  "execution_mode": "immediate",
  "response_timeout_secs": 20,
  "api_schema": {
    "url": "https://api.your-company.com/dynamics/leads",
    "method": "POST",
    "request_body_schema": {
      "type": "object",
      "properties": {
        "first_name": {
          "type": "string",
          "description": "The caller's first name."
        },
        "last_name": {
          "type": "string",
          "description": "The caller's last name."
        },
        "company": {
          "type": "string",
          "description": "The caller's company."
        },
        "topic": {
          "type": "string",
          "description": "A few words on what they want, such as Scheduling module for clinics."
        },
        "notes": {
          "type": "string",
          "description": "What the caller asked for and anything you promised, in two or three sentences."
        },
        "phone": {
          "type": "string",
          "dynamic_variable": "system__caller_id"
        }
      },
      "required": [
        "last_name",
        "company",
        "topic"
      ]
    },
    "authentication": {
      "mode": "bearer",
      "token": {
        "type": "secret",
        "secret_value": "YOUR_SERVICE_TOKEN"
      }
    }
  }
}

Transfer

Transfer to sales

Cold transfer to a sales rep.

Show the JSON definition
transfer_to_sales
{
  "config": {
    "system_tools": {
      "transfer_to_number": {
        "description": null,
        "pre_tool_speech": "auto",
        "transfers": [
          {
            "destination": {
              "type": "phone",
              "phone_number": "+14155550147"
            },
            "condition": "The caller asks to speak with a person, after the lead is created."
          }
        ]
      }
    }
  }
}

Set it up

No native connector. The tools call a service of yours, which signs in to Microsoft Entra ID as an application user and calls the Dataverse Web API. Vendor details read in November 2026.

  1. Register an app in Entra ID

    Register an application in your Microsoft Entra ID tenant and add a client secret or certificate. Your service requests tokens with the scope of your environment URL followed by /.default.

  2. Create an application user

    In the Power Platform admin center, create an application user bound to that app, with a custom security role that can read contacts and create leads. It does not use a paid license.

  3. Run the two endpoints

    Your service calls GET /api/data/v9.2/contacts with a $filter on telephone1, and POST /api/data/v9.2/leads with subject, firstname, lastname, companyname, telephone1 and description.

  4. Add the tools

    Point the tools at your service with a bearer secret. Both read system__caller_id, so the agent never asks for the number.

Before you build

Why not call Dynamics directly

Entra ID access tokens expire after about an hour by default. A webhook tool sends the value you stored, so it would stop working within the hour. Your service gets a new token.

Match phone formats

telephone1 holds whatever format your team typed, so an exact match on +14155550123 misses (415) 555-0123. Normalize numbers in your service before you compare them.

Service protection limits

Dataverse allows each user 6,000 requests in a five-minute sliding window per web server, then returns 429 with a Retry-After header. One agent's calls stay far below it.

Lead is a Dynamics 365 table

Microsoft documents lead in the Dynamics 365 table reference, not the base Dataverse one. On an environment without it, create a contact or a custom table row instead.

Enterprise-grade security

  • HIPAA compliant badge

    HIPAA compliant

  • SOC 2 Type 2 badge

    SOC 2 Type 2

  • GDPR badge

    GDPR

Microsoft Dynamics 365 AI voice agent FAQs

Does Dynamics 365 have an AI voice agent?

Yes. Microsoft documents voice agents built in Copilot Studio that run on the voice channel of Dynamics 365 Contact Center, with phone numbers linked to a workstream. A Cartesia agent is an option when you don't run Contact Center, or want your own voice, LLM and carrier, and only need to read contacts and create leads through the Dataverse Web API.

How do I connect Dynamics 365 to an AI voice agent?

Register an app in Microsoft Entra ID, create an application user for it in Power Platform admin with a role that reads contacts and creates leads, and run a small service that gets tokens and calls the Dataverse Web API. Cartesia's webhook tools call that service. Entra ID tokens expire after about an hour, which is why the service sits in between.

Does the application user need a Dynamics 365 license?

No. An application user bound to your Entra ID app doesn't use a paid license. It needs a security role that can read contacts and create leads, and nothing more.

Can it create Customer Service cases instead of leads?

Yes, if your service posts to the table your Customer Service app uses. The tools keep the same shape. Check the table's required columns in your environment first.

Who bills the phone minutes on a Dynamics 365 voice agent?

Cartesia bills the agent at $0.03/min, plus LLM usage and telephony. Phone minutes depend on the number. Cartesia-provisioned numbers are US only and carry Cartesia's telephony fee. Numbers from your Twilio account or a SIP trunk pay your carrier's rates instead. Dataverse API requests from one agent stay far below Microsoft's service protection limits.

Get started today

Talk to an expert.

Connect with a member of our team and learn how Cartesia can help you build world-class voice experiences.

Contact Sales

Start building.

Access our models via API and bring a voice agent into production in minutes.

Try Cartesia