For AI agents: The documentation index is at https://docs.digitalocean.com/llms.txt. Markdown versions of pages use the same URL with index.html.md in place of the HTML page (for example, append index.html.md to the directory path instead of opening the HTML document).
Spaces API Reference Documentation
Last verified 22 Jun 2026
Spaces exposes an S3-compatible RESTful XML API over HTTP. You can access the Spaces API in two ways:
Direct API calls: Sign requests with an Authorization header, add common headers, and call bucket or object operations.
The API accepts standard HTTP/1.1 and HTTP/2 requests. The API returns HTTP/2 responses when supported by the client and otherwise returns HTTP/1.1 responses. Some HTTP/2 requests are downgraded to HTTP/1.1 for operational reasons, as permitted by the HTTP/2 specification.
Authentication
Requests to the Spaces API must include an HTTP Authorization header. Spaces supports AWS Signature Version 4 (SigV4) (recommended) and Signature Version 2 (SigV2) for legacy clients. Throughout the examples below, SigV4 is used. When using a client library, signatures are generated automatically.
Spaces supports a set of standard request and response headers. These headers control authentication, content metadata, and connection behavior.
Request Headers
The following table lists the most common request headers supported by Spaces:
Name
Description
Authorization
Contains AWS Signature Version 4 (SigV4) or Version 2 (SigV2) authentication details.
Content-Length
Size of the request body in bytes. Required for PUT requests with an XML body.
Content-Type
MIME type of the request body, for example text/plain.
Date
RFC 2822-formatted UTC timestamp, for example Mon, 10 Jul 2017 19:05:09 +0000.
Host
Endpoint of the request, either ${REGION}.digitaloceanspaces.com or ${BUCKET}.${REGION}.digitaloceanspaces.com.
x-amz-content-sha256
SHA256 hash of the request payload. Required for SigV4 authentication.
x-amz-date
ISO 8601-formatted timestamp, for example 20170803T172753Z.
Response Headers
The following table lists the response headers you may see in a Spaces API response:
Name
Description
Content-Length
Size of the response body in bytes.
Content-Type
MIME type of the response body.
Connection
Indicates whether the connection remains open or closes after the response.
Date
Date and time of the response in UTC.
ETag
MD5 hash of the object.
x-amz-request-id
Unique identifier for the request.
Permissions and Access Levels
In the DigitalOcean Control Panel, you can scope Spaces access keys to three high-level permission levels. Each S3 operation below lists the minimum required level. When possible, use the least-privileged key that meets your needs.
Every request requires a key with at least one of these permission levels:
CreateBucket, DeleteBucket, ListBuckets, bucket CORS/Lifecycle/Policy/Website get/put/delete, PutBucketVersioning, etc.
Supported S3 API Commands
Spaces implements a subset of the Amazon S3 API. Each command below lists the minimum permissions, supported headers, and an example request/response.
Bucket Management
Use these commands to create, delete, and check the status of buckets.
CreateBucket
Creates a new Space (bucket). Requires All (Buckets and Objects) permissions. The region comes from the endpoint. Bucket names must be DNS-compliant and unique per region. Based on AWS CreateBucket.
Request Method
Required Headers
Supported Headers
PUT
• x-amz-acl
This request creates a new bucket with a private ACL:
Lists objects in a bucket (legacy). Based on AWS ListObjects. Requires Read (Objects) permissions. For guidance on when to use legacy ListObjects versus ListObjectsV2, see S3 Compatibility.
Lists objects in a bucket. Based on AWS ListObjectsV2. Requires Read (Objects) permissions. For guidance on when to use legacy ListObjects versus ListObjectsV2, see S3 Compatibility.
Uploads an object using a browser-based form POST. Based on AWS RESTObjectPOST. Requires Read/Write/Delete (Objects) permissions.
Request Method
Required Headers
Supported Headers
POST
• Policy form fields per AWS
PutBucketLogging
Enables server access logging for a bucket. Based on AWS PutBucketLogging. Requires All (Buckets and Objects) permissions. For logging restrictions, such as target bucket requirements, see S3 Compatibility.
The server responds with success if logging is enabled:
HTTP/1.1200OKContent-Length:0
Advanced Object Uploads
Use these commands to upload large objects in smaller parts. Multipart uploads allow parallel transfers, resumable uploads, and files larger than the single-upload limit.
CreateMultipartUpload
Starts a multipart upload. Based on AWS CreateMultipartUpload. Requires Read/Write/Delete (Objects) permissions.
Lists in-progress multipart uploads. Based on AWS ListMultipartUploads. Requires Read (Objects) permissions.
Request Method
Required Headers
Supported Headers
GET
• x-amz-expected-bucket-owner
ListParts
Lists the parts already uploaded for a multipart upload. Based on AWS ListParts. Requires Read (Objects) permissions.
Request Method
Required Headers
Supported Headers
GET
• x-amz-expected-bucket-owner • x-amz-*
Policies and ACL
Use these commands to manage bucket-level and object-level permissions. For API and control panel availability and product limits, see S3 Compatibility.
PutBucketPolicy
Applies an IAM-style policy to a bucket. Based on AWS PutBucketPolicy. Requires All (Buckets and Objects) permissions.
Retrieves the access control list (ACL) for a bucket. Based on AWS GetBucketAcl. Requires All (Buckets and Objects) permissions.
Request Method
Required Headers
Supported Headers
GET
• x-amz-expected-bucket-owner
Versioning and Lifecycle
Use these commands to control object version history and apply lifecycle rules for automated cleanup. For lifecycle feature limits, see S3 Compatibility.
PutBucketVersioning
Enables or suspends versioning for a bucket. Based on AWS PutBucketVersioning. Requires All (Buckets and Objects) permissions.
Request Method
Required Headers
Supported Headers
PUT
• x-amz-expected-bucket-owner
GetBucketVersioning
Retrieves the versioning state of a bucket. Based on AWS GetBucketVersioning. Requires Read (Objects) permissions or higher.
Request Method
Required Headers
Supported Headers
GET
• x-amz-expected-bucket-owner
PutBucketLifecycleConfiguration
Applies lifecycle rules to a bucket. Based on AWS PutBucketLifecycleConfiguration. Requires All (Buckets and Objects) permissions.
Retrieves lifecycle rules for a bucket (legacy). Based on AWS GetBucketLifecycle. Requires All (Buckets and Objects) permissions. Use GetBucketLifecycleConfiguration for new applications.
Request Method
Required Headers
Supported Headers
GET
• x-amz-expected-bucket-owner
GetBucketLifecycleConfiguration
Retrieves lifecycle rules for a bucket. Based on AWS GetBucketLifecycleConfiguration. Requires All (Buckets and Objects) permissions.
Request Method
Required Headers
Supported Headers
GET
• x-amz-expected-bucket-owner
DeleteBucketLifecycle
Deletes lifecycle rules from a bucket. Based on AWS DeleteBucketLifecycle. Requires All (Buckets and Objects) permissions.
Request Method
Required Headers
Supported Headers
DELETE
• x-amz-expected-bucket-owner
PutBucketLifecycle
Applies lifecycle rules to a bucket (legacy). Based on AWS PutBucketLifecycle. Requires All (Buckets and Objects) permissions. Use PutBucketLifecycleConfiguration for new applications.
Retrieves the CORS rules for a bucket. Based on AWS GetBucketCors. Requires All (Buckets and Objects) permissions.
Request Method
Required Headers
Supported Headers
GET
• x-amz-expected-bucket-owner
DeleteBucketCors
Deletes the CORS rules from a bucket. Based on AWS DeleteBucketCors. Requires All (Buckets and Objects) permissions.
Request Method
Required Headers
Supported Headers
DELETE
• x-amz-expected-bucket-owner
PreflightObject
Performs a CORS preflight check. Browsers automatically send this request to verify CORS rules before an actual request. Requires no permissions. For related request behavior, see S3 Compatibility.
Request Method
Required Headers
Supported Headers
OPTIONS
• Standard CORS preflight headers
We can't find any results for your search.
Try using different keywords or simplifying your search terms.