Skip to main content
Version: Next

Create Bucket

This method creates buckets within the specified S3 resource

info

CDN is automatically activated when a bucket is created

info

Additional headers specified during creation will be added to all server responses when accessing the corresponding bucket

Request Parameters

POST /api/clients/v1/s3Buckets/

Headers

  • Content-Type: application/json
  • Authorization: Bearer $access_token

JSON body

ParameterTypeConstraintsDescriptionExample
namestringrequiredBucket nameassets
resource_idinteger> 0, requiredResource ID2
headersobject[]List of additional HTTP headers
headers.keystringHeader nameX-MEDIA-TYPE
headers.valuestringHeader value.pptx
note

Bucket name must comply with the rules specified by the S3 provider and be unique within a single resource

Response Parameters

JSON body

ParameterTypeDescription
idintegerBucket ID
namestringBucket name
statusstringCDN status for the bucket
resource_idintegerResource ID
last_cache_cleanupstringLast cache cleanup time for the bucket
headersobject[]List of additional HTTP headers
headers.keystringHeader name
headers.valuestringHeader value
201 Created

Bucket object

{
"id": 46,
"name": "media",
"status": "ok",
"resource_id": 16,
"last_cache_cleanup": null,
"headers": [
{
"key": "X-MEDIA-TYPE",
"value": ".pptx"
}
]
}
400 Bad Request

Invalid or missing required body parameters

{
"name": [
"Bucket name is not a valid string"
],
"resource_id": [
"This field is required."
]
}
401 Unauthorized

Authentication credentials missing or invalid

{
"detail": "Given token not valid for any token type",
"code": "token_not_valid",
"messages": [
{
"token_class": "AccessToken",
"token_type": "access",
"message": "Token is invalid or expired"
}
]
}
403 Forbidden

Resource can only be associated with your own project

{
"detail": "Only project participants can create buckets for this project"
}
409 Conflict

Resource with these parameters already exists

{
"detail": "Bucket with this name already exists"
}