Dataverse Ask APIs: Query Your Data in Natural Language

Hello everyone and welcome to my blog. Over my last few posts we have watched agents get smarter around Dataverse – calling your Custom APIs through the MCP Server, and grounding themselves on your tables as knowledge. Today I want to put a developer hat back on and look at something that I think is genuinely exciting – the Dataverse Ask APIs. In short, they let your own application ask Dataverse a question in plain English and get the answer back, rows and all. No hand-written OData query, no FetchXML – just a question.

Imagine POSTing “which open opportunities have the highest estimated revenue?” and getting back the matching records plus a tidy natural-language summary. That is exactly what we are going to do. Let’s dig in.

So what are the Ask APIs?

In Microsoft’s own words, the Dataverse Ask APIs let your application ask natural-language questions about business data stored in Microsoft Dataverse. You define a semantic model – essentially a named set of tables that are relevant to a business scenario – and then you submit questions against that model. What comes back can include the rows that answer the question, a natural-language summary, source links to the records, a count of matching rows, and a paging token.

It is worth being clear about where this fits. The classic Web API is still your tool when you know exactly what you want – precise CRUD and OData queries. The Ask API is for when the input is a natural-language question rather than a structured query. Think of them as complementary – one for precision, one for questions. And if you have been following along, this rounds out a nice trio: the MCP Server lets agents act, knowledge grounding lets agents answer, and now the Ask APIs let your code ask.

A brand new endpoint – /api/iq

First thing to note – this is not the usual /api/data/ OData surface. The Ask APIs live under a new base path:

https://<your-environment>.crm.dynamics.com/api/iq/v1.0/

There is no $select, $filter or $expand here, and no metadata document – it is a small, purpose-built REST surface. There is also no SDK wrapper yet, so you simply call it with any authenticated HTTP client. There are really just two things to learn: creating a semantic model, and asking a question.

Step 1: Define a semantic model

Before you can ask anything, you tell Dataverse which tables are in scope for your scenario. You do that by creating a semantic model with a unique name and a list of logical table names.

POST [Organization URI]/api/iq/v1.0/semanticmodel
Authorization: Bearer <access-token>
Content-Type: application/json

{
    "uniqueName": "Sales pipeline",
    "tables": [ "account", "opportunity" ]
}

A successful call returns 201 Created. Behind the scenes, creating the model indexes the tables you selected (so it does consume some Dataverse database storage – worth keeping in mind for large tables). You can list your existing models with a simple GET:

GET [Organization URI]/api/iq/v1.0/semanticmodel

And remove one by its id (note – you delete by the model’s GUID, not its name):

DELETE [Organization URI]/api/iq/v1.0/semanticmodel/{id}

Step 2: Ask your question

Now the fun part. POST your question to the ask endpoint, referencing the semantic model by its unique name.

POST [Organization URI]/api/iq/v1.0/ask
Authorization: Bearer <access-token>
Content-Type: application/json

{
    "query": "Which open opportunities have the highest estimated revenue?",
    "semanticModelName": "Sales pipeline",
    "searchMode": "Auto",
    "count": 100
}

A quick word on the inputs:

  • query – your natural-language question (required).
  • semanticModelName – the exact unique name of the model you created (required).
  • searchMode – optional, defaults to Auto. You can also pass QuickResponse for a faster, lighter answer or ThinkDeeper when you want the service to work harder on a tricky question.
  • count – optional page size, defaults to 100. For more, use the pagingToken that comes back in the response.

What you get back

The response is where it gets nice. You get both the raw data and a human-readable summary:

{
    "summary": "The Contoso renewal has the highest estimated revenue.",
    "rawResult": [
        {
            "opportunity": "Contoso renewal",
            "account": "Contoso",
            "estimatedRevenue": 125000
        }
    ],
    "citationLinks": [ "https://<your-environment>.crm.dynamics.com/main.aspx?..." ],
    "totalResultCount": 1,
    "pagingToken": null
}
  • rawResult – an array of objects that answer the question. The shape depends on the question you asked, so treat it loosely rather than binding to a fixed schema.
  • summary – a natural-language sentence you can show straight to a user.
  • citationLinks – links back to the underlying records, which is lovely for letting users click through and verify.
  • totalResultCount and pagingToken – for paging. When pagingToken is null, there are no more pages.

One honest note – the response does not hand you the generated SQL or FetchXML behind the answer, so this is about getting answers, not about reverse-engineering a query.

Your app a question from a user POST /api/iq/v1.0/ask query + semanticModelName Dataverse Ask API Semantic model scope: account, opportunity Your security applies only data the caller can see Response summary + rows + citation links answer
The Ask API flow: your app POSTs a plain-language question, the service matches it against your semantic model while honouring your security, and hands back a summary with rows and citation links.

Authentication and – importantly – security

Authentication is the familiar Microsoft Entra ID OAuth flow – you send an Authorization: Bearer <access-token> header, exactly as you would for the Web API. For a user-delegated scenario you request the user_impersonation scope, and for server-to-server you use a Dataverse application user with .default.

Here is the part I really like, and it is the question everyone asks about AI over business data – does it respect my security? Yes. Ask calls require the calling identity to have Read access on the tables and columns in the model, and crucially, record ownership, business unit access, sharing, and column-level security all affect the results. In other words, users only get answers from data they are already allowed to see. Managing the models themselves (create and delete) needs a role with those privileges – the Dataverse Search Role, Environment Maker, System Customizer or System Administrator will do.

One operational limit to design around – each user can send up to 30 Ask requests per organization per minute. Go over and you get a 429 back with a Retry-After header, so build in a sensible retry.

Before you rush off to try it

There is one prerequisite that will stop you in your tracks if you miss it. The Ask APIs are part of the Dataverse intelligence family, so you need Business Applications in Work IQ turned on for your environment, from the Power Platform admin center. If your ask calls come back complaining that a required environment capability is not enabled, that is almost certainly what is missing – have a word with your administrator. You will also, naturally, need read access to the tables in your semantic model.

Web API or Ask API?

To round off, a simple rule of thumb. If you know the exact rows and columns you want and you can express it as a query, reach for the Web API – it is precise, deterministic and fully featured. If your input is a question from a human – a search box, a chat experience, a “just tell me the answer” button – reach for the Ask API and let it do the interpreting. Used together, they cover both ends of how applications talk to Dataverse.

Final thoughts

The Ask APIs are a small surface with a big idea behind them – letting your applications meet your users where they are, in plain language, while still honouring every bit of your Dataverse security. Define a semantic model, point a question at it, and render the summary and rows. I think this is going to find its way into a lot of internal apps and portals over the next year. Give it a try once Work IQ is enabled in your environment, and let me know in the comments what you build.

For the endpoints, the request and response details, and the setup steps, refer to Microsoft’s documentation:

Hope this helped. You will also like the below posts.

Debajit Dutta


Discover more from Debajit's Power Apps & Dynamics 365 Blog

Subscribe to get the latest posts sent to your email.

Leave a Comment

Your email address will not be published. Required fields are marked *

Discover more from Debajit's Power Apps & Dynamics 365 Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading