Create or Update Routing Rules

POST {{baseUrl}}/services/:serviceID/routing-rules

This endpoint creates or updates the routing rules for the given service. If default rules not found it creates otherwise it updates the new rules. Requires access_token as a Bearer {{token}} in the Authorization header with write scope.

Request Body

{"rules"=>[{"expression"=>"<string>", "route_to"=>{"entity_type"=>"<string>", "entity_id"=>"<string>"}}, {"expression"=>"<string>", "route_to"=>{"entity_type"=>"<string>", "entity_id"=>"<string>"}}]}

HEADERS

KeyDatatypeRequiredDescription
Authorizationnull
Content-Typestring

RESPONSES

status: Created

{&quot;data&quot;:{&quot;id&quot;:&quot;5d8b23427c870edd41453c25&quot;,&quot;created_at&quot;:&quot;2019-09-25T08:20:18.884Z&quot;,&quot;updated_at&quot;:&quot;2019-09-25T08:20:18.884Z&quot;,&quot;deleted_at&quot;:null,&quot;service_id&quot;:&quot;5d81d9687000fb6b9def7e35&quot;,&quot;organization_id&quot;:&quot;5d81d9187000fb6b9def7e32&quot;,&quot;rules&quot;:[{&quot;expression&quot;:&quot;re(current.labels.alertname, \&quot;^CPUThrottlingHigh.*\&quot;) \u0026\u0026 re(past.labels.alertname, \&quot;^CPUThrottlingHigh.*\&quot;)&quot;,&quot;route_to&quot;:{&quot;entity_type&quot;:&quot;escalationpolicy&quot;,&quot;entity_id&quot;:&quot;5d81d9407000fb6b9def7e33&quot;}},{&quot;expression&quot;:&quot;re(current.labels.alertname, \&quot;^CPUThrottlingHigh.*\&quot;) \u0026\u0026 re(past.labels.alertname, \&quot;^CPUThrottlingHigh.*\&quot;)&quot;,&quot;route_to&quot;:{&quot;entity_type&quot;:&quot;squad&quot;,&quot;entity_id&quot;:&quot;5d8b5976578cc3b845cb3608&quot;}},{&quot;expression&quot;:&quot;re(current.labels.alertname, \&quot;^CPUThrottlingHigh.*\&quot;) \u0026\u0026 re(past.labels.alertname, \&quot;^CPUThrottlingHigh.*\&quot;)&quot;,&quot;route_to&quot;:{&quot;entity_type&quot;:&quot;user&quot;,&quot;entity_id&quot;:&quot;5d81d9187000fb6b9def7e31&quot;}}]}}