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
2 REPLIES 2

abirakundu23
Mega 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
Mega Guru

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

 

Regards

RP