Terminar Tratamiento

Terminar Tratamiento

POST /cl/consent_manager/terminate_processing

Registra un PROCESSING_TERMINATED (término informado por el responsable). Sólo aplica a tratamientos cuya Activity usa term_policy = TERMINATION_DEFINED_BY_CONTROLLER (típicamente CONTRACT, LEGITIMATE_INTEREST o la opción configurada de LEGAL_OBLIGATION). No aplica a CONSENT (usa revoke_processing) ni a RETENTION_PERIOD_FROM_ANCHOR.

  • URL de producción: https://api.floid.app/cl/consent_manager/terminate_processing
  • URL de sandbox: https://sandbox.floid.app/cl/consent_manager/terminate_processing

Headers requeridos

Authorization: Bearer {{TOKEN}}
Content-Type: application/json

Parámetros del body

CampoTipoRequeridoDescripción
processing_idstring (UUID)Tratamiento a terminar.
occurred_atstring (ISO 8601)Momento real del término. Posterior al inicio del tratamiento.
operational_codestringNoCódigo operacional del término.
metadataobjectNoMetadatos libres.
duplicate_protection_keystringNoIdempotencia por tenant.

Campos prohibidos: subject_external_id, subject_snapshot, activity_code, business_reference, medium, expires_at, terms_and_conditions, tc_version_id, evidence, redec. Incluir cualquiera devuelve INVALID_FIELD_FOR_PROCESSING_TERMINATED.


Ejemplo

curl --location 'https://api.floid.app/cl/consent_manager/terminate_processing' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer {{TOKEN}}' \
  --data '{
    "processing_id": "770e8400-e29b-41d4-a716-446655440111",
    "occurred_at": "2026-09-22T18:30:00.000Z",
    "operational_code": "ops-terminate-77"
  }'

Respuesta exitosa (200)

{
  "code": 200,
  "message": "Processing terminated",
  "caseid": "b3f1c2a4-9e77-4c31-8a10-2f6d5e7a1b90",
  "data": {
    "data_processing_id": "770e8400-e29b-41d4-a716-446655440111",
    "data_processing_event_id": "aa11bb22-cc33-44dd-55ee-66ff77aa88bb",
    "event_type": "PROCESSING_TERMINATED",
    "occurred_at": "2026-09-22T18:30:00.000Z",
    "received_at": "2026-09-22T18:30:04.000Z",
    "status": "TERMINATED",
    "legal_basis": "CONTRACT",
    "legal_framework": "LPDP",
    "subject_external_id": "customer-8293",
    "subject_snapshot": { "subject_type": "NATURAL", "subject_identification": { "type": "CL_RUT", "value": "12.345.678-5" } },
    "activity": { "code": "onboarding-contrato", "version_number": 1 },
    "terms_and_conditions": null,
    "validity": { "ends_at": null, "end_mode": "TERMINATION_DEFINED_BY_CONTROLLER", "ended_at": "2026-09-22T18:30:00.000Z" },
    "evidence_status": "NOT_REQUIRED",
    "evidence_due_at": null,
    "evidence": [],
    "operational_code": "ops-terminate-77",
    "business_reference": null,
    "metadata": null,
    "redec": null,
    "replayed": false,
    "origin": null
  }
}

Estructura de data

Misma forma que create_processing, con event_type = PROCESSING_TERMINATED, status = TERMINATED y validity.ended_at con la fecha del término. Incluye origin (igual que en revoke_processing: null salvo que provenga de una solicitud de derecho) y replayed.


Errores

HTTPerror_codeCuándo
400DATA_PROCESSING_ID_REQUIREDFalta processing_id.
400OCCURRED_AT_REQUIRED / OCCURRED_AT_INVALIDoccurred_at ausente o inválido.
400INVALID_FIELD_FOR_PROCESSING_TERMINATEDSe enviaron campos prohibidos.
400TERMINATION_BEFORE_ORIGINoccurred_at anterior al inicio del tratamiento.
404PROCESSING_NOT_FOUNDEl tratamiento no existe o no pertenece a tu cliente.
409TERMINATION_NOT_ALLOWED_FOR_ACTIVITYLa Activity no usa TERMINATION_DEFINED_BY_CONTROLLER.
409DATA_PROCESSING_ALREADY_TERMINATED / DATA_PROCESSING_FINALIZEDEl tratamiento ya terminó o está finalizado.
500INTERNAL_ERRORError inesperado del servidor.