Documentación

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#

GET /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).

Parámetros

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
curl "https://edge.datil.com/api/v1/conversion_value_rules" \
  -H "Authorization: Bearer $DATIL_API_KEY"
Respuesta · 200
{
  "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#

POST /api/v1/conversion_value_rules Bearer

La regla se aplica a las ventas que se envíen desde ahora.

Content-Type: application/json

Cuerpo de la solicitud

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
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"
    }
  ]
}'
Respuesta · 201
{
  "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#

GET /api/v1/conversion_value_rules/:id Bearer

Un objeto de tu organización, con su estado de entrega.

Parámetros

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
curl "https://edge.datil.com/api/v1/conversion_value_rules/7b0f6a52-3c1e-4d7e-9a57-0c1f5c2e9b10" \
  -H "Authorization: Bearer $DATIL_API_KEY"
Respuesta · 200
{
  "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#

PATCH /api/v1/conversion_value_rules/:id Bearer

Cambia el ajuste, los destinos o los eventos.

Content-Type: application/json

Parámetros

id string requerido

El id de la regla.

Cuerpo de la solicitud

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
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
}'
Respuesta · 200
{
  "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#

DELETE /api/v1/conversion_value_rules/:id Bearer

Las ventas vuelven a enviarse con su valor.

Parámetros

id string requerido

El id del objeto.

Devuelve · 200 con deleted: true · 404 · 409 por su estado.

cURL
curl -X DELETE https://edge.datil.com/api/v1/conversion_value_rules/7b0f6a52-3c1e-4d7e-9a57-0c1f5c2e9b10 \
  -H "Authorization: Bearer $DATIL_API_KEY"
Respuesta · 200
{
  "id": "3b4c5d6e-7f8a-4b9c-8d0e-2f3a4b5c6d7e",
  "object": "ad_campaign",
  "deleted": true
}

Pausar una regla#

POST /api/v1/conversion_value_rules/:id/pause Bearer

La regla deja de ajustar.

Content-Type: application/json

Parámetros

id string requerido

El id del objeto.

Devuelve · 200 con el objeto · 400 por una regla de lanzamiento · 404 · 409 por su estado.

cURL
curl -X POST https://edge.datil.com/api/v1/conversion_value_rules/7b0f6a52-3c1e-4d7e-9a57-0c1f5c2e9b10/pause \
  -H "Authorization: Bearer $DATIL_API_KEY"
Respuesta · 200
{
  "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#

POST /api/v1/conversion_value_rules/:id/unpause Bearer

La regla vuelve a ajustar.

Content-Type: application/json

Parámetros

id string requerido

El id del objeto.

Devuelve · 200 con el objeto · 400 por una regla de lanzamiento · 404 · 409 por su estado.

cURL
curl -X POST https://edge.datil.com/api/v1/conversion_value_rules/7b0f6a52-3c1e-4d7e-9a57-0c1f5c2e9b10/unpause \
  -H "Authorization: Bearer $DATIL_API_KEY"
Respuesta · 200
{
  "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"
}
Sin conexión — reintentando…

Esenciales

Sesión, seguridad, idioma y tema. Sin ellas el sitio no funciona.

Siempre activas