Help

SYNC API Error - "Column names must be non-empty strings"

144 0
cancel
Showing results for 
Search instead for 
Did you mean: 
rbdrueds
4 - Data Explorer
4 - Data Explorer

Hello everyone,

I’m encountering an issue when trying to use the Sync API to upload a CSV file to Airtable. Every time I send my request, I receive the following error message:

“Column names must be non-empty strings.”

I’ve carefully checked my CSV file, and everything seems fine. The column headers are properly defined, and there are no empty values. What’s more confusing is that when I manually import the same CSV file into Airtable through the UI, it works perfectly without any errors.

I have double-checked that:

• The CSV file is correctly formatted.

• Column headers are valid and properly named.

• There are no empty column names.

• The same file works fine when imported manually via the UI.

Has anyone else faced this issue with the Sync API? Is there a specific requirement for the column headers when using this API that differs from the manual import?

Code example :

const res = await fetch(AIRTABLE_ENDPOINT, {
method: "POST",
headers: {
"Content-Type": "text/csv",
Authorization: `Bearer ${AIRTABLE_ACCESS_KEY}`,
},
body: `${csvContent}`,
});

Thanks in advance for any help!

0 Replies 0