Storage REST API - Documentation

I cannot find any documentation around the endpoints for storage and the entire API in general - any tips?
6 Replies
bunge
bungeOP3y ago
those docs do not make sense - the base url is : https://supabase.github.io/bucket/ anytime you test in swagger i get 404 errors saying the guthub pages site doesnt exsist
osaxma
osaxma3y ago
The base URL would be the API URL (the one printed after supabase start in local dev or the one from the dashboard for hosted instance) with /storage/v1/ such as:
http://localhost:54321/storage/v1/bucket
http://localhost:54321/storage/v1/bucket
^ you would need to include proper authorization headers Here's an example for listing all the buckets using the service role key (not supposed to be used client side):
curl http://localhost:54321/storage/v1/bucket -H "Authorization: Bearer <service_role_key>"
curl http://localhost:54321/storage/v1/bucket -H "Authorization: Bearer <service_role_key>"
Exa
Exa3y ago
Hi, similar issue: when I use your hosted option, doing a POST request via the REST API like this (apikey and bearer token are set in the headers) https://[myproject].supabase.co/object/images/cat.png just returns a 404 with "no Route matched with those values". I could not find any good documentation on how an example REST API call would look like for storage, nor how data must be formatted. The OpenAPI docs are pretty useless tbh Thanks in advance!
osaxma
osaxma3y ago
try:
https://[myproject].supabase.co/storage/v1/object/images/cat.png
https://[myproject].supabase.co/storage/v1/object/images/cat.png
Exa
Exa3y ago
yes that works, thought I tried that as well but apparently didn't! Thx!

Did you find this page helpful?