mirror of
https://github.com/supabase/supabase.git
synced 2026-07-03 10:14:22 +08:00
829 lines
28 KiB
JSON
829 lines
28 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"title": "Supabase Storage API",
|
|
"description": "API documentation for Supabase Storage",
|
|
"version": "0.0.1"
|
|
},
|
|
"definitions": {
|
|
"def-0": {
|
|
"type": "object",
|
|
"properties": { "authorization": { "type": "string" } },
|
|
"required": ["authorization"],
|
|
"title": "authSchema"
|
|
},
|
|
"def-1": {
|
|
"type": "object",
|
|
"properties": {
|
|
"statusCode": { "type": "string" },
|
|
"error": { "type": "string" },
|
|
"message": { "type": "string" }
|
|
},
|
|
"required": ["statusCode", "error", "message"],
|
|
"title": "errorSchema"
|
|
}
|
|
},
|
|
"paths": {
|
|
"/bucket/": {
|
|
"post": {
|
|
"summary": "Create a bucket",
|
|
"tags": ["bucket"],
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": { "type": "string", "examples": ["avatars"] },
|
|
"id": { "type": "string", "examples": ["avatars"] },
|
|
"public": { "type": "boolean", "examples": [false] }
|
|
},
|
|
"required": ["name"]
|
|
}
|
|
},
|
|
{ "in": "header", "name": "authorization", "required": true, "type": "string" }
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Default Response",
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": { "name": { "type": "string", "examples": ["avatars"] } },
|
|
"required": ["name"]
|
|
}
|
|
},
|
|
"400": { "description": "Default Response", "schema": { "$ref": "#/definitions/def-1" } }
|
|
}
|
|
},
|
|
"get": {
|
|
"summary": "Gets all buckets",
|
|
"tags": ["bucket"],
|
|
"parameters": [
|
|
{ "in": "header", "name": "authorization", "required": true, "type": "string" }
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Default Response",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$id": "bucketSchema",
|
|
"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,
|
|
"examples": [
|
|
{
|
|
"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"
|
|
}
|
|
],
|
|
"title": "bucketSchema"
|
|
},
|
|
"examples": [
|
|
[
|
|
{
|
|
"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"
|
|
}
|
|
]
|
|
]
|
|
}
|
|
},
|
|
"400": { "description": "Default Response", "schema": { "$ref": "#/definitions/def-1" } }
|
|
}
|
|
}
|
|
},
|
|
"/bucket/{bucketId}/empty": {
|
|
"post": {
|
|
"summary": "Empty a bucket",
|
|
"tags": ["bucket"],
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"examples": ["avatars"],
|
|
"required": true,
|
|
"in": "path",
|
|
"name": "bucketId"
|
|
},
|
|
{ "in": "header", "name": "authorization", "required": true, "type": "string" }
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Default Response",
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"message": { "type": "string", "examples": ["Successfully emptied"] }
|
|
}
|
|
}
|
|
},
|
|
"400": { "description": "Default Response", "schema": { "$ref": "#/definitions/def-1" } }
|
|
}
|
|
}
|
|
},
|
|
"/bucket/{bucketId}": {
|
|
"get": {
|
|
"summary": "Get details of a bucket",
|
|
"tags": ["bucket"],
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"examples": ["avatars"],
|
|
"required": true,
|
|
"in": "path",
|
|
"name": "bucketId"
|
|
},
|
|
{ "in": "header", "name": "authorization", "required": true, "type": "string" }
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Default Response",
|
|
"schema": {
|
|
"$id": "todo.com",
|
|
"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,
|
|
"examples": [
|
|
{
|
|
"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"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"400": { "description": "Default Response", "schema": { "$ref": "#/definitions/def-1" } }
|
|
}
|
|
},
|
|
"put": {
|
|
"summary": "Update properties of a bucket",
|
|
"tags": ["bucket"],
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": { "public": { "type": "boolean", "examples": [false] } }
|
|
}
|
|
},
|
|
{ "in": "header", "name": "authorization", "required": true, "type": "string" }
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Default Response",
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"message": { "type": "string", "examples": ["Successfully updated"] }
|
|
},
|
|
"required": ["message"]
|
|
}
|
|
},
|
|
"400": { "description": "Default Response", "schema": { "$ref": "#/definitions/def-1" } }
|
|
}
|
|
},
|
|
"delete": {
|
|
"summary": "Delete a bucket",
|
|
"tags": ["bucket"],
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"examples": ["avatars"],
|
|
"required": true,
|
|
"in": "path",
|
|
"name": "bucketId"
|
|
},
|
|
{ "in": "header", "name": "authorization", "required": true, "type": "string" }
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Default Response",
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"message": { "type": "string", "examples": ["Successfully deleted"] }
|
|
}
|
|
}
|
|
},
|
|
"400": { "description": "Default Response", "schema": { "$ref": "#/definitions/def-1" } }
|
|
}
|
|
}
|
|
},
|
|
"/object/{bucketName}/{wildcard}": {
|
|
"delete": {
|
|
"summary": "Delete an object",
|
|
"tags": ["object"],
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"examples": ["avatars"],
|
|
"required": true,
|
|
"in": "path",
|
|
"name": "bucketName"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"examples": ["folder/cat.png"],
|
|
"required": true,
|
|
"in": "path",
|
|
"name": "*"
|
|
},
|
|
{ "in": "header", "name": "authorization", "required": true, "type": "string" }
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Default Response",
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"message": { "type": "string", "examples": ["Successfully deleted"] }
|
|
}
|
|
}
|
|
},
|
|
"400": { "description": "Default Response", "schema": { "$ref": "#/definitions/def-1" } }
|
|
}
|
|
},
|
|
"get": {
|
|
"summary": "Get object (deprecated)",
|
|
"description": "use GET /object/authenticated/{bucketName} instead",
|
|
"tags": ["deprecated"],
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"examples": ["avatars"],
|
|
"required": true,
|
|
"in": "path",
|
|
"name": "bucketName"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"examples": ["folder/cat.png"],
|
|
"required": true,
|
|
"in": "path",
|
|
"name": "*"
|
|
},
|
|
{ "in": "header", "name": "authorization", "required": true, "type": "string" }
|
|
],
|
|
"responses": {
|
|
"400": { "description": "Default Response", "schema": { "$ref": "#/definitions/def-1" } }
|
|
}
|
|
},
|
|
"put": {
|
|
"summary": "Update the object at an existing key",
|
|
"tags": ["object"],
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"examples": ["avatars"],
|
|
"required": true,
|
|
"in": "path",
|
|
"name": "bucketName"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"examples": ["folder/cat.png"],
|
|
"required": true,
|
|
"in": "path",
|
|
"name": "*"
|
|
},
|
|
{ "in": "header", "name": "authorization", "required": true, "type": "string" }
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Default Response",
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"Key": { "type": "string", "examples": ["projectref/avatars/folder/cat.png"] }
|
|
},
|
|
"required": ["Key"]
|
|
}
|
|
},
|
|
"400": { "description": "Default Response", "schema": { "$ref": "#/definitions/def-1" } }
|
|
}
|
|
},
|
|
"post": {
|
|
"summary": "Upload a new object",
|
|
"tags": ["object"],
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"examples": ["avatars"],
|
|
"required": true,
|
|
"in": "path",
|
|
"name": "bucketName"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"examples": ["folder/cat.png"],
|
|
"required": true,
|
|
"in": "path",
|
|
"name": "*"
|
|
},
|
|
{ "in": "header", "name": "authorization", "required": true, "type": "string" }
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Default Response",
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": { "Key": { "type": "string", "examples": ["avatars/folder/cat.png"] } },
|
|
"required": ["Key"]
|
|
}
|
|
},
|
|
"400": { "description": "Default Response", "schema": { "$ref": "#/definitions/def-1" } }
|
|
}
|
|
}
|
|
},
|
|
"/object/{bucketName}": {
|
|
"delete": {
|
|
"summary": "Delete multiple objects",
|
|
"tags": ["object"],
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"prefixes": {
|
|
"type": "array",
|
|
"items": { "type": "string" },
|
|
"minItems": 1,
|
|
"examples": [["folder/cat.png", "folder/morecats.png"]]
|
|
}
|
|
},
|
|
"required": ["prefixes"]
|
|
}
|
|
},
|
|
{
|
|
"type": "string",
|
|
"examples": ["avatars"],
|
|
"required": true,
|
|
"in": "path",
|
|
"name": "bucketName"
|
|
},
|
|
{ "in": "header", "name": "authorization", "required": true, "type": "string" }
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Default Response",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$id": "objectSchema",
|
|
"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": {
|
|
"$id": "bucketSchema",
|
|
"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,
|
|
"examples": [
|
|
{
|
|
"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,
|
|
"examples": [
|
|
{
|
|
"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 }
|
|
}
|
|
],
|
|
"title": "objectSchema"
|
|
}
|
|
}
|
|
},
|
|
"400": { "description": "Default Response", "schema": { "$ref": "#/definitions/def-1" } }
|
|
}
|
|
}
|
|
},
|
|
"/object/authenticated/{bucketName}/{wildcard}": {
|
|
"get": {
|
|
"summary": "Retrieve an object",
|
|
"tags": ["object"],
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"examples": ["avatars"],
|
|
"required": true,
|
|
"in": "path",
|
|
"name": "bucketName"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"examples": ["folder/cat.png"],
|
|
"required": true,
|
|
"in": "path",
|
|
"name": "*"
|
|
},
|
|
{ "in": "header", "name": "authorization", "required": true, "type": "string" }
|
|
],
|
|
"responses": {
|
|
"400": { "description": "Default Response", "schema": { "$ref": "#/definitions/def-1" } }
|
|
}
|
|
}
|
|
},
|
|
"/object/sign/{bucketName}/{wildcard}": {
|
|
"post": {
|
|
"summary": "Generate a presigned url to retrieve an object",
|
|
"tags": ["object"],
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"expiresIn": { "type": "integer", "minimum": 1, "examples": [60000] }
|
|
},
|
|
"required": ["expiresIn"]
|
|
}
|
|
},
|
|
{
|
|
"type": "string",
|
|
"examples": ["avatars"],
|
|
"required": true,
|
|
"in": "path",
|
|
"name": "bucketName"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"examples": ["folder/cat.png"],
|
|
"required": true,
|
|
"in": "path",
|
|
"name": "*"
|
|
},
|
|
{ "in": "header", "name": "authorization", "required": true, "type": "string" }
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Default Response",
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"signedURL": {
|
|
"type": "string",
|
|
"examples": [
|
|
"/object/sign/avatars/folder/cat.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1cmwiOiJhdmF0YXJzL2ZvbGRlci9jYXQucG5nIiwiaWF0IjoxNjE3NzI2MjczLCJleHAiOjE2MTc3MjcyNzN9.s7Gt8ME80iREVxPhH01ZNv8oUn4XtaWsmiQ5csiUHn4"
|
|
]
|
|
}
|
|
},
|
|
"required": ["signedURL"]
|
|
}
|
|
},
|
|
"400": { "description": "Default Response", "schema": { "$ref": "#/definitions/def-1" } }
|
|
}
|
|
},
|
|
"get": {
|
|
"summary": "Retrieve an object via a presigned URL",
|
|
"tags": ["object"],
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"examples": [
|
|
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1cmwiOiJidWNrZXQyL3B1YmxpYy9zYWRjYXQtdXBsb2FkMjMucG5nIiwiaWF0IjoxNjE3NzI2MjczLCJleHAiOjE2MTc3MjcyNzN9.uBQcXzuvXxfw-9WgzWMBfE_nR3VOgpvfZe032sfLSSk"
|
|
],
|
|
"required": true,
|
|
"in": "query",
|
|
"name": "token"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"examples": ["avatars"],
|
|
"required": true,
|
|
"in": "path",
|
|
"name": "bucketName"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"examples": ["folder/cat.png"],
|
|
"required": true,
|
|
"in": "path",
|
|
"name": "*"
|
|
}
|
|
],
|
|
"responses": {
|
|
"400": { "description": "Default Response", "schema": { "$ref": "#/definitions/def-1" } }
|
|
}
|
|
}
|
|
},
|
|
"/object/sign/{bucketName}": {
|
|
"post": {
|
|
"summary": "Generate presigned urls to retrieve objects",
|
|
"tags": ["object"],
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"expiresIn": { "type": "integer", "minimum": 1, "examples": [60000] },
|
|
"paths": {
|
|
"type": "array",
|
|
"items": { "type": "string" },
|
|
"minItems": 1,
|
|
"examples": [["folder/cat.png", "folder/morecats.png"]]
|
|
}
|
|
},
|
|
"required": ["expiresIn", "paths"]
|
|
}
|
|
},
|
|
{
|
|
"type": "string",
|
|
"examples": ["avatars"],
|
|
"required": true,
|
|
"in": "path",
|
|
"name": "bucketName"
|
|
},
|
|
{ "in": "header", "name": "authorization", "required": true, "type": "string" }
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Default Response",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"error": {
|
|
"error": ["string", "null"],
|
|
"examples": ["Either the object does not exist or you do not have access to it"]
|
|
},
|
|
"path": { "type": "string", "examples": ["folder/cat.png"] },
|
|
"signedURL": {
|
|
"type": ["string", "null"],
|
|
"examples": [
|
|
"/object/sign/avatars/folder/cat.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1cmwiOiJhdmF0YXJzL2ZvbGRlci9jYXQucG5nIiwiaWF0IjoxNjE3NzI2MjczLCJleHAiOjE2MTc3MjcyNzN9.s7Gt8ME80iREVxPhH01ZNv8oUn4XtaWsmiQ5csiUHn4"
|
|
]
|
|
}
|
|
},
|
|
"required": ["error", "path", "signedURL"]
|
|
}
|
|
}
|
|
},
|
|
"400": { "description": "Default Response", "schema": { "$ref": "#/definitions/def-1" } }
|
|
}
|
|
}
|
|
},
|
|
"/object/move": {
|
|
"post": {
|
|
"summary": "Moves an object",
|
|
"tags": ["object"],
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"bucketId": { "type": "string", "examples": ["avatars"] },
|
|
"sourceKey": { "type": "string", "examples": ["folder/cat.png"] },
|
|
"destinationKey": { "type": "string", "examples": ["folder/newcat.png"] }
|
|
},
|
|
"required": ["bucketId", "sourceKey", "destinationKey"]
|
|
}
|
|
},
|
|
{ "in": "header", "name": "authorization", "required": true, "type": "string" }
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Default Response",
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": { "message": { "type": "string", "examples": ["Successfully moved"] } },
|
|
"required": ["message"]
|
|
}
|
|
},
|
|
"400": { "description": "Default Response", "schema": { "$ref": "#/definitions/def-1" } }
|
|
}
|
|
}
|
|
},
|
|
"/object/list/{bucketName}": {
|
|
"post": {
|
|
"summary": "Search for objects under a prefix",
|
|
"tags": ["object"],
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"prefix": { "type": "string", "examples": ["folder/subfolder"] },
|
|
"limit": { "type": "integer", "minimum": 1, "examples": [10] },
|
|
"offset": { "type": "integer", "minimum": 0, "examples": [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"]
|
|
}
|
|
},
|
|
{ "type": "string", "required": true, "in": "path", "name": "bucketName" },
|
|
{ "in": "header", "name": "authorization", "required": true, "type": "string" }
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Default Response",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$id": "objectSchema",
|
|
"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": {
|
|
"$id": "bucketSchema",
|
|
"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,
|
|
"examples": [
|
|
{
|
|
"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,
|
|
"examples": [
|
|
{
|
|
"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 }
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"400": { "description": "Default Response", "schema": { "$ref": "#/definitions/def-1" } }
|
|
}
|
|
}
|
|
},
|
|
"/object/copy": {
|
|
"post": {
|
|
"summary": "Copies an object",
|
|
"tags": ["object"],
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"sourceKey": { "type": "string", "examples": ["folder/source.png"] },
|
|
"bucketId": { "type": "string", "examples": ["avatars"] },
|
|
"destinationKey": { "type": "string", "examples": ["folder/destination.png"] }
|
|
},
|
|
"required": ["sourceKey", "bucketId", "destinationKey"]
|
|
}
|
|
},
|
|
{ "in": "header", "name": "authorization", "required": true, "type": "string" }
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Default Response",
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": { "Key": { "type": "string", "examples": ["folder/destination.png"] } },
|
|
"required": ["Key"]
|
|
}
|
|
},
|
|
"400": { "description": "Default Response", "schema": { "$ref": "#/definitions/def-1" } }
|
|
}
|
|
}
|
|
},
|
|
"/object/public/{bucketName}/{wildcard}": {
|
|
"get": {
|
|
"summary": "Retrieve an object from a public bucket",
|
|
"tags": ["object"],
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"examples": ["avatars"],
|
|
"required": true,
|
|
"in": "path",
|
|
"name": "bucketName"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"examples": ["folder/cat.png"],
|
|
"required": true,
|
|
"in": "path",
|
|
"name": "*"
|
|
}
|
|
],
|
|
"responses": {
|
|
"400": { "description": "Default Response", "schema": { "$ref": "#/definitions/def-1" } }
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
{ "name": "object", "description": "Object end-points" },
|
|
{ "name": "bucket", "description": "Bucket end-points" },
|
|
{ "name": "deprecated", "description": "Deprecated end-points" }
|
|
]
|
|
}
|