We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

How to call Agentic AI via Rest API call

Not applicable

We have built some Agentic AI which needs to be called by third party apps via Rest API.

How to call Agentic AI via Rest API call?

3 REPLIES 3

JerryJ071847183
Tera Sage

check this video it will be good starting point for your usecase.

warren_chan
ServiceNow Employee

Try the Agent Invoker API:

 

var request = {
	targetRecordId: "25b65a1c936339100c8a30118bba10c7",
	targetTable: "incident",
	usecaseId: "78c687369f19d2d02b2d1597d90a1c97",
	conversationUser: "46d44a23a9fe19810012d100cca80666",
	objective: "Help me resolve the incident INC0010252",
	conversationLabel: "INC0010252: Incident Resolution"
};
var aiAgentRuntimeUtil = new AiAgentRuntimeUtil();
var response = aiAgentRuntimeUtil.startAiAgentConversation(request);
gs.info(JSON.stringify(response));

Sorry i am new to this i create an agent using agent studio how do i find these variable values for that particular agent "usecaseId" i couldn't find this and could you please help me with this