Skip to content

Imports API activation

The imports API is disabled by default. Its global database setting is hidden from the settings UI and ignored by the normal settings-form parameter handling (disabled_from_params). The admin settings API does not enforce that flag; administrators can still change the setting through that API.

Enable it in Rails console:

EasySetting.find_or_initialize_by(
  name: "easy_imports_api_enabled",
  project_id: nil
).update!(value: true)

Use value: false to disable it again. Use boolean values, not strings. The former /easy_migration_api URL namespace and easy_migration_api_enabled setting have been replaced without compatibility aliases. Update clients to use /easy_imports_api and explicitly enable easy_imports_api_enabled on instances that used the old setting or EASY8_MIGRATION_API_ENABLED environment variable.

When disabled, import endpoints return HTTP 404. When enabled, they still require an authenticated administrator with writable API access; read-only API keys are rejected with HTTP 403. The journal import endpoint is POST /easy_imports_api/journals/import.json and accepts up to 100 journals in one transaction.

Journal attributes are permitted as scalar values. Array- or object-valued entity_id and user_id are rejected with HTTP 422 and a row-indexed validation error; no journals from that batch are inserted.

Historical journals are bulk-inserted with model validations and HTML sanitization, without save/create/commit callbacks. Imports do not send notification or mention emails, copy journals through distributed-task hierarchies, enqueue mention-based relation jobs, or broadcast journal changes. The response contains persisted journal IDs in input order.

External IDs are checked for duplicates within the batch and against existing journals on the same entity before insertion. Concurrent imports of the same external IDs are not coordinated; callers must prevent overlapping imports.

created_on must be an RFC 3339 timestamp including a time and an explicit timezone (Z or a numeric offset), for example 2020-10-28T12:34:56Z. Date-only and timezone-free values are rejected with HTTP 422 and a row-indexed validation error.

Notes containing embedded base64 images are unsupported and reject the entire batch with HTTP 422 and a row-indexed validation error. This applies to public and private notes; no journals or attachments are created for a rejected batch.