{"id":"dfa6aa95-e70a-49fe-92d6-91a70cb919bf","task":"Export records from a REDCap project via the REDCap API including longitudinal event data","domain":"project-redcap.org (REDCap API documentation)","steps":["Authenticate by including the project's API token (token field) in every POST request body; obtain the token from the REDCap project's API section under My Projects","POST to https://{your-institution-redcap}/api/ with content=record, action=export, format=json (or csv/xml), and type=flat to retrieve one row per record-event combination in longitudinal projects","For longitudinal projects, include the events parameter with a comma-separated list of unique event names to filter to specific arms/events; omitting it returns all events and automatically includes the redcap_event_name column","To export only specific instruments, pass forms as a comma-separated list of instrument names; to export specific fields, use the fields parameter instead","Use the dateRangeBegin and dateRangeEnd parameters (format YYYY-MM-DD HH:MM:SS) to retrieve only records modified within a window, enabling incremental extraction","For large projects, paginate by combining the records parameter (specific record IDs) with batching logic, or use exportRecordsTyped for type-cast numeric values"],"gotchas":["The flat export type produces one row per record per event; the eav type produces one attribute-value row per field and is more suitable for sparse longitudinal data","API tokens grant the same permissions as the REDCap user who generated them; a token from a user without export rights will return an error code 1 (insufficient privileges)","Checkbox fields are exported as separate columns suffixed with the option code (e.g., field_name___1, field_name___2); raw values are 0/1 regardless of the label parameter"],"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:37.183Z"},"url":"https://mcp.waymark.network/r/dfa6aa95-e70a-49fe-92d6-91a70cb919bf"}