Case management · Part 6 of 7
Expose it
Give a customer portal a secure read endpoint for case summaries with Logic API, and let an AI assistant answer SLA questions through Logic Conductor.
What you’ll build
Section titled “What you’ll build”Your case logic now runs inside Dataverse. In this part you open it to two new consumers. First, you design a Logic API endpoint that a customer portal calls to show a case summary, and you make sure a customer can read only their own cases. Second, on Dataverse, you build a small Get case SLA flow and expose it as an MCP tool, so that an AI assistant connected to Logic Conductor can answer “What’s the SLA for case CAS-01001-A1B2C3?” from the same formula your recipe and process use.
Before you begin
Section titled “Before you begin”- Complete Part 5: Orchestrate the escalation.
- For the API: the Logic Fabric API Builder and Logic Fabric API Builder Tools solutions are installed, and your organization runs an API host that signs portal users in. Agree with the team that runs the host on a user property that carries the signed-in contact’s ID. See Install and host Logic API.
- For the AI tool (Dataverse only): Logic Conductor is set up for the
Case Managementproject, and you have an AI client connected to it. See Set up Logic Conductor.
Design the portal endpoint
Section titled “Design the portal endpoint”The portal shows a customer the title, number, priority, status and creation date of a case. You expose these with a Read action on the Case table.
-
In the Logic Fabric API Builder app, create an API named
Customer Portal APIin theCase Managementproject. Creating the API creates its first draft. -
Open the draft in API Studio: select the version whose Version is
Draft, then Flowon APIOpen in Studio. -
Under Context > User, select Add user property and add
contactIdwith Type Unique Identifier. The host fills it in when a customer signs in. -
Select Modules > Add module and enter
Serviceas the Module name. -
In the module, select Entities > Add entities, select Add next to the Case table (
incident) and close the panel. -
Open the
incidententity and select Add read action. Work through its steps:Step Setting Definition Action Name summaryDocs Title Case summary, descriptionReturns the summary of one of the signed-in customer's cases.Data Fetcher Look up the case’s customer. Access Control Authorization Policy: Demand Authenticated User. Precondition: the case’s customer equals the caller’s contactId; Error CodeNOT_YOUR_CASE; Error MessageYou can only view your own cases.Properties title,ticketnumber,prioritycode,statuscode,createdon -
Press Ctrl+S. The header shows Saved at and no issues button.
-
Back in the app, select the draft and Flowon APIPublish Major Version, then confirm.
Callers reach the action at GET /service/incident/{id}/summary. A portal request and its answer look like this:
GET /service/incident/3f2a9c1e-5b7d-4e8a-9f10-2c3d4e5f6a7b/summaryAuthorization: Bearer eyJ0eXAiOi...{ "title": "Router drops connection", "ticketnumber": "CAS-01001-A1B2C3", "prioritycode": 1, "statuscode": 1, "createdon": "2026-10-19T09:00:00Z"}Test the endpoint
Section titled “Test the endpoint”Ask the portal team, or use an HTTP client with tokens from your host, to call the action three times:
| Caller | Expected answer |
|---|---|
| No token | 401 with UNAUTHORIZAD_ACCESS |
| A customer, for a case of their own | 200 OK with the summary |
| A customer, for another customer’s case | Refused with NOT_YOUR_CASE and the message You can only view your own cases. |
A case ID that does not exist returns 404 Not Found. See Responses and errors.
Answer SLA questions in an AI assistant
Section titled “Answer SLA questions in an AI assistant”Dataverse (cloud)Expose as MCP ToolApplies to the other edition
AI tools are available in Logic Fabric for Dataverse only. On-premises, skip this section, or make the flow callable from other systems with Expose as Action.
An assistant asks about a case by its number, so the tool takes the case number as text, finds the case and calls the Case response due date formula.
-
Create a logic flow named
Get case SLAin theCase Managementproject. -
On the Docs tab, add the Title
Get case SLAand the DescriptionReturns when the first response to a case is due under the service desk SLA, and how many working days are left. Use it when someone asks about a case's SLA, response deadline or due date. -
Add the input
CaseNumber(Text, Must have a value on, descriptionThe case number, for example CAS-01001-A1B2C3) and the outputsResponseDue(Date and Time) andWorkingDaysLeft(Whole Number). -
On the Flow tab, add these steps:
# Step type Step name Settings 1 Execute Query FindCaseMultiplicity Single. Query on Case with the columns Created On and Priority, where Case Number equals CaseNumber.2 Condition NotFoundCondition: Null FindCase. In Then, add Raise Error with Error CodeCASE_NOT_FOUNDand Error MessageConcatenate("No case found with number ", CaseNumber).3 Run Logic Block SlaDueCase response due datewithCreatedOn=FindCase.createdonandPriority=FindCase.prioritycode.4 Set Output DoneResponseDue=SlaDue.Output.result.WorkingDaysLeft=BusinessDaysDif(Now, SlaDue.Output.result). -
Turn on Expose as MCP Tool and save.
-
Run the flow once from the Run dialog with the number of your test case, to check the outputs.
-
Ask your administrator to restart Logic Conductor. It builds its list of tools when it starts.
In your AI client, refresh the tools: get_case_sla appears (with the project name in front when Conductor exposes several projects). Ask:
What’s the SLA for case CAS-01001-A1B2C3?
The assistant calls get_case_sla with the case number and answers with the due date and the working days left, for example “The first response is due on Thursday, October 22. That is 2 working days from now.” When the case is overdue, Business Days Between returns a negative number, which the assistant can report as overdue. A wrong case number returns your CASE_NOT_FOUND message.
The tool runs as the signed-in user, with their Dataverse permissions: a user who cannot read a case gets no answer about it. The flow only reads data, but because flow tools can change data in general, keep exposed flows small and give them a precise description. See How Logic Conductor works.
Check your work
Section titled “Check your work”- The
Customer Portal APIhas a published version with thesummaryaction, its Access shows Signed-in users, and a customer can read only their own cases. - On Dataverse,
get_case_slaappears in your AI client, and its answer matches the due date in the triage email for the same case.
Continue with Part 7: Deploy, where you move the whole project to a test environment with the Logic Fabric CLI.