# Uploading a .csv file to Supabase

**URL:** <https://community.postman.com/t/uploading-a-csv-file-to-supabase/59250>\
**Category:** Help Hub\
**Tags:** uploads\
**Created:** [March 26, 2024, 9:35am UTC](https://community.postman.com/t/uploading-a-csv-file-to-supabase/59250 "2024-03-26T09:35:54Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![colinpmiles](https://avatars.discourse-cdn.com/v4/letter/c/71e660/32.png) [@colinpmiles](https://community.postman.com/u/colinpmiles)\
**Post date:** [March 26, 2024, 9:35am UTC](https://community.postman.com/t/uploading-a-csv-file-to-supabase/59250/1 "2024-03-26T09:35:54Z")

</div>

I’m having trouble uploading a file to Supabase. I’m getting a ‘400 Bad Request’ error. I’ve tried lots of permutations but nothing seems to work.

I did manage to get a Raw text file uploaded - which was by importing a CURL request. This a local path to the .csv file in it, that Postman converted to text. So, it seems to be a configuration issue in Postman but I can’t nail it down.

I assumed it would be trivial to do but I must be missing a beat here. Any suggestions?

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [March 26, 2024, 9:38am UTC](https://community.postman.com/t/uploading-a-csv-file-to-supabase/59250/2 "2024-03-26T09:38:25Z")

</div>

Hey @colinpmiles 👋,

Welcome to the Postman community :postman:

Are you following some public documentation that’s telling you the structure of the request?

Without that or seeing how you’re building your request, it’s going to be difficult for anyone to help here.

---

<div class="post-metadata">

**Author:** ![colinpmiles](https://avatars.discourse-cdn.com/v4/letter/c/71e660/32.png) [@colinpmiles](https://community.postman.com/u/colinpmiles)\
**Post date:** [March 26, 2024, 10:19am UTC](https://community.postman.com/t/uploading-a-csv-file-to-supabase/59250/3 "2024-03-26T10:19:47Z")

</div>

Hi Danny

Yes, I’m following the public documentation as far as it goes.

https://_myProjectID_.supabase.co/storage/v1/object/stage1route/marinasNEW.csv

I’m using an apiKey and a Bearer token in the header and I’ve tried various Content-Types

Just getting a Bad Request every time…

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [March 26, 2024, 10:22am UTC](https://community.postman.com/t/uploading-a-csv-file-to-supabase/59250/4 "2024-03-26T10:22:20Z")

</div>

Sharing that same documentation with us, would make it alot easier for us to see 😃

---

<div class="post-metadata">

**Author:** ![colinpmiles](https://avatars.discourse-cdn.com/v4/letter/c/71e660/32.png) [@colinpmiles](https://community.postman.com/u/colinpmiles)\
**Post date:** [March 26, 2024, 10:38am UTC](https://community.postman.com/t/uploading-a-csv-file-to-supabase/59250/5 "2024-03-26T10:38:47Z")

</div>

My apologies:

> **[REST API | Supabase Docs](https://supabase.com/docs/guides/api)**
>
> Auto-generating REST API.

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [March 26, 2024, 1:02pm UTC](https://community.postman.com/t/uploading-a-csv-file-to-supabase/59250/6 "2024-03-26T13:02:35Z")

</div>

Which API operation within those instructions are you trying to follow?

I can’t find anything related to CSV’s.

The REST API also has the following format.

https://\<project\_ref\>.supabase.co/rest/v1/

Where your previous post appears to be pointing to a storage end point.

I can’t find anything related to storage on that site.

Are you sure you are looking at the correct instructions?

---

<div class="post-metadata">

**Author:** ![colinpmiles](https://avatars.discourse-cdn.com/v4/letter/c/71e660/32.png) [@colinpmiles](https://community.postman.com/u/colinpmiles)\
**Post date:** [March 26, 2024, 2:21pm UTC](https://community.postman.com/t/uploading-a-csv-file-to-supabase/59250/7 "2024-03-26T14:21:45Z")

</div>

Hi Mike

As far as I can tell, the documents are incomplete e.g.

> <https://stackoverflow.com/questions/75540112/how-to-upload-to-supabase-storage-using-curl/75540113#75540113>

It seems that an appended endpoint is required to the storage bucket.

In theory, it should allow me to upload any file. My .csv file was just for testing purposes.

They have a Swagger page: [Swagger UI](https://supabase.github.io/storage/#/object/post_upload_resumable_)

But that hasn’t helped either.

Copilot tells me this:

curl -X POST “https://.supabase.co/storage/v1/object//.csv”   
–data-binary “@/path/to/your/file.csv”   
-H “apikey: ”   
-H “Authorization: Bearer ”

---

<div class="post-metadata">

**Author:** ![colinpmiles](https://avatars.discourse-cdn.com/v4/letter/c/71e660/32.png) [@colinpmiles](https://community.postman.com/u/colinpmiles)\
**Post date:** [March 26, 2024, 2:47pm UTC](https://community.postman.com/t/uploading-a-csv-file-to-supabase/59250/8 "2024-03-26T14:47:48Z")

</div>

I went back to the original CURL request from CoPilot on Windows and replaced the keys once again, imported it into Postman, switched to binary in the Body column and ran it again. Whatever bug there was, I couldn’t see it. But it’s working now.

Thanks guys!

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [March 29, 2024, 2:48pm UTC](https://community.postman.com/t/uploading-a-csv-file-to-supabase/59250/9 "2024-03-29T14:48:40Z")

</div>

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
