Validates a cleaning plan for an import upload exactly as the import assistant does and stores it as pending: operations in order, each one of rename_header (from, to), normalize_date (column, source_format), normalize_number (column, decimal, thousands), replace_value (column, from, to), map_enum (column, mapping), normalize_boolean (column, true_values, false_values) or trim_whitespace (columns, * for every column), with an optional row_filter, every column checked against the file's own headers. Answers 201 with plan: plan_id, status pending, applied false, the upload it belongs to (source_upload_id, source_hash, source_revision, entity, filename, headers, row_count), the operations and the changes in words. Nothing is applied or imported. Only a person applies a cleaning plan, from the cleaned-file card in a Cybooks AI import conversation; plans stored through the API are not yet listed in the app, so show the person the changes. 422 validation_failed for a malformed plan (each operations item an object whose op is one of the seven), 422 transformation_plan_invalid (error.fields.operations, naming the operation by its position) for a plan the assistant would refuse; 409 import_upload_changed when source_hash or source_revision does not match this upload, 409 import_upload_not_ready while the file is still being stored, 409 import_upload_superseded (with current_upload_id) when a newer revision of the file exists, 409 import_upload_unavailable once the upload was used, removed or could not be stored; 503 import_manager_unavailable while the import tables are upgraded. Requires an Idempotency-Key: the same key and request replays the first plan. Requires the imports:write OAuth scope with manage_imports, the entity's create and update permissions and the imports plan feature.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
