# File Operations

Upload and import CSV files into your CRM, and export contacts or companies to CSV. File imports run asynchronously — upload first, then trigger import-leads or import-companies. Exports return a queued job; use `/file-exports/download` once the job completes.

 - [POST /leads/api/file-imports/upload-csv](https://api.grinfi.io/openapi/file-operations/uploadcsvfile.md): Upload a CSV file to be imported as contacts or companies. Returns a file-import record with a UUID. Pass that UUID to `import-leads` or `import-companies` to actually create the records. **Note:** th
 - [POST /leads/api/file-imports/{uuid}/import-leads](https://api.grinfi.io/openapi/file-operations/importleadsfromfile.md): Trigger contact import from a previously uploaded CSV file. Required field: `columns` — an ordered list of column-mapping objects describing how to map CSV columns to contact fields.
 - [POST /leads/api/file-imports/{uuid}/import-companies](https://api.grinfi.io/openapi/file-operations/importcompaniesfromfile.md): Trigger company import from a previously uploaded CSV file.
 - [POST /leads/api/file-exports/leads](https://api.grinfi.io/openapi/file-operations/exportleadstocsv.md): Queue a CSV export of contacts matching the filter. Returns a file-export record with status `queued`. Once the job completes, use `download` to retrieve the file.
 - [POST /leads/api/file-exports/companies](https://api.grinfi.io/openapi/file-operations/exportcompaniestocsv.md): Queue a CSV export of companies matching the filter.
 - [POST /leads/api/file-exports/download](https://api.grinfi.io/openapi/file-operations/downloadexportfile.md): Retrieve a previously generated export file by name. The `file_name` is returned as part of the export record once the job completes.
