/buckets/list
List details about all buckets in the project that the API key belongs to. The results can be paginated. The results can also be filtered using startDate
and endDate
which are based on the creation date of your buckets.
page
number
Jump to a specific page of results.
limit
number
Limit the number of items on a result page.
startDate
string
The starting date for filtering buckets based on the date they were created. This attribute accepts ISO 8601 dates in YYYY-MM-DD
format.
endDate
string
The ending date for filtering buckets based on the date they were created. This attribute accepts ISO 8601 dates in YYYY-MM-DD
format.
{
"page": 1,
"limit": 10,
"startDate": "2024-10-01",
"endDate": "2024-10-15"
}
Successful response
{
"success": true,
"message": "string",
"data": {
"docs": [
{
"org": "org-a01f25f9ae6340bd970144141d331234",
"project": "prj-c3b08d852de54d64a4a15c39ad451234",
"createdBy": "usr-6b5f02d47e6d4682a62262d6174c1234",
"bucketName": "website-assets",
"createdAt": "2024-10-11T00:16:38.112Z",
"updatedAt": "2024-10-12T00:16:38.112Z",
"bucketId": "bkt-aad2347b90864b3f9c15e8b67ee81234"
}
],
"pagination": {
"totalDocs": 15,
"limit": 20,
"page": 1,
"totalPages": 5,
"pagingCounter": 11,
"prevPage": 1,
"nextPage": 3
}
}
}
/buckets
Create a bucket in the project that the API key belongs to.
bucketName
string
required
Create a bucket using this bucket name. Check out the bucket naming conventions here.
region
string
required
Create a bucket in this hosting region. Possible value: sa-1
.
isPrivate
boolean
Set to false
if you want to allow public access to the objects in this bucket. Defaults to true
.
{
"bucketName": "website-assets",
"region": "sa-1",
"isPrivate": true
}
Successful response
{
"success": true,
"message": "A new bucket {bucketName} was created.",
"data": {
"org": "org-a01f25f9ae6340bd970144141d331234",
"project": "prj-c3b08d852de54d64a4a15c39ad451234",
"createdBy": "usr-6b5f02d47e6d4682a62262d6174c1234",
"bucketName": "website-assets",
"createdAt": "2024-10-11T00:16:38.112Z",
"updatedAt": "2024-10-12T00:16:38.112Z",
"bucketId": "bkt-aad2347b90864b3f9c15e8b67ee81234"
}
}
/buckets/{bucketName}/empty
Remove all objects from a bucket. This is required before you can delete the bucket.
bucketName
string
required
The name of the storage bucket you want to empty.
Successful response
{
"success": true,
"message": "string",
"data": "string"
}
/buckets/{bucketName}
Retrieve details about a bucket based on its name.
bucketName
string
required
The name of the storage bucket you want to retrieve.
Successful response
{
"success": true,
"message": "string",
"data": {
"org": "org-a01f25f9ae6340bd970144141d331234",
"project": "prj-c3b08d852de54d64a4a15c39ad451234",
"createdBy": "usr-6b5f02d47e6d4682a62262d6174c1234",
"bucketName": "website-assets",
"createdAt": "2024-10-11T00:16:38.112Z",
"updatedAt": "2024-10-12T00:16:38.112Z",
"bucketId": "bkt-aad2347b90864b3f9c15e8b67ee81234"
}
}
/buckets/{bucketName}
Delete a bucket. Only empty buckets can be deleted.
bucketName
string
required
The name of the storage bucket you want to delete.
No content
{
"success": true,
"message": "Bucket successfully deleted.",
"data": "string"
}
Was this page helpful?