Skip to main content

Usage

API documentation for Supabase Storage

Object

Object end-points

Delete an object

DELETE /object/{bucketName}/{wildcard}

Path Parameters

  • bucketNamerequired

    Example:avatars

  • *required

    Example:folder/cat.png

Header Parameters

  • authorizationrequired

    Example:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs

Responses

Successful response

{
"schema": {
"description": "Successful response",
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "Successfully deleted"
}
}
}
}

Update the object at an existing key

PUT /object/{bucketName}/{wildcard}

Path Parameters

  • bucketNamerequired

    Example:avatars

  • *required

    Example:folder/cat.png

Header Parameters

  • authorizationrequired

    Example:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs

Responses

Successful response

{
"schema": {
"description": "Successful response",
"type": "object",
"properties": {
"Key": {
"type": "string",
"example": "projectref/avatars/folder/cat.png"
}
},
"required": [
"Key"
]
}
}

Upload a new object

POST /object/{bucketName}/{wildcard}

Path Parameters

  • bucketNamerequired

    Example:avatars

  • *required

    Example:folder/cat.png

Header Parameters

  • authorizationrequired

    Example:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs

Responses

Successful response

{
"schema": {
"description": "Successful response",
"type": "object",
"properties": {
"Key": {
"type": "string",
"example": "avatars/folder/cat.png"
}
},
"required": [
"Key"
]
}
}

Delete multiple objects

DELETE /object/{bucketName}

Path Parameters

  • bucketNamerequired

    Example:avatars

Header Parameters

  • authorizationrequired

    Example:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs

Body Parameters

{
"schema": {
"type": "object",
"properties": {
"prefixes": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1,
"example": [
"folder/cat.png",
"folder/morecats.png"
]
}
},
"required": [
"prefixes"
]
}
}

Responses

Successful response

{
"schema": {
"description": "Successful response",
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"bucket_id": {
"type": "string"
},
"owner": {
"type": "string"
},
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"updated_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"created_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"last_accessed_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"metadata": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
]
},
"buckets": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"owner": {
"type": "string"
},
"public": {
"type": "boolean"
},
"created_at": {
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"required": [
"id",
"name"
],
"additionalProperties": false,
"example": {
"id": "bucket2",
"name": "bucket2",
"owner": "4d56e902-f0a0-4662-8448-a4d9e643c142",
"created_at": "2021-02-17T04:43:32.770206+00:00",
"updated_at": "2021-02-17T04:43:32.770206+00:00"
}
}
},
"required": [
"name"
],
"additionalProperties": false,
"title": "objectSchema",
"example": {
"name": "folder/cat.png",
"bucket_id": "avatars",
"owner": "317eadce-631a-4429-a0bb-f19a7a517b4a",
"id": "eaa8bdb5-2e00-4767-b5a9-d2502efe2196",
"updated_at": "2021-04-06T16:30:35.394674+00:00",
"created_at": "2021-04-06T16:30:35.394674+00:00",
"last_accessed_at": "2021-04-06T16:30:35.394674+00:00",
"metadata": {
"size": 1234
}
}
}
}
}

Retrieve an object

GET /object/authenticated/{bucketName}/{wildcard}

Path Parameters

  • bucketNamerequired

    Example:avatars

  • *required

    Example:folder/cat.png

Header Parameters

  • authorizationrequired

    Example:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs

Responses

Error response

{
"schema": {
"description": "Error response",
"type": "object",
"properties": {
"statusCode": {
"type": "string"
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"statusCode",
"error",
"message"
],
"title": "errorSchema"
}
}

Generate a presigned url to retrieve an object

POST /object/sign/{bucketName}/{wildcard}

Path Parameters

  • bucketNamerequired

    Example:avatars

  • *required

    Example:folder/cat.png

Header Parameters

  • authorizationrequired

    Example:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs

Body Parameters

{
"schema": {
"type": "object",
"properties": {
"expiresIn": {
"type": "integer",
"minimum": 1,
"example": 60000
}
},
"required": [
"expiresIn"
]
}
}

Responses

Successful response

{
"schema": {
"description": "Successful response",
"type": "object",
"properties": {
"signedURL": {
"type": "string",
"example": "/object/sign/avatars/folder/cat.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1cmwiOiJhdmF0YXJzL2ZvbGRlci9jYXQucG5nIiwiaWF0IjoxNjE3NzI2MjczLCJleHAiOjE2MTc3MjcyNzN9.s7Gt8ME80iREVxPhH01ZNv8oUn4XtaWsmiQ5csiUHn4"
}
},
"required": [
"signedURL"
]
}
}

Retrieve an object via a presigned URL

GET /object/sign/{bucketName}/{wildcard}

Path Parameters

  • bucketNamerequired

    Example:avatars

  • *required

    Example:folder/cat.png

Responses

Error response

{
"schema": {
"description": "Error response",
"type": "object",
"properties": {
"statusCode": {
"type": "string"
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"statusCode",
"error",
"message"
],
"title": "errorSchema"
}
}

Generate presigned urls to retrieve objects

POST /object/sign/{bucketName}

Path Parameters

  • bucketNamerequired

    Example:avatars

Header Parameters

  • authorizationrequired

    Example:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs

Body Parameters

{
"schema": {
"type": "object",
"properties": {
"expiresIn": {
"type": "integer",
"minimum": 1,
"example": 60000
},
"paths": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1,
"example": [
"folder/cat.png",
"folder/morecats.png"
]
}
},
"required": [
"expiresIn",
"paths"
]
}
}

Responses

Successful response

{
"schema": {
"description": "Successful response",
"type": "array",
"items": {
"type": "object",
"properties": {
"error": {
"error": [
"string",
"null"
],
"example": "Either the object does not exist or you do not have access to it"
},
"path": {
"type": "string",
"example": "folder/cat.png"
},
"signedURL": {
"type": [
"string",
"null"
],
"example": "/object/sign/avatars/folder/cat.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1cmwiOiJhdmF0YXJzL2ZvbGRlci9jYXQucG5nIiwiaWF0IjoxNjE3NzI2MjczLCJleHAiOjE2MTc3MjcyNzN9.s7Gt8ME80iREVxPhH01ZNv8oUn4XtaWsmiQ5csiUHn4"
}
},
"required": [
"error",
"path",
"signedURL"
]
}
}
}

Moves an object

POST /object/move

Header Parameters

  • authorizationrequired

    Example:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs

Body Parameters

{
"schema": {
"type": "object",
"properties": {
"bucketId": {
"type": "string",
"example": "avatars"
},
"sourceKey": {
"type": "string",
"example": "folder/cat.png"
},
"destinationKey": {
"type": "string",
"example": "folder/newcat.png"
}
},
"required": [
"bucketId",
"sourceKey",
"destinationKey"
]
}
}

Responses

Successful response

{
"schema": {
"description": "Successful response",
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "Successfully moved"
}
},
"required": [
"message"
]
}
}

Search for objects under a prefix

POST /object/list/{bucketName}

Path Parameters

  • bucketNamerequired

Header Parameters

  • authorizationrequired

    Example:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs

Body Parameters

{
"schema": {
"type": "object",
"properties": {
"prefix": {
"type": "string",
"example": "folder/subfolder"
},
"limit": {
"type": "integer",
"minimum": 1,
"example": 10
},
"offset": {
"type": "integer",
"minimum": 0,
"example": 0
},
"sortBy": {
"type": "object",
"properties": {
"column": {
"type": "string",
"enum": [
"name",
"updated_at",
"created_at",
"last_accessed_at"
]
},
"order": {
"type": "string",
"enum": [
"asc",
"desc"
]
}
},
"required": [
"column"
]
},
"search": {
"type": "string"
}
},
"required": [
"prefix"
]
}
}

Responses

Successful response

{
"schema": {
"description": "Successful response",
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"bucket_id": {
"type": "string"
},
"owner": {
"type": "string"
},
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"updated_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"created_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"last_accessed_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"metadata": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
]
},
"buckets": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"owner": {
"type": "string"
},
"public": {
"type": "boolean"
},
"created_at": {
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"required": [
"id",
"name"
],
"additionalProperties": false,
"example": {
"id": "bucket2",
"name": "bucket2",
"owner": "4d56e902-f0a0-4662-8448-a4d9e643c142",
"created_at": "2021-02-17T04:43:32.770206+00:00",
"updated_at": "2021-02-17T04:43:32.770206+00:00"
}
}
},
"required": [
"name"
],
"additionalProperties": false,
"example": {
"name": "folder/cat.png",
"bucket_id": "avatars",
"owner": "317eadce-631a-4429-a0bb-f19a7a517b4a",
"id": "eaa8bdb5-2e00-4767-b5a9-d2502efe2196",
"updated_at": "2021-04-06T16:30:35.394674+00:00",
"created_at": "2021-04-06T16:30:35.394674+00:00",
"last_accessed_at": "2021-04-06T16:30:35.394674+00:00",
"metadata": {
"size": 1234
}
}
}
}
}

Copies an object

POST /object/copy

Header Parameters

  • authorizationrequired

    Example:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs

Body Parameters

{
"schema": {
"type": "object",
"properties": {
"sourceKey": {
"type": "string",
"example": "folder/source.png"
},
"bucketId": {
"type": "string",
"example": "avatars"
},
"destinationKey": {
"type": "string",
"example": "folder/destination.png"
}
},
"required": [
"sourceKey",
"bucketId",
"destinationKey"
]
}
}

Responses

Successful response

{
"schema": {
"description": "Successful response",
"type": "object",
"properties": {
"Key": {
"type": "string",
"example": "folder/destination.png"
}
},
"required": [
"Key"
]
}
}

Retrieve an object from a public bucket

GET /object/public/{bucketName}/{wildcard}

Path Parameters

  • bucketNamerequired

    Example:avatars

  • *required

    Example:folder/cat.png

Responses

Error response

{
"schema": {
"description": "Error response",
"type": "object",
"properties": {
"statusCode": {
"type": "string"
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"statusCode",
"error",
"message"
],
"title": "errorSchema"
}
}

Bucket

Bucket end-points

Create a bucket

POST /bucket/

Header Parameters

  • authorizationrequired

    Example:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs

Body Parameters

{
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string",
"example": "avatars"
},
"id": {
"type": "string",
"example": "avatars"
},
"public": {
"type": "boolean",
"example": false
}
},
"required": [
"name"
]
}
}

Responses

Successful response

{
"schema": {
"description": "Successful response",
"type": "object",
"properties": {
"name": {
"type": "string",
"example": "avatars"
}
},
"required": [
"name"
]
}
}

Gets all buckets

GET /bucket/

Header Parameters

  • authorizationrequired

    Example:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs

Responses

Successful response

{
"schema": {
"description": "Successful response",
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"owner": {
"type": "string"
},
"public": {
"type": "boolean"
},
"created_at": {
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"required": [
"id",
"name"
],
"additionalProperties": false,
"title": "bucketSchema",
"example": {
"id": "bucket2",
"name": "bucket2",
"owner": "4d56e902-f0a0-4662-8448-a4d9e643c142",
"created_at": "2021-02-17T04:43:32.770206+00:00",
"updated_at": "2021-02-17T04:43:32.770206+00:00"
}
},
"example": [
{
"id": "bucket2",
"name": "bucket2",
"owner": "4d56e902-f0a0-4662-8448-a4d9e643c142",
"created_at": "2021-02-17T04:43:32.770206+00:00",
"updated_at": "2021-02-17T04:43:32.770206+00:00"
}
]
},
"example": [
{
"id": "bucket2",
"name": "bucket2",
"owner": "4d56e902-f0a0-4662-8448-a4d9e643c142",
"created_at": "2021-02-17T04:43:32.770206+00:00",
"updated_at": "2021-02-17T04:43:32.770206+00:00"
}
]
}

Empty a bucket

POST /bucket/{bucketId}/empty

Path Parameters

  • bucketIdrequired

    Example:avatars

Header Parameters

  • authorizationrequired

    Example:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs

Responses

Successful response

{
"schema": {
"description": "Successful response",
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "Successfully emptied"
}
}
}
}

Get details of a bucket

GET /bucket/{bucketId}

Path Parameters

  • bucketIdrequired

    Example:avatars

Header Parameters

  • authorizationrequired

    Example:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs

Responses

Successful response

{
"schema": {
"description": "Successful response",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"owner": {
"type": "string"
},
"public": {
"type": "boolean"
},
"created_at": {
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"required": [
"id",
"name"
],
"additionalProperties": false,
"example": {
"id": "bucket2",
"name": "bucket2",
"owner": "4d56e902-f0a0-4662-8448-a4d9e643c142",
"created_at": "2021-02-17T04:43:32.770206+00:00",
"updated_at": "2021-02-17T04:43:32.770206+00:00"
}
},
"example": {
"id": "bucket2",
"name": "bucket2",
"owner": "4d56e902-f0a0-4662-8448-a4d9e643c142",
"created_at": "2021-02-17T04:43:32.770206+00:00",
"updated_at": "2021-02-17T04:43:32.770206+00:00"
}
}

Update properties of a bucket

PUT /bucket/{bucketId}

Header Parameters

  • authorizationrequired

    Example:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs

Body Parameters

{
"schema": {
"type": "object",
"properties": {
"public": {
"type": "boolean",
"example": false
}
}
}
}

Responses

Successful response

{
"schema": {
"description": "Successful response",
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "Successfully updated"
}
},
"required": [
"message"
]
}
}

Delete a bucket

DELETE /bucket/{bucketId}

Path Parameters

  • bucketIdrequired

    Example:avatars

Header Parameters

  • authorizationrequired

    Example:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs

Responses

Successful response

{
"schema": {
"description": "Successful response",
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "Successfully deleted"
}
}
}
}

Deprecated

Deprecated end-points

Get object

GET /object/{bucketName}/{wildcard}

Path Parameters

  • bucketNamerequired

    Example:avatars

  • *required

    Example:folder/cat.png

Header Parameters

  • authorizationrequired

    Example:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs

Responses

Default Response

{
"schema": {
"type": "object",
"properties": {
"statusCode": {
"type": "string"
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"statusCode",
"error",
"message"
],
"title": "errorSchema"
}
}