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

Service Mapping via API

FrancescoM50066
Tera Contributor

Hi all,

do you know if is there the possibility to launch Service Mapping via API?

5 REPLIES 5

Schaganti
Giga Expert

Hi @FrancescoM50066,
Yes it is possible! You can trigger Service Mapping via the ServiceNow REST API. Here are a few ways to do it:
1. Using the Service Mapping REST API
ServiceNow provides out of the box REST endpoints to trigger mapping runs. You can use the Discovery API to kick off a Service Mapping job programmatically.
2. Using a Background Script / Scripted REST API
You can write a custom Scripted REST API that internally triggers the mapping using ServiceNow's DiscoveryAPI script include.
3. Using Table API
You can insert a record into the sa_pattern_map_run table via the Table API to trigger a mapping run.

Hope this Helps!

I have looked fo the Service Mapping REST API but I didn't found it. @Schaganti  could you please indicate me its name? If you are referring to the Discovery API at this link , what should I use to run the service mapping on a determined endpoint?

That API is actually for Discovery not Service Mapping — they are two different things so it won't work for your use case!

For Service Mapping, try using the Table API on the sa_pattern_map_run table to trigger a mapping run on your target endpoint.

Just to confirm — are you looking to trigger Discovery or Service Mapping? That'll help narrow down the right approach!

Thank you for your answer.

yes, I would like to trigger service mapping towards an endpoint or using tag based service mapping.