Reglas de valor
El valor con que tus ventas llegan a Google y a Meta: un monto fijo o un cambio porcentual, para ciertos eventos, en toda la organización o en una campaña, un grupo o un anuncio. Gana la regla más específica.
Listar reglas#
/api/v1/conversion_value_rules
Bearer
De la más antigua a la más reciente, por páginas:
limit
(1 a 100, 25 por defecto) y
after
(el
next_cursor
de la página anterior).
status
string
active
o
paused
.
limit
integer
Cuántos por página, de 1 a 100.
after
string
El
next_cursor
de la página anterior.
Devuelve
·
200
con la lista (
data
,
has_more
,
next_cursor
) ·
422
con un filtro inválido.
curl "https://edge.datil.com/api/v1/conversion_value_rules" \
-H "Authorization: Bearer $DATIL_API_KEY"
{
"object": "list",
"data": [
{
"id": "8a9b0c1d-2e3f-4a4b-8c5d-6e7f8a9b0c1d",
"object": "conversion_value_rule",
"status": "active",
"adjustment_type": "percentage",
"fixed_value": null,
"percentage_change": "20",
"targets": [
{
"platform": "meta",
"scope": "business",
"resource_id": null
}
],
"events": [
{
"event_name": "purchase",
"custom_name": null
}
],
"metadata": [],
"created_at": "2026-09-27T14:03:01Z",
"updated_at": "2026-09-27T14:03:01Z"
}
],
"has_more": false,
"next_cursor": null
}
Crear una regla#
/api/v1/conversion_value_rules
Bearer
La regla se aplica a las ventas que se envíen desde ahora.
Content-Type: application/json
adjustment_type
string
requerido
Un monto fijo o un cambio porcentual.
fixedpercentage
fixed_value
objeto
Fija:
{amount, currency}
— el valor que se envía, en la moneda de la venta.
percentage_change
number
Porcentual: con signo, de -100 a 1000; el valor nunca baja de cero.
targets
array de objetos
requerido
[{platform, scope, resource_id}]
:
google
o
meta
;
business
,
campaign
,
ad_group
o
ad
.
events
array de objetos
requerido
[{event_name}]
:
purchase
,
start_trial
,
lead
,
complete_registration
,
add_to_cart
,
subscribe
,
activation
.
metadata
objeto
Hasta 20 pares de texto para tu uso.
Devuelve
·
201
con la regla ·
422
con
errors
.
curl -X POST https://edge.datil.com/api/v1/conversion_value_rules \
-H "Authorization: Bearer $DATIL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"adjustment_type": "percentage",
"percentage_change": 20,
"targets": [
{
"platform": "meta",
"scope": "business"
}
],
"events": [
{
"event_name": "purchase"
}
]
}'
{
"id": "8a9b0c1d-2e3f-4a4b-8c5d-6e7f8a9b0c1d",
"object": "conversion_value_rule",
"status": "active",
"adjustment_type": "percentage",
"fixed_value": null,
"percentage_change": "20",
"targets": [
{
"platform": "meta",
"scope": "business",
"resource_id": null
}
],
"events": [
{
"event_name": "purchase",
"custom_name": null
}
],
"metadata": [],
"created_at": "2026-09-27T14:03:01Z",
"updated_at": "2026-09-27T14:03:01Z"
}
Consultar una regla#
/api/v1/conversion_value_rules/:id
Bearer
Un objeto de tu organización, con su estado de entrega.
id
string
requerido
El
id
del objeto.
Devuelve
·
200
con el objeto ·
404 not_found
para uno que no es de tu organización.
curl "https://edge.datil.com/api/v1/conversion_value_rules/7b0f6a52-3c1e-4d7e-9a57-0c1f5c2e9b10" \
-H "Authorization: Bearer $DATIL_API_KEY"
{
"id": "8a9b0c1d-2e3f-4a4b-8c5d-6e7f8a9b0c1d",
"object": "conversion_value_rule",
"status": "active",
"adjustment_type": "percentage",
"fixed_value": null,
"percentage_change": "20",
"targets": [
{
"platform": "meta",
"scope": "business",
"resource_id": null
}
],
"events": [
{
"event_name": "purchase",
"custom_name": null
}
],
"metadata": [],
"created_at": "2026-09-27T14:03:01Z",
"updated_at": "2026-09-27T14:03:01Z"
}
Cambiar una regla#
/api/v1/conversion_value_rules/:id
Bearer
Cambia el ajuste, los destinos o los eventos.
Content-Type: application/json
id
string
requerido
El
id
de la regla.
adjustment_type
string
requerido
Un monto fijo o un cambio porcentual.
fixedpercentage
fixed_value
objeto
Fija:
{amount, currency}
— el valor que se envía, en la moneda de la venta.
percentage_change
number
Porcentual: con signo, de -100 a 1000; el valor nunca baja de cero.
targets
array de objetos
requerido
[{platform, scope, resource_id}]
:
google
o
meta
;
business
,
campaign
,
ad_group
o
ad
.
events
array de objetos
requerido
[{event_name}]
:
purchase
,
start_trial
,
lead
,
complete_registration
,
add_to_cart
,
subscribe
,
activation
.
metadata
objeto
Hasta 20 pares de texto para tu uso.
Devuelve
·
200
con la regla ·
422
con
errors
.
curl -X PATCH https://edge.datil.com/api/v1/conversion_value_rules/7b0f6a52-3c1e-4d7e-9a57-0c1f5c2e9b10 \
-H "Authorization: Bearer $DATIL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"percentage_change": 10
}'
{
"id": "8a9b0c1d-2e3f-4a4b-8c5d-6e7f8a9b0c1d",
"object": "conversion_value_rule",
"status": "active",
"adjustment_type": "percentage",
"fixed_value": null,
"percentage_change": "20",
"targets": [
{
"platform": "meta",
"scope": "business",
"resource_id": null
}
],
"events": [
{
"event_name": "purchase",
"custom_name": null
}
],
"metadata": [],
"created_at": "2026-09-27T14:03:01Z",
"updated_at": "2026-09-27T14:03:01Z"
}
Eliminar una regla#
/api/v1/conversion_value_rules/:id
Bearer
Las ventas vuelven a enviarse con su valor.
id
string
requerido
El
id
del objeto.
Devuelve
·
200
con
deleted: true
·
404
·
409
por su estado.
curl -X DELETE https://edge.datil.com/api/v1/conversion_value_rules/7b0f6a52-3c1e-4d7e-9a57-0c1f5c2e9b10 \
-H "Authorization: Bearer $DATIL_API_KEY"
{
"id": "3b4c5d6e-7f8a-4b9c-8d0e-2f3a4b5c6d7e",
"object": "ad_campaign",
"deleted": true
}
Pausar una regla#
/api/v1/conversion_value_rules/:id/pause
Bearer
La regla deja de ajustar.
Content-Type: application/json
id
string
requerido
El
id
del objeto.
Devuelve
·
200
con el objeto ·
400
por una regla de lanzamiento ·
404
·
409
por su estado.
curl -X POST https://edge.datil.com/api/v1/conversion_value_rules/7b0f6a52-3c1e-4d7e-9a57-0c1f5c2e9b10/pause \
-H "Authorization: Bearer $DATIL_API_KEY"
{
"id": "8a9b0c1d-2e3f-4a4b-8c5d-6e7f8a9b0c1d",
"object": "conversion_value_rule",
"status": "active",
"adjustment_type": "percentage",
"fixed_value": null,
"percentage_change": "20",
"targets": [
{
"platform": "meta",
"scope": "business",
"resource_id": null
}
],
"events": [
{
"event_name": "purchase",
"custom_name": null
}
],
"metadata": [],
"created_at": "2026-09-27T14:03:01Z",
"updated_at": "2026-09-27T14:03:01Z"
}
Reanudar una regla#
/api/v1/conversion_value_rules/:id/unpause
Bearer
La regla vuelve a ajustar.
Content-Type: application/json
id
string
requerido
El
id
del objeto.
Devuelve
·
200
con el objeto ·
400
por una regla de lanzamiento ·
404
·
409
por su estado.
curl -X POST https://edge.datil.com/api/v1/conversion_value_rules/7b0f6a52-3c1e-4d7e-9a57-0c1f5c2e9b10/unpause \
-H "Authorization: Bearer $DATIL_API_KEY"
{
"id": "8a9b0c1d-2e3f-4a4b-8c5d-6e7f8a9b0c1d",
"object": "conversion_value_rule",
"status": "active",
"adjustment_type": "percentage",
"fixed_value": null,
"percentage_change": "20",
"targets": [
{
"platform": "meta",
"scope": "business",
"resource_id": null
}
],
"events": [
{
"event_name": "purchase",
"custom_name": null
}
],
"metadata": [],
"created_at": "2026-09-27T14:03:01Z",
"updated_at": "2026-09-27T14:03:01Z"
}