Updates an existing targeting rule identified by its numeric ID.
Reference
POST https://YOUR-NETWORK-DOMAIN/rest-api/rule/{ruleId}/update.do
Updates an existing targeting rule identified by its numeric ID. The request body is a JSON object with the fields to update: name, type, active status, default-for flags, and an optional ruleMatches array. Missing fields in the request body are populated from the existing rule's values, allowing partial updates. In ruleMatches, a match sent by id changes only the fields it carries, a match without id is added, and the rule's matches the request does not list stay (remove one with matches/remove); an id that is not one of this rule's matches is refused with 400 and nothing changes. Duplicate rule match entries are rejected with a validation error. Returns a JSON object with 'success: true' on success, or validation error details. Requires authentication and UPDATE permission on the RULES static ACL identity.
Path Params
ruleIdintegerrequired
The unique numeric identifier of the rule to update
200
Body
A JSON body. An example, built from the field definitions:
using var client = new HttpClient();
var request = new HttpRequestMessage(new HttpMethod("POST"), "https://YOUR-NETWORK-DOMAIN/rest-api/rule/200/update.do");
request.Headers.Add("X-Api-Key", "YOUR_API_KEY");
request.Content = new StringContent("{\"id\":\"200\",\"name\":\"Block Adult Content\",\"active\":\"true\",\"type\":\"CAMPAIGN\"}", Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());