Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Invoke custom AI Agent from external via REST API

kas11
Tera Contributor
We are trying to invoke the custom AI Agent from an external (3rd Party) REST API call, but we are encountering some issues. Notably, it is working fine with out-of-the-box (OOB) agents, but we face problems with the custom-created AI agent under AI Agent Studio.
Is there anything in ServiceNow that might be preventing this from working, such as capability or plugin activation issues?
Any recommendations or advice would be appreciated, please. Let us know if you need more details from our side. 
 
Note: REST API script was created in Scripted REST Resource that enables the pre-built agent (named AISASearchUtil()).
 
Thanks in advance for your help!
 
Regards,
KS
4 REPLIES 4

abirakundu23
Giga Sage

Hi @kas11 ,

Please check the below points if it's help :
It's means your Scripted REST API is correct only problem for using custom AI Agent.

Confirm the agent is Published and API accessible
Check for necessary plugins (especially com.glide.ai.runtime)
Test agent execution via Script Background
Ensure proper roles provided for Custom AI agent execution (e.g., sn_ais.agent_user)

Please mark helpful and correct answer if it's worthy for you.

rpriyadarshy
Giga Guru

Can you Post the error Logs and execution pla  here- sys_gen_ai_log_metadata    sn_aia_execution_plan

 

Regards

RP

VNK1216
Tera Guru

@kas11 How did you invoke the AI agent from third party application?

Could you pls share the link to the API documentation?

#agenticAPI #api