Amazon Simple Storage Service¶
Description¶
For information about using the Amazon S3 API—including authentication, signing requests, code examples, and error handling—see the Amazon S3 Developer Guide.
Welcome to the Amazon S3 API Reference. This guide explains the Amazon Simple Storage Service (Amazon S3) application programming interface (API).
Welcome to the Amazon S3 API Reference. This guide explains the Amazon Simple Storage Service (Amazon S3) application programming interface (API).
You can use any toolkit that supports HTTP to use the REST API. You can even use a browser to fetch objects, as long as they are anonymously readable.
The REST API uses the standard HTTP headers and status codes, so that standard browsers and toolkits work as expected. In some areas, we have added functionality to HTTP (for example, we added headers to support access control). In these cases, we have done our best to add the new functionality in a way that matched the style of standard HTTP usage.
The current version of the Amazon S3 API is 2006-03-01.
Amazon S3 supports the REST API.
Support for SOAP over HTTP is deprecated, but it is still available over HTTPS. However, new Amazon S3 features will not be supported for SOAP. We recommend that you use either this REST API or the Amazon Web Services SDKs.
Usage¶
Arguments¶
-
configOptional configuration of credentials, endpoint, and/or region.
- credentials:
- creds:
- access_key_id: AWS access key ID
- secret_access_key: AWS secret access key
- session_token: AWS temporary session token
- profile: The name of a profile to use. If not given, then the default profile is used.
- anonymous: Set anonymous credentials.
- creds:
- endpoint: The complete URL to use for the constructed client.
- region: The AWS Region used in instantiating the client.
- close_connection: Immediately close all HTTP connections.
- timeout: The time in seconds till a timeout exception is thrown when attempting to make a connection. The default is 60 seconds.
- s3_force_path_style: Set this to
trueto force the request to use path-style addressing, i.e.http://s3.amazonaws.com/BUCKET/KEY. - sts_regional_endpoint: Set sts regional endpoint resolver to regional or legacy https://docs.aws.amazon.com/sdkref/latest/guide/feature-sts-regionalized-endpoints.html
- use_dual_stack: Set this to
trueto use the dualstack (IPv4 and IPv6) endpoint for a service, where available, falling back to the regular endpoint when it isn't. Defaults to theAWS_USE_DUALSTACK_ENDPOINTenvironment variable when unset.
- credentials:
-
credentialsOptional credentials shorthand for the config parameter
- creds:
- access_key_id: AWS access key ID
- secret_access_key: AWS secret access key
- session_token: AWS temporary session token
- profile: The name of a profile to use. If not given, then the default profile is used.
- anonymous: Set anonymous credentials.
- creds:
-
endpointOptional shorthand for complete URL to use for the constructed client.
-
regionOptional shorthand for AWS Region used in instantiating the client.
Value¶
A client for the service. You can call the service's operations using syntax like svc$operation(...), where svc is the name you've assigned to the client. The available operations are listed in the Operations section.
Service syntax¶
svc <- s3(
config = list(
credentials = list(
creds = list(
access_key_id = "string",
secret_access_key = "string",
session_token = "string"
),
profile = "string",
anonymous = "logical"
),
endpoint = "string",
region = "string",
close_connection = "logical",
timeout = "numeric",
s3_force_path_style = "logical",
sts_regional_endpoint = "string",
use_dual_stack = "logical"
),
credentials = list(
creds = list(
access_key_id = "string",
secret_access_key = "string",
session_token = "string"
),
profile = "string",
anonymous = "logical"
),
endpoint = "string",
region = "string"
)
Operations¶
abort_multipart_upload |
This operation aborts a multipart upload |
|---|---|
complete_multipart_upload |
Completes a multipart upload by assembling previously uploaded parts |
copy_object |
Creates a copy of an object that is already stored in Amazon S3 |
create_bucket |
This action creates an Amazon S3 bucket |
create_bucket_metadata_configuration |
Creates an S3 Metadata V2 metadata configuration for a general purpose bucket |
create_bucket_metadata_table_configuration |
We recommend that you create your S3 Metadata configurations by using the V2 CreateBucketMetadataConfiguration API operation |
create_multipart_upload |
End of support notice: As of October 1, 2025, Amazon S3 has discontinued support for Email Grantee Access Control Lists (ACLs) |
create_session |
Creates a session that establishes temporary security credentials to support fast authentication and authorization for the Zonal endpoint API operations on directory buckets |
delete_bucket |
Deletes the S3 bucket |
delete_bucket_analytics_configuration |
This operation is not supported for directory buckets |
delete_bucket_cors |
This operation is not supported for directory buckets |
delete_bucket_encryption |
This implementation of the DELETE action resets the default encryption for the bucket as server-side encryption with Amazon S3 managed keys (SSE-S3) |
delete_bucket_intelligent_tiering_configuration |
This operation is not supported for directory buckets |
delete_bucket_inventory_configuration |
Deletes an S3 Inventory configuration (identified by the inventory ID) from the bucket |
delete_bucket_lifecycle |
Deletes the lifecycle configuration from the specified bucket |
delete_bucket_metadata_configuration |
Deletes an S3 Metadata configuration from a general purpose bucket |
delete_bucket_metadata_table_configuration |
We recommend that you delete your S3 Metadata configurations by using the V2 DeleteBucketMetadataTableConfiguration API operation |
delete_bucket_metrics_configuration |
Deletes a metrics configuration for the Amazon CloudWatch request metrics (specified by the metrics configuration ID) from the bucket |
delete_bucket_ownership_controls |
This operation is not supported for directory buckets |
delete_bucket_policy |
Deletes the policy of a specified bucket |
delete_bucket_replication |
This operation is not supported for directory buckets |
delete_bucket_tagging |
This operation is not supported for directory buckets |
delete_bucket_website |
This operation is not supported for directory buckets |
delete_object |
Removes an object from a bucket |
delete_object_annotation |
Deletes a specific annotation from an Amazon S3 object |
delete_objects |
This operation enables you to delete multiple objects from a bucket using a single HTTP request |
delete_object_tagging |
This operation is not supported for directory buckets |
delete_public_access_block |
This operation is not supported for directory buckets |
download_file |
Download a file from S3 and store it at a specified file location |
generate_presigned_post |
@title Generate the url and form fields used for a presigned s3 post |
generate_presigned_url |
@title Generate a presigned url given a client, its method, and arguments |
get_bucket_abac |
Returns the attribute-based access control (ABAC) property of the general purpose bucket |
get_bucket_accelerate_configuration |
This operation is not supported for directory buckets |
get_bucket_acl |
This operation is not supported for directory buckets |
get_bucket_analytics_configuration |
This operation is not supported for directory buckets |
get_bucket_cors |
This operation is not supported for directory buckets |
get_bucket_encryption |
Returns the default encryption configuration for an Amazon S3 bucket |
get_bucket_intelligent_tiering_configuration |
This operation is not supported for directory buckets |
get_bucket_inventory_configuration |
Returns an S3 Inventory configuration (identified by the inventory configuration ID) from the bucket |
get_bucket_lifecycle |
For an updated version of this API, see GetBucketLifecycleConfiguration |
get_bucket_lifecycle_configuration |
Returns the lifecycle configuration information set on the bucket |
get_bucket_location |
Using the GetBucketLocation operation is no longer a best practice |
get_bucket_logging |
This operation is not supported for directory buckets |
get_bucket_metadata_configuration |
Retrieves the S3 Metadata configuration for a general purpose bucket |
get_bucket_metadata_table_configuration |
We recommend that you retrieve your S3 Metadata configurations by using the V2 GetBucketMetadataTableConfiguration API operation |
get_bucket_metrics_configuration |
Gets a metrics configuration (specified by the metrics configuration ID) from the bucket |
get_bucket_notification |
This operation is not supported for directory buckets |
get_bucket_notification_configuration |
This operation is not supported for directory buckets |
get_bucket_ownership_controls |
This operation is not supported for directory buckets |
get_bucket_policy |
Returns the policy of a specified bucket |
get_bucket_policy_status |
This operation is not supported for directory buckets |
get_bucket_replication |
This operation is not supported for directory buckets |
get_bucket_request_payment |
This operation is not supported for directory buckets |
get_bucket_tagging |
This operation is not supported for directory buckets |
get_bucket_versioning |
This operation is not supported for directory buckets |
get_bucket_website |
This operation is not supported for directory buckets |
get_object |
Retrieves an object from Amazon S3 |
get_object_acl |
This operation is not supported for directory buckets |
get_object_annotation |
Retrieves an annotation from an Amazon S3 object |
get_object_attributes |
Retrieves all of the metadata from an object without returning the object itself |
get_object_legal_hold |
This operation is not supported for directory buckets |
get_object_lock_configuration |
This operation is not supported for directory buckets |
get_object_retention |
This operation is not supported for directory buckets |
get_object_tagging |
This operation is not supported for directory buckets |
get_object_torrent |
This operation is not supported for directory buckets |
get_public_access_block |
This operation is not supported for directory buckets |
head_bucket |
You can use this operation to determine if a bucket exists and if you have permission to access it |
head_object |
The HEAD operation retrieves metadata from an object without returning the object itself |
list_bucket_analytics_configurations |
This operation is not supported for directory buckets |
list_bucket_intelligent_tiering_configurations |
This operation is not supported for directory buckets |
list_bucket_inventory_configurations |
Returns a list of S3 Inventory configurations for the bucket |
list_bucket_metrics_configurations |
Lists the metrics configurations for the bucket |
list_buckets |
This operation is not supported for directory buckets |
list_directory_buckets |
Returns a list of all Amazon S3 directory buckets owned by the authenticated sender of the request |
list_multipart_uploads |
This operation lists in-progress multipart uploads in a bucket |
list_object_annotations |
Lists the annotations attached to an Amazon S3 object |
list_objects |
This operation is not supported for directory buckets |
list_objects_v2 |
Returns some or all (up to 1,000) of the objects in a bucket with each request |
list_object_versions |
This operation is not supported for directory buckets |
list_parts |
Lists the parts that have been uploaded for a specific multipart upload |
put_bucket_abac |
Sets the attribute-based access control (ABAC) property of the general purpose bucket |
put_bucket_accelerate_configuration |
This operation is not supported for directory buckets |
put_bucket_acl |
End of support notice: As of October 1, 2025, Amazon S3 has discontinued support for Email Grantee Access Control Lists (ACLs) |
put_bucket_analytics_configuration |
This operation is not supported for directory buckets |
put_bucket_cors |
This operation is not supported for directory buckets |
put_bucket_encryption |
This operation configures default encryption and Amazon S3 Bucket Keys for an existing bucket |
put_bucket_intelligent_tiering_configuration |
This operation is not supported for directory buckets |
put_bucket_inventory_configuration |
This implementation of the PUT action adds an S3 Inventory configuration (identified by the inventory ID) to the bucket |
put_bucket_lifecycle |
This operation is not supported for directory buckets |
put_bucket_lifecycle_configuration |
Creates a new lifecycle configuration for the bucket or replaces an existing lifecycle configuration |
put_bucket_logging |
End of support notice: As of October 1, 2025, Amazon S3 has discontinued support for Email Grantee Access Control Lists (ACLs) |
put_bucket_metrics_configuration |
Sets a metrics configuration (specified by the metrics configuration ID) for the bucket |
put_bucket_notification |
This operation is not supported for directory buckets |
put_bucket_notification_configuration |
This operation is not supported for directory buckets |
put_bucket_ownership_controls |
This operation is not supported for directory buckets |
put_bucket_policy |
Applies an Amazon S3 bucket policy to an Amazon S3 bucket |
put_bucket_replication |
This operation is not supported for directory buckets |
put_bucket_request_payment |
This operation is not supported for directory buckets |
put_bucket_tagging |
This operation is not supported for directory buckets |
put_bucket_versioning |
This operation is not supported for directory buckets |
put_bucket_website |
This operation is not supported for directory buckets |
put_object |
End of support notice: As of October 1, 2025, Amazon S3 has discontinued support for Email Grantee Access Control Lists (ACLs) |
put_object_acl |
End of support notice: As of October 1, 2025, Amazon S3 has discontinued support for Email Grantee Access Control Lists (ACLs) |
put_object_annotation |
Attaches an annotation to an Amazon S3 object |
put_object_legal_hold |
This operation is not supported for directory buckets |
put_object_lock_configuration |
This operation is not supported for directory buckets |
put_object_retention |
This operation is not supported for directory buckets |
put_object_tagging |
This operation is not supported for directory buckets |
put_public_access_block |
This operation is not supported for directory buckets |
rename_object |
Renames an existing object in a directory bucket that uses the S3 Express One Zone storage class |
restore_object |
This operation is not supported for directory buckets |
select_object_content |
This operation is not supported for directory buckets |
update_bucket_metadata_annotation_table_configuration |
Updates the annotation table configuration for an Amazon S3 bucket's metadata configuration |
update_bucket_metadata_inventory_table_configuration |
Enables or disables a live inventory table for an S3 Metadata configuration on a general purpose bucket |
update_bucket_metadata_journal_table_configuration |
Enables or disables journal table record expiration for an S3 Metadata configuration on a general purpose bucket |
update_object_encryption |
This operation is not supported for directory buckets or Amazon S3 on Outposts buckets |
upload_part |
Uploads a part in a multipart upload |
upload_part_copy |
Uploads a part by copying data from an existing object as data source |
write_get_object_response |
This operation is not supported for directory buckets |