Saltar al contenido principal
PATCH
/
campaigns
/
{id}
cURL
curl --request PATCH \
  --url https://api.altur.io/api/v1.0/campaigns/{id} \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "timezone": "<string>",
  "retries": 2,
  "message_limit": 5000,
  "scheduling": {
    "mon": {
      "startTime": "<string>",
      "stopTime": "<string>",
      "active": true
    },
    "tue": {
      "startTime": "<string>",
      "stopTime": "<string>",
      "active": true
    },
    "wed": {
      "startTime": "<string>",
      "stopTime": "<string>",
      "active": true
    },
    "thu": {
      "startTime": "<string>",
      "stopTime": "<string>",
      "active": true
    },
    "fri": {
      "startTime": "<string>",
      "stopTime": "<string>",
      "active": true
    },
    "sat": {
      "startTime": "<string>",
      "stopTime": "<string>",
      "active": true
    },
    "sun": {
      "startTime": "<string>",
      "stopTime": "<string>",
      "active": true
    }
  },
  "first_message": "<string>",
  "template": "<string>",
  "template_alt": "<string>",
  "cycles": {
    "enabled": true,
    "max_iterations": 7,
    "cooldown_minutes": 720,
    "filter_statuses": [
      "<string>"
    ],
    "filter_tags": [
      "<string>"
    ],
    "schedule": {
      "mon": {
        "startTime": "<string>",
        "stopTime": "<string>",
        "active": true
      },
      "tue": {
        "startTime": "<string>",
        "stopTime": "<string>",
        "active": true
      },
      "wed": {
        "startTime": "<string>",
        "stopTime": "<string>",
        "active": true
      },
      "thu": {
        "startTime": "<string>",
        "stopTime": "<string>",
        "active": true
      },
      "fri": {
        "startTime": "<string>",
        "stopTime": "<string>",
        "active": true
      },
      "sat": {
        "startTime": "<string>",
        "stopTime": "<string>",
        "active": true
      },
      "sun": {
        "startTime": "<string>",
        "stopTime": "<string>",
        "active": true
      }
    },
    "schedule_start_date": "2023-12-25",
    "schedule_end_date": "2023-12-25"
  }
}
'
{
  "success": true,
  "campaign": {
    "id": 123,
    "name": "<string>",
    "integration": {
      "id": "<string>"
    },
    "agent": {
      "id": "<string>",
      "name": "<string>"
    },
    "created_at": "2023-11-07T05:31:56Z",
    "scheduling": {
      "mon": {
        "startTime": "<string>",
        "stopTime": "<string>",
        "active": true
      },
      "tue": {
        "startTime": "<string>",
        "stopTime": "<string>",
        "active": true
      },
      "wed": {
        "startTime": "<string>",
        "stopTime": "<string>",
        "active": true
      },
      "thu": {
        "startTime": "<string>",
        "stopTime": "<string>",
        "active": true
      },
      "fri": {
        "startTime": "<string>",
        "stopTime": "<string>",
        "active": true
      },
      "sat": {
        "startTime": "<string>",
        "stopTime": "<string>",
        "active": true
      },
      "sun": {
        "startTime": "<string>",
        "stopTime": "<string>",
        "active": true
      }
    },
    "cycles": {
      "enabled": true,
      "max_iterations": 7,
      "cooldown_minutes": 720,
      "filter_statuses": [
        "<string>"
      ],
      "filter_tags": [
        "<string>"
      ],
      "schedule": {
        "mon": {
          "startTime": "<string>",
          "stopTime": "<string>",
          "active": true
        },
        "tue": {
          "startTime": "<string>",
          "stopTime": "<string>",
          "active": true
        },
        "wed": {
          "startTime": "<string>",
          "stopTime": "<string>",
          "active": true
        },
        "thu": {
          "startTime": "<string>",
          "stopTime": "<string>",
          "active": true
        },
        "fri": {
          "startTime": "<string>",
          "stopTime": "<string>",
          "active": true
        },
        "sat": {
          "startTime": "<string>",
          "stopTime": "<string>",
          "active": true
        },
        "sun": {
          "startTime": "<string>",
          "stopTime": "<string>",
          "active": true
        }
      },
      "schedule_start_date": "2023-12-25",
      "schedule_end_date": "2023-12-25"
    },
    "analytics": {}
  }
}
Límite de Tasa: 12 solicitudes por segundo

Campos Inmutables

Los siguientes campos no pueden modificarse después de la creación. Incluirlos en un PATCH devuelve 400 IMMUTABLE_FIELD e identifica el campo en conflicto en la llave field:
  • agent_id
  • integration_id
  • integration_type
  • cycles.enabled
  • cycles.mode
Las campañas finalizadas son de solo lectura y devuelven 409 CAMPAIGN_FINISHED ante cualquier PATCH.

Actualizaciones de Ciclo

Los campos de ciclo solo pueden actualizarse en campañas con ciclos habilitados (400 CYCLES_NOT_ENABLED en otro caso). schedule, schedule_start_date y schedule_end_date solo son válidos cuando cycles.mode es scheduled (400 SCHEDULED_MODE_ONLY en otro caso).

Ejemplos

Renombrar campaña y reducir reintentos

curl -X PATCH "https://api.altur.io/api/v1.0/campaigns/1234" \
  -H "Authorization: api-key YOUR_API_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Reactivación Q2 - ola 2",
    "retries": 2
  }'

Cambiar el cooldown del ciclo

curl -X PATCH "https://api.altur.io/api/v1.0/campaigns/1234" \
  -H "Authorization: api-key YOUR_API_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "cycles": { "cooldown_minutes": 60 }
  }'

Autorizaciones

Authorization
string
header
requerido

Add api-key YOUR_API_SECRET_KEY as the value of the Authorization header.

Parámetros de ruta

id
integer
requerido

The identifier of the Campaign

Cuerpo

application/json

Partial Campaign update

Partial update. Any field may be omitted. Immutable fields (agent_id, integration_id, integration_type, cycles.enabled, cycles.mode) cannot be included.

name
string
Maximum string length: 255
description
string
timezone
string
retries
integer
Rango requerido: 0 <= x <= 5
message_limit
integer
Rango requerido: 1 <= x <= 10000
scheduling
object
first_message
string
template
string
template_alt
string
cycles
object

Cycles configuration block. Phone-call campaigns only.

Respuesta

Campaign updated successfully

success
boolean
campaign
object

Single Campaign detail with nested agent, integration and cycles config. The analytics field is included only when a snapshot is available for the campaign.