Mockaroo data set upload API problem

Has anyone run into this one?

Note that this is the first attempt at using this feature.
I tried the same thing using the mockaroo-python library from @scarvy.
Had the same results with python results, his library and the CLI he provided so I don’t suspect the mockaroo-python library.

I downloaded an existing data set and then uploaded it using the REST API.

The new dataset FILE, as viewed in the GUI, is improperly named data.csv.
The file contains extra junk (example below) and doesn’t work correctly when referenced in a schema.

Is the data set upload API having a problem or am I doing something wrong?
Does anyone have a recent example that is working?

Content-Disposition: form-data; name=“file”; filename=“A_Country-CRS046-CSCD.csv”

751, ,CSCD ,AD , ,Andorra,Andorra ,0043AD - EUR 0 01000000 0,0,20231004,84827,20231004,2,USR0000034,1696409307482,0,601


I found the solution.
Instead of (using python requests library)
files = {‘file’: open(file_path, ‘rb’)}
response =, headers=headers, files=files)

I need to use the following where it reads the data first vs referencing it as a file.

with open(file_path, 'rb') as f:
    file_content =       
response =, headers=headers, data=file_content)