curl --request PATCH \
--url https://api.datalyr.com/v1/rules/{ruleId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"rule": {
"name": "<string>",
"event_name": "<string>",
"platform_standard_event": "<string>",
"description": "<string>",
"trigger_event_source": "web",
"platform_asset_id": "<string>",
"value_type": "none",
"value_static": 123,
"value_path": "<string>",
"currency": "<string>",
"parameter_mappings": [
{
"id": "<string>",
"platformParameter": "<string>",
"dataPath": "<string>"
}
],
"user_data_mappings": [
{
"id": "<string>",
"platformParameter": "<string>",
"dataPath": "<string>"
}
],
"snap_app_id": "<string>",
"test_event_code": "<string>",
"enabled": true
},
"dry_run": false
}
'import requests
url = "https://api.datalyr.com/v1/rules/{ruleId}"
payload = {
"rule": {
"name": "<string>",
"event_name": "<string>",
"platform_standard_event": "<string>",
"description": "<string>",
"trigger_event_source": "web",
"platform_asset_id": "<string>",
"value_type": "none",
"value_static": 123,
"value_path": "<string>",
"currency": "<string>",
"parameter_mappings": [
{
"id": "<string>",
"platformParameter": "<string>",
"dataPath": "<string>"
}
],
"user_data_mappings": [
{
"id": "<string>",
"platformParameter": "<string>",
"dataPath": "<string>"
}
],
"snap_app_id": "<string>",
"test_event_code": "<string>",
"enabled": True
},
"dry_run": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
rule: {
name: '<string>',
event_name: '<string>',
platform_standard_event: '<string>',
description: '<string>',
trigger_event_source: 'web',
platform_asset_id: '<string>',
value_type: 'none',
value_static: 123,
value_path: '<string>',
currency: '<string>',
parameter_mappings: [{id: '<string>', platformParameter: '<string>', dataPath: '<string>'}],
user_data_mappings: [{id: '<string>', platformParameter: '<string>', dataPath: '<string>'}],
snap_app_id: '<string>',
test_event_code: '<string>',
enabled: true
},
dry_run: false
})
};
fetch('https://api.datalyr.com/v1/rules/{ruleId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.datalyr.com/v1/rules/{ruleId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'rule' => [
'name' => '<string>',
'event_name' => '<string>',
'platform_standard_event' => '<string>',
'description' => '<string>',
'trigger_event_source' => 'web',
'platform_asset_id' => '<string>',
'value_type' => 'none',
'value_static' => 123,
'value_path' => '<string>',
'currency' => '<string>',
'parameter_mappings' => [
[
'id' => '<string>',
'platformParameter' => '<string>',
'dataPath' => '<string>'
]
],
'user_data_mappings' => [
[
'id' => '<string>',
'platformParameter' => '<string>',
'dataPath' => '<string>'
]
],
'snap_app_id' => '<string>',
'test_event_code' => '<string>',
'enabled' => true
],
'dry_run' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.datalyr.com/v1/rules/{ruleId}"
payload := strings.NewReader("{\n \"rule\": {\n \"name\": \"<string>\",\n \"event_name\": \"<string>\",\n \"platform_standard_event\": \"<string>\",\n \"description\": \"<string>\",\n \"trigger_event_source\": \"web\",\n \"platform_asset_id\": \"<string>\",\n \"value_type\": \"none\",\n \"value_static\": 123,\n \"value_path\": \"<string>\",\n \"currency\": \"<string>\",\n \"parameter_mappings\": [\n {\n \"id\": \"<string>\",\n \"platformParameter\": \"<string>\",\n \"dataPath\": \"<string>\"\n }\n ],\n \"user_data_mappings\": [\n {\n \"id\": \"<string>\",\n \"platformParameter\": \"<string>\",\n \"dataPath\": \"<string>\"\n }\n ],\n \"snap_app_id\": \"<string>\",\n \"test_event_code\": \"<string>\",\n \"enabled\": true\n },\n \"dry_run\": false\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.datalyr.com/v1/rules/{ruleId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rule\": {\n \"name\": \"<string>\",\n \"event_name\": \"<string>\",\n \"platform_standard_event\": \"<string>\",\n \"description\": \"<string>\",\n \"trigger_event_source\": \"web\",\n \"platform_asset_id\": \"<string>\",\n \"value_type\": \"none\",\n \"value_static\": 123,\n \"value_path\": \"<string>\",\n \"currency\": \"<string>\",\n \"parameter_mappings\": [\n {\n \"id\": \"<string>\",\n \"platformParameter\": \"<string>\",\n \"dataPath\": \"<string>\"\n }\n ],\n \"user_data_mappings\": [\n {\n \"id\": \"<string>\",\n \"platformParameter\": \"<string>\",\n \"dataPath\": \"<string>\"\n }\n ],\n \"snap_app_id\": \"<string>\",\n \"test_event_code\": \"<string>\",\n \"enabled\": true\n },\n \"dry_run\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.datalyr.com/v1/rules/{ruleId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"rule\": {\n \"name\": \"<string>\",\n \"event_name\": \"<string>\",\n \"platform_standard_event\": \"<string>\",\n \"description\": \"<string>\",\n \"trigger_event_source\": \"web\",\n \"platform_asset_id\": \"<string>\",\n \"value_type\": \"none\",\n \"value_static\": 123,\n \"value_path\": \"<string>\",\n \"currency\": \"<string>\",\n \"parameter_mappings\": [\n {\n \"id\": \"<string>\",\n \"platformParameter\": \"<string>\",\n \"dataPath\": \"<string>\"\n }\n ],\n \"user_data_mappings\": [\n {\n \"id\": \"<string>\",\n \"platformParameter\": \"<string>\",\n \"dataPath\": \"<string>\"\n }\n ],\n \"snap_app_id\": \"<string>\",\n \"test_event_code\": \"<string>\",\n \"enabled\": true\n },\n \"dry_run\": false\n}"
response = http.request(request)
puts response.read_body{
"dry_run": true,
"applied": true,
"diff": {
"action": "<string>",
"resource": {
"type": "conversion_rule",
"id": "<string>",
"label": "<string>"
},
"prior_state": {},
"new_state": {},
"changes": [
{
"field": "<string>",
"from": "<unknown>",
"to": "<unknown>"
}
],
"effects": [
{
"type": "postback_target",
"summary": "<string>",
"platform": "<string>",
"ad_account_id": "<string>",
"asset_id": "<string>",
"asset_field": "<string>",
"endpoint_url_masked": "<string>",
"trigger_event": "<string>",
"trigger_event_source": "<string>",
"platform_event": "<string>",
"active": true,
"operation": "put",
"key": "<string>",
"path": "<string>",
"requires_approval": true,
"approver_roles": [
"<string>"
],
"review_surface": "<string>",
"supersedes": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
]
},
"audit_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"data": {
"rule_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"event_name": "<string>",
"trigger_event_source": "<string>",
"target_platform": "<string>",
"platform_asset_id": "<string>",
"ad_account_id": "<string>",
"platform_standard_event": "<string>",
"value_type": "<string>",
"value_static": 123,
"value_path": "<string>",
"currency": "<string>",
"parameter_mappings": [
{
"id": "<string>",
"platformParameter": "<string>",
"dataPath": "<string>"
}
],
"user_data_mappings": [
{
"id": "<string>",
"platformParameter": "<string>",
"dataPath": "<string>"
}
],
"enabled": true,
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>"
}
}{
"error": "<string>"
}{
"error": "<string>",
"code": "insufficient_scope",
"required_scope": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Update a conversion rule
Change a conversion rule. Only the fields you send change; the rest keep their current values. The merged result is validated in full, so a patch cannot leave a rule in a state a create would have rejected.
Set enabled: false to stop a rule firing without deleting it.
curl --request PATCH \
--url https://api.datalyr.com/v1/rules/{ruleId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"rule": {
"name": "<string>",
"event_name": "<string>",
"platform_standard_event": "<string>",
"description": "<string>",
"trigger_event_source": "web",
"platform_asset_id": "<string>",
"value_type": "none",
"value_static": 123,
"value_path": "<string>",
"currency": "<string>",
"parameter_mappings": [
{
"id": "<string>",
"platformParameter": "<string>",
"dataPath": "<string>"
}
],
"user_data_mappings": [
{
"id": "<string>",
"platformParameter": "<string>",
"dataPath": "<string>"
}
],
"snap_app_id": "<string>",
"test_event_code": "<string>",
"enabled": true
},
"dry_run": false
}
'import requests
url = "https://api.datalyr.com/v1/rules/{ruleId}"
payload = {
"rule": {
"name": "<string>",
"event_name": "<string>",
"platform_standard_event": "<string>",
"description": "<string>",
"trigger_event_source": "web",
"platform_asset_id": "<string>",
"value_type": "none",
"value_static": 123,
"value_path": "<string>",
"currency": "<string>",
"parameter_mappings": [
{
"id": "<string>",
"platformParameter": "<string>",
"dataPath": "<string>"
}
],
"user_data_mappings": [
{
"id": "<string>",
"platformParameter": "<string>",
"dataPath": "<string>"
}
],
"snap_app_id": "<string>",
"test_event_code": "<string>",
"enabled": True
},
"dry_run": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
rule: {
name: '<string>',
event_name: '<string>',
platform_standard_event: '<string>',
description: '<string>',
trigger_event_source: 'web',
platform_asset_id: '<string>',
value_type: 'none',
value_static: 123,
value_path: '<string>',
currency: '<string>',
parameter_mappings: [{id: '<string>', platformParameter: '<string>', dataPath: '<string>'}],
user_data_mappings: [{id: '<string>', platformParameter: '<string>', dataPath: '<string>'}],
snap_app_id: '<string>',
test_event_code: '<string>',
enabled: true
},
dry_run: false
})
};
fetch('https://api.datalyr.com/v1/rules/{ruleId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.datalyr.com/v1/rules/{ruleId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'rule' => [
'name' => '<string>',
'event_name' => '<string>',
'platform_standard_event' => '<string>',
'description' => '<string>',
'trigger_event_source' => 'web',
'platform_asset_id' => '<string>',
'value_type' => 'none',
'value_static' => 123,
'value_path' => '<string>',
'currency' => '<string>',
'parameter_mappings' => [
[
'id' => '<string>',
'platformParameter' => '<string>',
'dataPath' => '<string>'
]
],
'user_data_mappings' => [
[
'id' => '<string>',
'platformParameter' => '<string>',
'dataPath' => '<string>'
]
],
'snap_app_id' => '<string>',
'test_event_code' => '<string>',
'enabled' => true
],
'dry_run' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.datalyr.com/v1/rules/{ruleId}"
payload := strings.NewReader("{\n \"rule\": {\n \"name\": \"<string>\",\n \"event_name\": \"<string>\",\n \"platform_standard_event\": \"<string>\",\n \"description\": \"<string>\",\n \"trigger_event_source\": \"web\",\n \"platform_asset_id\": \"<string>\",\n \"value_type\": \"none\",\n \"value_static\": 123,\n \"value_path\": \"<string>\",\n \"currency\": \"<string>\",\n \"parameter_mappings\": [\n {\n \"id\": \"<string>\",\n \"platformParameter\": \"<string>\",\n \"dataPath\": \"<string>\"\n }\n ],\n \"user_data_mappings\": [\n {\n \"id\": \"<string>\",\n \"platformParameter\": \"<string>\",\n \"dataPath\": \"<string>\"\n }\n ],\n \"snap_app_id\": \"<string>\",\n \"test_event_code\": \"<string>\",\n \"enabled\": true\n },\n \"dry_run\": false\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.datalyr.com/v1/rules/{ruleId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rule\": {\n \"name\": \"<string>\",\n \"event_name\": \"<string>\",\n \"platform_standard_event\": \"<string>\",\n \"description\": \"<string>\",\n \"trigger_event_source\": \"web\",\n \"platform_asset_id\": \"<string>\",\n \"value_type\": \"none\",\n \"value_static\": 123,\n \"value_path\": \"<string>\",\n \"currency\": \"<string>\",\n \"parameter_mappings\": [\n {\n \"id\": \"<string>\",\n \"platformParameter\": \"<string>\",\n \"dataPath\": \"<string>\"\n }\n ],\n \"user_data_mappings\": [\n {\n \"id\": \"<string>\",\n \"platformParameter\": \"<string>\",\n \"dataPath\": \"<string>\"\n }\n ],\n \"snap_app_id\": \"<string>\",\n \"test_event_code\": \"<string>\",\n \"enabled\": true\n },\n \"dry_run\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.datalyr.com/v1/rules/{ruleId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"rule\": {\n \"name\": \"<string>\",\n \"event_name\": \"<string>\",\n \"platform_standard_event\": \"<string>\",\n \"description\": \"<string>\",\n \"trigger_event_source\": \"web\",\n \"platform_asset_id\": \"<string>\",\n \"value_type\": \"none\",\n \"value_static\": 123,\n \"value_path\": \"<string>\",\n \"currency\": \"<string>\",\n \"parameter_mappings\": [\n {\n \"id\": \"<string>\",\n \"platformParameter\": \"<string>\",\n \"dataPath\": \"<string>\"\n }\n ],\n \"user_data_mappings\": [\n {\n \"id\": \"<string>\",\n \"platformParameter\": \"<string>\",\n \"dataPath\": \"<string>\"\n }\n ],\n \"snap_app_id\": \"<string>\",\n \"test_event_code\": \"<string>\",\n \"enabled\": true\n },\n \"dry_run\": false\n}"
response = http.request(request)
puts response.read_body{
"dry_run": true,
"applied": true,
"diff": {
"action": "<string>",
"resource": {
"type": "conversion_rule",
"id": "<string>",
"label": "<string>"
},
"prior_state": {},
"new_state": {},
"changes": [
{
"field": "<string>",
"from": "<unknown>",
"to": "<unknown>"
}
],
"effects": [
{
"type": "postback_target",
"summary": "<string>",
"platform": "<string>",
"ad_account_id": "<string>",
"asset_id": "<string>",
"asset_field": "<string>",
"endpoint_url_masked": "<string>",
"trigger_event": "<string>",
"trigger_event_source": "<string>",
"platform_event": "<string>",
"active": true,
"operation": "put",
"key": "<string>",
"path": "<string>",
"requires_approval": true,
"approver_roles": [
"<string>"
],
"review_surface": "<string>",
"supersedes": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
]
},
"audit_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"data": {
"rule_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"event_name": "<string>",
"trigger_event_source": "<string>",
"target_platform": "<string>",
"platform_asset_id": "<string>",
"ad_account_id": "<string>",
"platform_standard_event": "<string>",
"value_type": "<string>",
"value_static": 123,
"value_path": "<string>",
"currency": "<string>",
"parameter_mappings": [
{
"id": "<string>",
"platformParameter": "<string>",
"dataPath": "<string>"
}
],
"user_data_mappings": [
{
"id": "<string>",
"platformParameter": "<string>",
"dataPath": "<string>"
}
],
"enabled": true,
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>"
}
}{
"error": "<string>"
}{
"error": "<string>",
"code": "insufficient_scope",
"required_scope": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Response
The write was applied. diff describes what changed and audit_id is the handle to undo it.
False on a dry run and on every error.
The change, in full. A dry run returns the change it WOULD make; an applied write returns the change it DID make, in the same shape, so the two can be compared directly.
Show child attributes
Show child attributes
Present on an applied write. The handle POST /audit/{auditId}/undo takes.
Show child attributes
Show child attributes
Was this page helpful?