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
| Parameter | Type | Constraints | Description | Example |
|---|---|---|---|---|
| name | string | required | Bucket name | assets |
| resource_id | integer | > 0, required | Resource ID | 2 |
| headers | object[] | List of additional HTTP headers | ||
| headers.key | string | Header name | X-MEDIA-TYPE | |
| headers.value | string | Header 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
| Parameter | Type | Description |
|---|---|---|
| id | integer | Bucket ID |
| name | string | Bucket name |
| status | string | CDN status for the bucket |
| resource_id | integer | Resource ID |
| last_cache_cleanup | string | Last cache cleanup time for the bucket |
| headers | object[] | List of additional HTTP headers |
| headers.key | string | Header name |
| headers.value | string | Header 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"
}