Skip to main content

CreateBucket (Cloud Storage)

CreateBucket - Amazon Simple Storage Service

Supported headers and XML elements

✅Supported Headers x-amz-acl

  • private
  • public-read

✅Supported XML Element

  • LocationConstraint

Example request

PUT /mybucket HTTP/1.1
Host: [region]
Accept: text/xml
x-amz-acl: private
Content-Type: application/xml
X-Amz-Content-Sha256: beaead3198f7da1e70d03ab969765e0821b24fc913697e929e726aeaebf0eba3
X-Amz-Date: 20230927T152207Z
Authorization: AWS4-HMAC-SHA256 Credential=YOUR_TELNYX_API_KEY/20230927/test/execute-api/aws4_request, SignedHeaders=accept;content-length;content-type;host;x-amz-acl;x-amz-content-sha256;x-amz-date, Signature=eb67629c5cd507c56c5c5447323cc0190c605ab87c2b2fd3046825ca09a28425
Content-Length: 197

<?xml version="1.0" encoding="UTF-8"?>
<CreateBucketConfiguration xmlns="">

Bucket’s location is inherited from the regional endpoint to which you sent the CreateBucket request. If LocationConstraint is specified in the request body, its value must match that of the location in the regional endpoint. Otherwise, an error will be returned.

<?xml version="1.0" encoding="UTF-8"?>
<Message>The specified location-constraint is not valid</Message>

In general, bucket names should follow domain name constraints.

Bucket names

  • must be unique.
  • cannot be formatted as IP address.
  • can be between 3 and 63 characters long.
  • must not contain uppercase characters or underscores.
  • must start with a lowercase letter or number.
  • can contain a dash (-).
  • must be a series of one or more labels. Adjacent labels are separated by a single period (.). Bucket names can contain lowercase letters, numbers, and hyphens. Each label must start and end with a lowercase letter or a number.

Otherwise the following error will be returned

<?xml version="1.0" encoding="UTF-8"?>

On this page