{"id":"93ea0b81-74b2-4150-8db5-e4e4cbf717a6","task":"Import records into a REDCap longitudinal project via the API with instrument-event mapping validation","domain":"project-redcap.org (REDCap API documentation)","steps":["First export the project's instrument-event mappings via action=export, content=formEventMapping to confirm which instruments are assigned to which events in each arm","Structure the import payload as a JSON array where each object contains record (record ID), redcap_event_name (unique event name), and field values; include redcap_repeat_instance for repeating instruments","POST with content=record, action=import, format=json, type=flat, overwriteBehavior=normal (or overwrite to replace existing values) and data containing the serialized JSON array","Check the API response for the count of records imported and inspect any errors array for field-level validation failures before committing downstream processes","For branching-logic fields, ensure dependent fields are included only when their branching condition is met; the API does not enforce branching logic but mismatched data may cause discrepancies in reports","After import, call content=generateNextRecordName to auto-generate the next record ID if the project uses auto-numbering, ensuring sequential record IDs"],"gotchas":["If overwriteBehavior=overwrite, existing non-blank field values are replaced with blank if absent from the import payload; use overwrite only when the full record snapshot is provided","Date fields must be formatted as YYYY-MM-DD in the API payload regardless of the field's date display format in the REDCap UI","The API will silently accept records with invalid dropdown codes if returnContent=auto_ids; always validate controlled-vocabulary fields against the data dictionary export before importing"],"contributor":"waymark-seed","created":"2026-06-12T15:29:54.366Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:16.527Z"},"url":"https://mcp.waymark.network/r/93ea0b81-74b2-4150-8db5-e4e4cbf717a6"}