This document describes S4 coverage of IAM and S3 APIs.
- 1. Common Details
- 2. S3 API
- 3. IAM API
This section addresses common details shared among S4 offered APIs: S3 and IAM.
The account ID is 15 base10 (i.e. 0-9) digit string. It is padded with leading zeros if necessary.
Available S4 endpoints:
Endpoint | Location |
---|---|
eu-central-1.s4.mega.io | Amsterdam |
eu-central-2.s4.mega.io | Bettembourg |
ca-central-1.s4.mega.io | Montreal |
ca-west-1.s4.mega.io | Vancouver |
Ensure to prefix the appropriate service code to the endpoint when constructing the API URL:
- For object storage/S3, use prefix
s3
. e.g.:s3.eu-central-1.s4.mega.io
- For IAM, use prefix
iam
. e.g.:iam.eu-central-1.s4.mega.io
Please note the endpoint g.s4.mega.io is also available which currently points to eu-central-1.s4.mega.io
.
Unlike S3, S4 allows to retrieve objects in any bucket through any available region.
S4 meets S3 error formatting. e.g.:
<?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
<Resource>/myobj</Resource>
<RequestId>HC0000000000000001</RequestId>
</Error>
The value of Code is one of the standard IAM or S3 error codes. The value of Message is a human-readable indication of what the origin of the problem is.
Errors that may occur in any S4 service during common service initialization (parsing, authorization and policy validation). Note that these errors can also occur due to additional causes specific to the distinct services. Those are listed at each service specs.
Error Code | Description | HTTP Status Code |
---|---|---|
InvalidURI | It happens due to a wrong domain (i.e. wrong Host header) format. | 400 Bad Request |
NoSuchAccessPoint | The Account Id specified in host header has a correct format but it doesn't match any existing account. There might be additional reasons such as blocked account, etc. | 400 Not Found |
InvalidAction | Returned in case URL fails to be parsed. | 400 Bad Request |
InternalError | The Account Id specified in host header has a correct format but due to technical reasons the server was not able to handle the request. | 500 Internal Server Error |
AccountProblem | A logical problem in the internal representation of the account is preventing the service to be executed. Technical support is required. | 403 Forbidden |
IncompleteSignature | Missing or unexpected data while (1) building canonical request or (2) parsing credentials. | 403 Forbidden |
InternalFailure | Internal S4 failure | 500 Internal Server Error |
InvalidAccessKeyId | The request cannot complete because the supplied Access Key is not valid. | 403 Forbidden |
InvalidRequest | The request cannot be completed because of an error in the expected request format. Possible causes: (1) Authorization header does not start with AWS4-HMAC-SHA256 (2) Unexpected service in authorization header data or authentication string (3) Issue with chunked header or payload (4) Invalid format for certain x-amz- headers (5) Expired URL |
400 Bad Request |
MissingParameter | Missing parameter expected in (1) request URI or (2) headers. | 400 Bad Request |
MissingSecurityHeader | Missing or wrong header involved in authorization. | 400 Bad Request |
SignatureDoesNotMatch | Declared request signature does not match the computed one. (1) Early detection of signature mismatch (accounting for headers only) (2) Signature mismatch in presigned URL (3) Body is signed and some chunk signature mismatches the computed one. (4) Body is signed and at the end of stream, an error on signature calculation was detected. |
403 Forbidden |
AccessDenied | The request cannot proceed due to an authorization or policy validation problems (i.e. access not allowed by policies). | 403 Forbidden |
RequestTimeTooSkewed | The difference between the request time and the server's time is too large. | 403 Forbidden |
ValidationError | Input validation failure when processing request such as header parsing for request signature. | 400 Bad Request |
AuthorizationQueryParametersError | Error authentication data when using auth query parameters instead of auth headers, (e.g. the presigned urls). | 400 Bad Request |
NoSuchBucket | Returned if the specified bucket does not exist. | 404 Not Found |
NoSuchKey | Returned if the specified key does not exist. | 404 Not Found |
Errors that may occur at any moment in any service.
Error Code | Description | HTTP Status Code |
---|---|---|
RequestTimeout | The client has been unresponsive for too long. | 400 Bad Request |
Most of S3 services receive a <bucket_name>
argument identifying the bucket that will be target of the operation. The bucket argument can be received in two different ways:
The argument <bucket_name> is specified as part of the URL in the HTTP request, e.g.:
GET /<bucket_name>/ HTTP/1.1.
Host: s3.eu-central-1.s4.mega.io
The argument <bucket_name> is specified as part of the Host in the HTTP request (i.e. as part of the sub-domain), e.g.:
GET / HTTP/1.1.
Host: <bucket_name>.s3.eu-central-1.s4.mega.io
-
Bucket name must not be
.
-
Bucket name must not be
..
-
Bucket names must not contain
/
-
Bucket names must be between
3
(min) and63
(max) characters long -
Bucket names can consist only of lowercase letters, numbers, dots
.
, and hyphens-
-
Bucket names must begin and end with a letter or number
-
Bucket names must not contain two adjacent periods
-
Bucket names must not be formatted as an IP address (for example,
192.168.5.4
) -
Bucket names must not start with the prefix
xn--
-
Bucket names must not end with the suffix
-s3alias
If validation fails the above restrictions, an AccessDenied or InvalidBucketName error is returned (depending on the service being accessed).
S3 services involving object manipulation or retrieval requires the object to be identified by mean of a string known as <key>
. It is specified as part of the URL:
GET /<bucket_name>/<key> HTTP/1.1.
Host: s3.eu-central-1.s4.mega.io
GET /<key> HTTP/1.1.
Host: <bucket_name>.s3.eu-central-1.s4.mega.io
-
Object keys may contain any UTF-8 characters except the forbidden combinations mentioned below
-
Object key must not be
..
-
Object keys must not begin with
../
or end with/..
-
Object keys must not contain
/./
nor/../
-
Object keys must not contain consecutive forward slashes
//
-
Object keys must be between
1
(min) and1024
(max) characters long
If validation fails the above restrictions, the AccessDenied or MethodNotAllowed error is returned (depending on the service being accessed).
Every bucket and every object, despite who created them, is owned by the canonical user (root account).
S3 endpoint is s3.<region>.s4.mega.io.
Method | |
---|---|
GET | |
URL | |
/ | |
URL Params | Supported |
<none> | |
Specific Headers | Supported |
<none> | |
Body | Supported |
<empty> |
Status Code |
---|
200 OK |
Specific Headers |
<none> |
Body |
<?xml version="1.0" encoding="UTF-8"?>
<ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Buckets>
<Bucket>
<CreationDate>2022-01-28T11:44:13Z</CreationDate>
<Name>bucket1</Name>
</Bucket>
<Bucket>
<CreationDate>2022-02-15T18:22:37Z</CreationDate>
<Name>bucket2</Name>
</Bucket>
</Buckets>
<Owner>
<ID>57A54E56B89C54B767F01987C0BC77929B5212C0BF165E3CF2B8DF818C46B66C</ID>
<DisplayName>158563168473704</DisplayName>
</Owner>
</ListAllMyBucketsResult> |
<No specific error expected>
Creates the bucket <bucket_name>
if it is a valid bucket name and it does not exist yet.
Method | |
---|---|
PUT | |
URL (alternatives) | Note |
/ |
Host header must start with |
/ |
|
URL Params | Supported |
<none> | |
Specific Headers | Supported |
x-amz-acl: |
π΄ NO |
x-amz-grant-full-control: |
π΄ NO |
x-amz-grant-read: |
π΄ NO |
x-amz-grant-read-acp: |
π΄ NO |
x-amz-grant-write: |
π΄ NO |
x-amz-grant-write-acp: |
π΄ NO |
x-amz-bucket-object-lock-enabled: |
π΄ NO |
x-amz-object-ownership: |
π΄ NO |
Body | |
<?xml version="1.0" encoding="UTF-8"?>
<CreateBucketConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> π΄ - NOT supported
<LocationConstraint>string</LocationConstraint>
</CreateBucketConfiguration> |
Status Code | |
---|---|
200 OK | |
Specific Headers | Supported |
Location: Location |
π΄ NO |
Body | |
<empty> |
Error Code | Description | HTTP Status Code |
---|---|---|
BucketAlreadyOwnedByYou |
Returned in case there is a bucket with |
409 Conflict |
InvalidBucketName |
Returned in case |
400 Bad Request |
InternalError | Returned due to internal technical reasons. | 500 Internal Server Error |
The S3 standard behavior is to only return AlreadyOwnedByYou if the bucket exists but had already been created in a region different from the requested one with the request succeeding otherwise. S4 does not support this behavior as it is considered to be confusing. Moreover, S4 does not have globally shared bucket namespaces like S3 does. In S4, the owner of a bucket corresponds to the owner of an account. Thus, an error indicating a duplicate bucket is always a BucketAlreadyOwnedByYou error. S4 never returns BucketAlreadyExists.
Deletes the bucket <bucket_name>
if it is a valid bucket name and it is not empty.
Method | |
---|---|
DELETE | |
URL (alternatives) | Note |
/ |
Host header must start with |
/ |
|
URL Params | Supported |
<none> | |
Specific Headers | Supported |
x-amz-expected-bucket-owner: |
π΄ NO |
Body | Supported |
<empty> |
Status Code |
---|
204 No Content |
Specific Headers |
<none> |
Body |
<empty> |
Error Code | Description | HTTP Status Code |
---|---|---|
InvalidBucketName |
Returned in case |
400 Bad Request |
InternalError |
Returned due to internal technical reason. |
500 Internal Server Error |
BucketNotEmpty |
Returned if called on a non-empty bucket. |
409 Conflict |
Determines if the bucket <bucket_name>
exists and you have access to it.
Method | |
---|---|
HEAD | |
URL (alternatives) | Note |
/ |
Host header must start with |
/ |
|
URL Params | Supported |
<none> | |
Specific Headers | Supported |
x-amz-expected-bucket-owner: |
π΄ NO |
Body | Supported |
<empty> |
Status Code |
---|
200 OK |
Specific Headers |
<none> |
Body |
<empty> |
Error Code | Description | HTTP Status Code |
---|---|---|
InvalidBucketName |
Returned in case |
400 Bad Request |
List objects in <bucket_name>
.
Method | |
---|---|
GET | |
URL (alternatives) | Note |
/ |
Host header must start with |
/ |
|
URL Params | Supported |
delimiter | π’ YES |
encoding-type | π΄ NO |
marker | π’ YES |
max-keys | π’ YES |
prefix | π’ YES |
Specific Headers | Supported |
x-amz-request-payer: |
π΄ NO |
x-amz-expected-bucket-owner: |
π΄ NO |
Body | Supported |
<empty> |
Status Code | |
---|---|
200 OK | |
Specific Headers | Supported |
Location: Location |
π΄ NO |
Body | |
<?xml version="1.0" encoding="UTF-8"?>
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<IsTruncated>boolean</IsTruncated>
<Marker>string</Marker>
<NextMarker>string</NextMarker>
<Contents>
<ChecksumAlgorithm>string</ChecksumAlgorithm> π΄ - NOT supported
...
<ETag>string</ETag>
<Key>string</Key>
<LastModified>timestamp</LastModified>
<Owner>
<DisplayName>string</DisplayName>
<ID>string</ID>
</Owner>
<Size>integer</Size>
<StorageClass>string</StorageClass> π β Always set to "STANDARD"
</Contents>
...
<Name>string</Name>
<Prefix>string</Prefix>
<Delimiter>string</Delimiter>
<MaxKeys>integer</MaxKeys>
<CommonPrefixes>
<Prefix>string</Prefix>
</CommonPrefixes>
...
<EncodingType>string</EncodingType> π΄ - NOT supported
</ListBucketResult> |
Error Code | Description | HTTP Status Code |
---|---|---|
InvalidArgument |
Returned in case <max-keys> argument has a wrong format. |
400 Bad Request |
InternalError |
Returned due to technical reasons. |
500 Internal Server Error |
List objects in <bucket_name>
.
Method | |
---|---|
GET | |
URL (alternatives) | Note |
/?list-type=2 |
Host header must start with |
/ |
|
URL Params | Supported |
continuation-token | π’ YES |
delimiter | π’ YES |
encoding-type | π΄ NO |
fetch-owner | π’ YES |
max-keys | π’ YES |
prefix | π’ YES |
start-after | π’ YES |
Specific Headers | Supported |
x-amz-request-payer: |
π΄ NO |
x-amz-expected-bucket-owner: |
π΄ NO |
Body | Supported |
<empty> |
Status Code |
---|
200 OK |
Specific Headers |
<none> |
Body |
<?xml version="1.0" encoding="UTF-8"?>
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<IsTruncated>boolean</IsTruncated>
<ContinuationToken>string</ContinuationToken>
<NextContinuationToken>string</NextContinuationToken>
<Contents>
<ChecksumAlgorithm>string</ChecksumAlgorithm> π΄ - NOT supported
...
<ETag>string</ETag>
<Key>string</Key>
<LastModified>timestamp</LastModified>
<Owner> π β Returned only if fetch-owner=true in URL
<DisplayName>string</DisplayName>
<ID>string</ID>
</Owner>
<Size>integer</Size>
<StorageClass>string</StorageClass> π β Always set to "STANDARD"
</Contents>
...
<Name>string</Name>
<Prefix>string</Prefix>
<Delimiter>string</Delimiter>
<MaxKeys>integer</MaxKeys>
<CommonPrefixes>
<Prefix>string</Prefix>
</CommonPrefixes>
...
<EncodingType>string</EncodingType> π΄ - NOT supported
<KeyCount>integer</KeyCount>
</ListBucketResult> |
Error Code | Description | HTTP Status Code |
---|---|---|
InvalidArgument |
Returned in case:
|
400 Bad Request |
InternalError |
Returned due to technical reasons. |
500 Internal Server Error |
Creates a new object with the provided contents
Method | |
---|---|
PUT | |
URL (alternatives) | Note |
/<Key> |
Host header must start with |
/ |
|
URL Params | Supported |
<none> | |
Specific Headers | Supported |
Cache-Control |
π΄ NO |
Content-Disposition |
π΄ NO |
Content-Encoding |
π΄ NO |
Content-Language |
π΄ NO |
Content-MD5 |
π’ YES |
Content-Type |
π΄ NO |
Expires |
π΄ NO |
x-amz-acl: |
π΄ NO |
x-amz-checksum-crc32 |
π΄ NO |
x-amz-checksum-crc32c |
π΄ NO |
x-amz-checksum-sha1 |
π΄ NO |
x-amz-checksum-sha256 |
π΄ NO |
x-amz-expected-bucket-owner |
π΄ NO |
x-amz-grant-full-control: |
π΄ NO |
x-amz-grant-read: |
π΄ NO |
x-amz-grant-read-acp: |
π΄ NO |
x-amz-grant-write: |
π΄ NO |
x-amz-grant-write-acp: |
π΄ NO |
x-amz-object-lock-legal-hold |
π΄ NO |
x-amz-object-lock-mode |
π΄ NO |
x-amz-object-lock-retain-until-date |
π΄ NO |
x-amz-request-payer |
π΄ NO |
x-amz-sdk-checksum-algorithm |
π΄ NO |
x-amz-server-side-encryption |
π΄ NO |
x-amz-server-side-encryption-aws-kms-key-id |
π΄ NO |
x-amz-server-side-encryption-bucket-key-enabled |
π΄ NO |
x-amz-server-side-encryption-context |
π΄ NO |
x-amz-server-side-encryption-customer-algorithm |
π΄ NO |
x-amz-server-side-encryption-customer-key |
π΄ NO |
x-amz-server-side-encryption-customer-key-MD5 |
π΄ NO |
x-amz-storage-class |
π΄ NO (Assuming STANDARD) |
x-amz-tagging |
π΄ NO |
x-amz-website-redirect-location |
π΄ NO |
Body | Supported |
Object data. |
May be Chunked Payload |
Status Code | |
---|---|
200 OK | |
Specific Headers | Supported |
ETag |
π’ YES |
x-amz-checksum-crc32 |
π΄ NO |
x-amz-checksum-crc32c |
π΄ NO |
x-amz-checksum-sha1 |
π΄ NO |
x-amz-checksum-sha256 |
π΄ NO |
x-amz-expiration |
π΄ NO |
x-amz-request-charged |
π΄ NO |
x-amz-server-side-encryption |
π΄ NO |
x-amz-server-side-encryption-aws-kms-key-id |
π΄ NO |
x-amz-decoded-content-length |
π΄ NO |
x-amz-server-side-encryption-bucket-key-enabled |
π΄ NO |
x-amz-server-side-encryption-context |
π΄ NO |
x-amz-server-side-encryption-customer-algorithm |
π΄ NO |
x-amz-server-side-encryption-customer-key-MD5 |
π΄ NO |
x-amz-version-id |
π΄ NO |
Body | |
<empty> |
Error Code | Description | HTTP Status Code |
---|---|---|
InvalidArgument |
Returned in cases where there are invalid/missing arguments in the request. Particularly:
This may happen in case of chunked payload when the provided header does not have a valid value. |
400 Bad Request |
BadDigest |
Returned if the Content-MD5 does not match the MD5 computed while uploading. |
400 Bad Request |
MethodNotAllowed |
Returned in case the new object name does not validate constraints (see below) |
405 Method Not Allowed |
InvalidRequest |
Key of an object containing payload is not allowed to end with |
400 Bad Request |
InternalError |
Returned in case the upload failed to complete |
500 Internal Server Error |
Method | |
---|---|
PUT | |
URL (alternatives) | Note |
/<Key> |
Host header must start with |
/ |
|
URL Params | Supported |
<none> | |
Specific Headers | Supported |
Cache-Control |
π΄ NO |
Content-Disposition |
π΄ NO |
Content-Encoding |
π΄ NO |
Content-Language |
π΄ NO |
Expires |
π΄ NO |
x-amz-checksum-algorithm |
π΄ NO |
x-amz-acl: |
π΄ NO |
x-amz-copy-source |
π’ YES |
x-amz-copy-source |
π΄ NO |
x-amz-copy-source-if-match |
π΄ NO |
x-amz-copy-source-if-modified-since |
π΄ NO |
x-amz-copy-source-if-none-match |
π΄ NO |
x-amz-copy-source-if-unmodified-since |
π΄ NO |
x-amz-storage-class |
π’ YES (Only STANDARD is allowed) |
x-amz-expected-bucket-owner |
π΄ NO |
x-amz-source-expected-bucket-owner |
π΄ NO |
x-amz-grant-full-control: |
π΄ NO |
x-amz-grant-read: |
π΄ NO |
x-amz-grant-read-acp: |
π΄ NO |
x-amz-grant-write: |
π΄ NO |
x-amz-grant-write-acp: |
π΄ NO |
x-amz-metadata-directive |
π΄ NO |
x-amz-tagging-directive |
π΄ NO |
x-amz-server-side-encryption |
π΄ NO |
x-amz-server-side-encryption-aws-kms-key-id |
π΄ NO |
x-amz-server-side-encryption-bucket-key-enabled |
π΄ NO |
x-amz-server-side-encryption-context |
π΄ NO |
x-amz-server-side-encryption-customer-algorithm |
π΄ NO |
x-amz-server-side-encryption-customer-key |
π΄ NO |
x-amz-server-side-encryption-customer-key-MD5 |
π΄ NO |
x-amz-copy-source-server-side-encryption-customer-algorithm |
π΄ NO |
x-amz-copy-source-server-side-encryption-customer-key |
π΄ NO |
x-amz-copy-source-server-side-encryption-customer-key-MD5 |
π΄ NO |
x-amz-tagging |
π΄ NO |
x-amz-website-redirect-location |
π΄ NO |
x-amz-object-lock-legal-hold |
π΄ NO |
x-amz-object-lock-mode |
π΄ NO |
x-amz-object-lock-retain-until-date |
π΄ NO |
x-amz-request-payer |
π΄ NO |
Body | Supported |
<empty> |
Status Code | |
---|---|
200 OK | |
Specific Headers | Supported |
x-amz-expiration |
π΄ NO |
x-amz-copy-source-version-id |
π΄ NO |
x-amz-version-id |
π΄ NO |
x-amz-server-side-encryption |
π΄ NO |
x-amz-server-side-encryption-aws-kms-key-id |
π΄ NO |
x-amz-server-side-encryption-bucket-key-enabled |
π΄ NO |
x-amz-server-side-encryption-context |
π΄ NO |
x-amz-server-side-encryption-customer-algorithm |
π΄ NO |
x-amz-server-side-encryption-customer-key |
π΄ NO |
x-amz-request-charged |
π΄ NO |
Body | |
<empty> |
Error Code | Description | HTTP Status Code |
---|---|---|
InvalidArgument | Returned if x-amz-copy-source-path is empty or does not denote both bucket and resource. | 400 Bad Request |
NoSuchBucket | Returned if the source bucket does not exist. | 404 Not Found |
NoSuchKey | Returned if the source key does not exist. | 404 Not Found |
InvalidStorageClass | Returned if a storage class other than STANDARD is used in the request. | 400 Bad Request |
AccessDenied | In addition to usual policy validation errors, this is returned if policy validation fails on the copy source. | 403 Forbidden |
Internal Error | Returned in the event of internal API error. | 500 Internal Server Error |
Method | |
---|---|
GET | |
URL (alternatives) | Note |
/<Key> |
Host header must start with |
/ |
|
URL Params | Supported |
response-cache-control |
π’ YES |
response-content-disposition |
π΄ NO |
response-content-encoding |
π’ YES |
response-content-language |
π’ YES |
response-content-type |
π’ YES |
response-expires |
π΄ NO |
versionId |
π΄ NO |
Specific Headers | Supported |
x-amz-request-payer: |
π΄ NO |
x-amz-expected-bucket-owner: |
π΄ NO |
x-amz-checksum-mode: |
π΄ NO |
x-amz-server-side-encryption-customer-algorithm: |
π΄ NO |
x-amz-server-side-encryption-customer-key: |
π΄ NO |
x-amz-server-side-encryption-customer-key-MD5: |
π΄ NO |
If-Match: |
π’ YES |
If-Modified-Since: |
π’ YES |
If-None-Match: |
π’ YES |
Range: Range |
π’ YES |
Body | Supported |
<empty> |
Status Code | |
---|---|
206 Partial Content | |
Specific Headers | Supported |
Cache-Control |
π Partial, only if set by URI parameter |
Content-Disposition |
π΄ NO |
Content-Encoding |
π Partial, only if set by URI parameter |
Content-Language |
π Partial, only if set by URI parameter |
Content-Range |
π’ YES |
Content-Type |
π Partial, only if set by URI parameter |
ETag |
π’ YES |
Expires |
π΄ NO |
Last-Modified |
π’ YES |
Body | |
<empty> |
Error Code | Description | HTTP Status Code |
---|---|---|
NoSuchKey | Returned if the key does not name an object in the bucket or the key is not a file. | 404 Not Found |
InvalidRange | Returned if the request has a range header which is not satisfiable for the entity being downloaded. This means a byte range spec (e.g., bytes=50-100) where the starting byte offset is greater than the entity size, or a suffix byte range spec (e.g., bytes=-0) where the suffix byte is zero. | 416 Requested Range Not Satisfiable |
Method | |
---|---|
HEAD | |
URL (alternatives) | Note |
/<Key> |
Host header must start with |
/ |
|
URL Params | Supported |
partNumber | π΄ NO |
versionId | π΄ NO |
Specific Headers | Supported |
x-amz-request-payer: |
π΄ NO |
x-amz-expected-bucket-owner: |
π΄ NO |
x-amz-checksum-mode: |
π΄ NO |
x-amz-server-side-encryption-customer-algorithm: |
π΄ NO |
x-amz-server-side-encryption-customer-key: |
π΄ NO |
x-amz-server-side-encryption-customer-key-MD5: |
π΄ NO |
If-Match: |
π’ YES |
If-Modified-Since: |
π’ YES |
If-None-Match: |
π’ YES |
Range: Range |
π’ YES |
Body | Supported |
<empty> |
Status Code | |
---|---|
200 OK | |
Specific Headers | Supported |
Cache-Control |
π΄ NO |
Content-Disposition |
π΄ NO |
Content-Encoding |
π΄ NO |
Content-Language |
π΄ NO |
Content-Length |
π’ YES |
Content-Type |
π’ YES |
ETag |
π’ YES |
Expires |
π΄ NO |
Last-Modified |
π’ YES |
x-amz-storage-class |
π’ YES |
Body | |
<empty> |
Error Code | Description | HTTP Status Code |
---|---|---|
NoSuchKey | Returned if the key does not name an object in the bucket or the key is not a file. | 404 Not Found |
InvalidRange | Returned if the request has a range header which is not satisfiable for the entity being downloaded. This means a byte range spec (e.g., bytes=50-100) where the starting byte offset is greater than the entity size, or a suffix byte range spec (e.g., bytes=-0) where the suffix byte is zero. | 416 Requested Range Not Satisfiable |
Method | |
---|---|
DELETE | |
URL (alternatives) | Note |
/<Key> |
Host header must start with |
/ |
|
URL Params | Supported |
versionId |
π΄ NO |
Specific Headers | Supported |
x-amz-request-payer: |
π΄ NO |
x-amz-expected-bucket-owner: |
π΄ NO |
x-amz-bypass-governance-retention: |
π΄ NO |
x-amz-mfa: |
π΄ NO |
Body | Supported |
<empty> |
Status Code | |
---|---|
204 NoContent | |
Specific Headers | Supported |
x-amz-delete-marker |
π΄ NO |
x-amz-request-charged |
π΄ NO |
x-amz-version-id |
π΄ NO |
Body | |
<empty> |
Note that if the object with the given key does not exist, DeleteObject
still returns 204 NoContent
.
Error Code | Description | HTTP Status Code |
---|---|---|
NoSuchBucket | Returned if the bucket which the object is attempted to be deleted from does not exist. | 404 Not Found |
Method | |
---|---|
POST | |
URL (alternatives) | Note |
/<Key> |
Host header must start with |
/ |
|
URL Params | Supported |
uploads |
π’ YES |
Specific Headers | Supported |
x-amz-acl |
π΄ NO |
Cache-Control |
π΄ NO |
Content-Disposition |
π΄ NO |
Content-Encoding |
π΄ NO |
Content-Language |
π΄ NO |
Content-Type |
π΄ NO |
Expires |
π΄ NO |
x-amz-grant-full-control |
π΄ NO |
x-amz-grant-read |
π΄ NO |
x-amz-grant-read-acp |
π΄ NO |
x-amz-grant-write-acp |
π΄ NO |
x-amz-server-side-encryption |
π΄ NO |
x-amz-website-redirect-location |
π΄ NO |
x-amz-storage-class |
π΄ NO (Assuming STANDARD) |
x-amz-server-side-encryption-customer-algorithm |
π΄ NO |
x-amz-server-side-encryption-customer-key |
π΄ NO |
x-amz-server-side-encryption-customer-key-MD5 |
π΄ NO |
x-amz-server-side-encryption-aws-kms-key-id |
π΄ NO |
x-amz-server-side-encryption-context |
π΄ NO |
x-amz-server-side-encryption-bucket-key-enabled |
π΄ NO |
x-amz-request-payer |
π΄ NO |
x-amz-tagging |
π΄ NO |
x-amz-object-lock-mode |
π΄ NO |
x-amz-object-lock-retain-until-date |
π΄ NO |
x-amz-object-lock-legal-hold |
π΄ NO |
x-amz-expected-bucket-owner |
π΄ NO |
x-amz-checksum-algorithm |
π΄ NO |
Body | Supported |
<empty> |
Status Code | |
---|---|
200 OK | |
Specific Headers | Supported |
x-amz-abort-date |
π΄ NO |
x-amz-abort-rule-id |
π΄ NO |
x-amz-server-side-encryption |
π΄ NO |
x-amz-server-side-encryption-customer-algorithm |
π΄ NO |
x-amz-server-side-encryption-customer-key-MD5 |
π΄ NO |
x-amz-server-side-encryption-aws-kms-key-id |
π΄ NO |
x-amz-server-side-encryption-context |
π΄ NO |
x-amz-server-side-encryption-bucket-key-enabled |
π΄ NO |
x-amz-request-charged |
π΄ NO |
x-amz-checksum-algorithm |
π΄ NO |
Body | |
<?xml version="1.0" encoding="UTF-8"?>
<InitiateMultipartUploadResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Bucket>string</Bucket>
<Key>string</Key>
<UploadId>string</UploadId>
</InitiateMultipartUploadResult> |
Error Code | Description | HTTP Status Code |
---|---|---|
ServiceUnavailable | Returned in case server is too crowded. | 503 Service Unavailable |
AccountProblem | Returned if user has exceed quota. | 403 Forbidden |
InternalError | Returned in case the request failed to complete. | 500 Internal Server Error |
Method | |
---|---|
PUT | |
URL (alternatives) | Note |
/<Key> |
Host header must start with |
/ |
|
URL Params | Supported |
uploadId |
π’ YES |
partNumber |
π’ YES |
Specific Headers | Supported |
Content-Length |
π’ YES |
Content-MD5 |
π’ YES |
x-amz-sdk-checksum-algorithm |
π΄ NO |
x-amz-checksum-crc32 |
π΄ NO |
x-amz-checksum-crc32c |
π΄ NO |
x-amz-checksum-sha1 |
π΄ NO |
x-amz-checksum-sha256 |
π΄ NO |
x-amz-server-side-encryption-customer-algorithm |
π΄ NO |
x-amz-server-side-encryption-customer-key |
π΄ NO |
x-amz-server-side-encryption-customer-key-MD5 |
π΄ NO |
x-amz-request-payer |
π΄ NO |
x-amz-expected-bucket-owner |
π΄ NO |
Body | Supported |
<empty> |
Status Code | |
---|---|
200 OK | |
Specific Headers | Supported |
ETag |
π’ YES |
x-amz-server-side-encryption |
π΄ NO |
x-amz-checksum-crc32 |
π΄ NO |
x-amz-checksum-crc32c |
π΄ NO |
x-amz-checksum-sha1 |
π΄ NO |
x-amz-checksum-sha256 |
π΄ NO |
x-amz-server-side-encryption-customer-algorithm |
π΄ NO |
x-amz-server-side-encryption-customer-key-MD5 |
π΄ NO |
x-amz-server-side-encryption-aws-kms-key-id |
π΄ NO |
x-amz-server-side-encryption-bucket-key-enabled |
π΄ NO |
x-amz-request-charged |
π΄ NO |
Body | |
<empty> |
Error Code | Description | HTTP Status Code |
---|---|---|
BadDigest |
Returned if the Content-MD5 does not match the MD5 computed while uploading. |
400 Bad Request |
InvalidDigest |
Returned in case header |
400 Bad Request |
ServiceUnavailable |
Returned in case server is too crowded. |
503 Service Unavailable |
InvalidPart |
Note: although under the S3 standard, InvalidPart is not an expected error for UploadPart operation, S4 applies several checks according to its own part restrictions:
|
400 Bad Request |
EntityTooSmall |
Returned in case the size of this (or any previously uploaded) part is smaller than 5MB, unless this is the last part, in which case, the smaller than 5MB size is allowed. Please note that:
|
400 Bad Request |
NoSuchUpload |
Returned if:
|
404 Not Found |
InternalError |
Returned in case the request failed to complete, e.g. storage timeout, etc. |
500 Internal Server Error |
Method | |
---|---|
POST | |
URL (alternatives) | Note |
/<Key> |
Host header must start with |
/ |
|
URL Params | Supported |
uploadId |
π’ YES |
Specific Headers | Supported |
x-amz-checksum-crc32 |
π΄ NO |
x-amz-checksum-crc32c |
π΄ NO |
x-amz-checksum-sha1 |
π΄ NO |
x-amz-checksum-sha256 |
π΄ NO |
x-amz-request-payer |
π΄ NO |
x-amz-expected-bucket-owner |
π΄ NO |
x-amz-server-side-encryption-customer-algorithm |
π΄ NO |
x-amz-server-side-encryption-customer-key |
π΄ NO |
x-amz-server-side-encryption-customer-key-MD5 |
π΄ NO |
Body | |
<?xml version="1.0" encoding="UTF-8"?>
<CompleteMultipartUpload xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Part>
<PartNumber>integer</PartNumber>
<ETag>string</ETag>
</Part>
...
</CompleteMultipartUpload> |
Status Code | |
---|---|
200 OK | |
Specific Headers | Supported |
x-amz-expiration |
π΄ NO |
x-amz-server-side-encryption |
π΄ NO |
x-amz-version-id |
π΄ NO |
x-amz-server-side-encryption-aws-kms-key-id |
π΄ NO |
x-amz-server-side-encryption-bucket-key-enabled |
π΄ NO |
x-amz-request-charged |
π΄ NO |
Body | |
<CompleteMultipartUploadResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Location>string</Location>
<Bucket>string</Bucket>
<Key>string</Key>
<ETag>string</ETag>
</CompleteMultipartUploadResult> |
Error Code | Description | HTTP Status Code |
---|---|---|
MalformedXML | Returned in case the request body is not a valid xml message, or does not specify a valid ETag or PartNumber. | 400 Bad Request |
InvalidRequest | Returned in case the request body does not specify any valid part info. | 400 Bad Request |
InvalidPartOrder | Returned if in the request body, the part list was not in ascending order. The part list must be ordered by part number. | 400 Bad Request |
NoSuchUpload |
Returned if one of the following conditions is true:
|
404 Not Found |
InvalidPart |
Returned for one of the following reasons:
|
400 Bad Request |
InternalError |
Returned in case the request failed to complete, e.g. failed to retrieve the uploaded object, etc. |
500 Internal Server Error |
Method | |
---|---|
DELETE | |
URL (alternatives) | Note |
/<Key> |
Host header must start with |
/ |
|
URL Params | Supported |
uploadId |
π’ YES |
Specific Headers | Supported |
x-amz-request-payer |
π΄ NO |
x-amz-expected-bucket-owner |
π΄ NO |
Body | Supported |
<empty> |
Status Code | |
---|---|
204 No Content | |
Specific Headers | Supported |
x-amz-request-charged |
π΄ NO |
Body | |
<empty> |
Error Code | Description | HTTP Status Code |
---|---|---|
NoSuchUpload |
Returned for one of the following reasons:
|
404 Not Found |
Method | |
---|---|
PUT | |
URL (alternatives) | Note |
/?policy |
Host header must start with |
/ |
|
URL Params | Supported |
<none> | |
Specific Headers | Supported |
Content-MD5: |
π’ YES |
x-amz-expected-bucket-owner: |
π΄ NO |
x-amz-sdk-checksum-algorithm: |
π΄ NO |
x-amz-confirm-remove-self-bucket-access: |
π΄ NO |
Body | Supported |
{ Policy in JSON format } | π’ YES |
Status Code | |
---|---|
200 OK | |
Specific Headers | Supported |
<none> | |
Body | |
<empty> |
Error Code | Description | HTTP Status Code |
---|---|---|
MalformedPolicy |
Returned in case the given policy contains invalid JSON or invalid principal. |
400 Bad Request |
InvalidDigest |
Returned in case header |
400 Bad Request |
BadDigest |
Returned in case |
400 Bad Request |
InternalError |
Returned due to technical reasons. |
500 Internal Server Error |
Method | |
---|---|
GET | |
URL (alternatives) | Note |
/?policy |
Host header must start with |
/ |
|
URL Params | Supported |
<none> | |
Specific Headers | Supported |
x-amz-expected-bucket-owner: |
π΄ NO |
Body | Supported |
<empty> |
Status Code | |
---|---|
200 OK | |
Specific Headers | Supported |
<none> | |
Body | |
{ Policy in JSON format } |
Error Code | Description | HTTP Status Code |
---|---|---|
NoSuchBucketPolicy |
Returned in case |
404 Not Found |
MalformedPolicy |
Mandatory JSON property is missing. |
400 Bad Request |
Method | |
---|---|
DELETE | |
URL (alternatives) | Note |
/?policy |
Host header must start with |
/ |
|
URL Params | Supported |
<none> | |
Specific Headers | Supported |
x-amz-expected-bucket-owner: |
π΄ NO |
Body | Supported |
<empty> |
Status Code | |
---|---|
204 No Content | |
Specific Headers | Supported |
<none> | |
Body | |
<empty> |
Error Code | Description | HTTP Status Code |
---|---|---|
NoSuchBucketPolicy |
Returned in case |
404 Not Found |
InternalError |
Returned due to technical reasons. |
500 Internal Server Error |
Instead of using Authorization Header in service request, presigned url put authentication data in Query Parameters.
Only version 4 is supported by S4. While the S3 standard supports both V1 and V4.
Error Code (see: 1.3.2) | Description | HTTP Status Code |
---|---|---|
- AuthorizationQueryParametersError | 1) Unsupported signature algorithm 2) Invalid expiration (e.g. negative, non-integer, or exceed max limit (a default limit is 7 days)) |
400 Bad Request |
- AccessDenied | The request has expired | 403 Forbidden |
- SignatureDoesNotMatch | 403 Forbidden |
Presigned Post can only be used for uploading files.
Currently, it is NOT supported by S4.
IAM services have the end-point iam.<region>.s4.mega.io
, and all of them have a common URL resource: /
.
IAM services have an Action
parameter that contains the name of the service. Both the Action
parameter as well as the rest of the service arguments can be received in two different ways:
Method |
---|
GET |
URL |
/ |
URL Params |
Action: |
... |
Body |
<empty> |
Example |
|
Method |
---|
POST |
URL |
/ |
URL Params |
Action: |
... |
Body |
URL encoded query string |
Example |
|
S4 provides the following managed policies:
Name | Document |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ActionName: GetPolicy
Params | Supported |
---|---|
PolicyArn (mandatory) | π’ YES |
Status Code | |
---|---|
200 OK | |
Specific Headers | Supported |
<none> | |
Body | |
<?xml version="1.0" encoding="UTF-8"?>
<GetPolicyResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
<GetPolicyResult>
<Policy>
<Arn>arn:aws:iam::aws:policy/AdministratorAccess</Arn>
<AttachmentCount>0</AttachmentCount>
<CreateDate>2022-07-29T20:05:50.000Z</CreateDate>
<UpdateDate>2022-07-29T20:05:50.000Z</UpdateDate>
<PolicyId>ADMINISTRATORACCESS</PolicyId>
<PolicyName>AdministratorAccess</PolicyName>
<DefaultVersionId>v1</DefaultVersionId>
<Path>/</Path>
<IsAttachable>true</IsAttachable>
<Description></Description>
</Policy>
</GetPolicyResult>
<ResponseMetadata>
<RequestId>0000000000000003</RequestId>
</ResponseMetadata>
</GetPolicyResponse> |
Error Code | Description | HTTP Status Code |
---|---|---|
ValidationError | Returned in case of either the parameter PolicyArn missing from the request or its length being less than 20 or greater than 2048 characters. | 400 Bad Request |
InvalidInput | Returned in case the ARN value is not valid. | 400 Bad Request |
NoSuchEntity | Returned in case the policy referenced by the given ARN is not found. | 404 Not Found |
ActionName: GetPolicyVersion
Params | Supported |
---|---|
PolicyArn (mandatory) | π’ YES |
VersionId (mandatory) | π’ YES |
Status Code | |
---|---|
200 OK | |
Specific Headers | Supported |
<none> | |
Body | |
<?xml version="1.0" encoding="UTF-8"?>
<GetPolicyVersionResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
<GetPolicyVersionResult>
<PolicyVersion>
<Document>
%7B%22Version%22%3A%222012-10-17%22%2C%22Statement%22%3A%7B%22Effect%22%3A%22Allow%22%2C%22Action%22%3A%22%2A%22%2C%22Resource%22%3A%22%2A%22%7D%7D
</Document>
<IsDefaultVersion>true</IsDefaultVersion>
<VersionId>v1</VersionId>
<CreateDate>2022-07-29T20:05:50.000Z</CreateDate>
</PolicyVersion>
</GetPolicyVersionResult>
<ResponseMetadata>
<RequestId>0000000000000017</RequestId>
</ResponseMetadata>
</GetPolicyVersionResponse> |
Error Code | Description | HTTP Status Code |
---|---|---|
ValidationError |
Returned in case:
|
400 Bad Request |
InvalidInput | Returned in case the ARN value is not valid. | 400 Bad Request |
NoSuchEntity | Returned if the policy version identified by the given ARN and versionId is not found. | 404 Not Found |
ActionName: ListPolicies
Params | Supported |
---|---|
Marker (optional) | π’ YES |
MaxItems (optional) | π’ YES |
OnlyAttached (optional) | π΄ NO |
PathPrefix (optional) | π΄ NO |
PolicyUsageFilter (optional) | π΄ NO |
Scope (optional) | π΄ NO |
Status Code | |
---|---|
200 OK | |
Specific Headers | Supported |
<none> | |
Body | |
<?xml version="1.0" encoding="UTF-8"?>
<ListPoliciesResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
<ListPoliciesResult>
<IsTruncated>false</IsTruncated>
<Policies>
<member>
<Arn>arn:aws:iam::aws:policy/FullAccess</Arn>
<AttachmentCount>0</AttachmentCount>
<CreateDate>2017-05-15T02:57:50.000Z</CreateDate>
<UpdateDate>2017-05-15T02:57:50.000Z</UpdateDate>
<PolicyId>FULLACCESS</PolicyId>
<PolicyName>FullAccess</PolicyName>
<DefaultVersionId>v1</DefaultVersionId>
<Path>/</Path>
<IsAttachable>true</IsAttachable>
</member>
...
</Policies>
</ListPoliciesResult>
<ResponseMetadata>
<RequestId>0000000000000001</RequestId>
</ResponseMetadata>
</ListPoliciesResponse> |
Error Code | Description | HTTP Status Code |
---|---|---|
MalformedInput | Returned in case Marker or MaxItems is specified but it is not an integer value or out of the integer value range. | 400 Bad Request |
ValidationError |
Returned in case:
|
400 Bad Request |
ActionName: ListAttachedUserPolicies or ListAttachedGroupPolicies
Params | Supported |
---|---|
UserName | GroupName (mandatory) | π’ YES |
Marker (optional) | π’ YES |
MaxItems (optional) | π’ YES |
PathPrefix (optional) | π΄ NO |
Status Code | |
---|---|
200 OK | |
Specific Headers | Supported |
<none> | |
Body | |
<ListAttachedUserPoliciesResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/"> -- or ListAttachedGroupPoliciesResponse
<ListAttachedGroupPoliciesResult> -- or ListAttachedGroupPoliciesResponse
<AttachedPolicies>
<member>
<PolicyName>FullAccess</PolicyName>
<PolicyArn>arn:aws:iam::aws:policy/FullAccess</PolicyArn>
</member>
</AttachedPolicies>
<IsTruncated>false</IsTruncated>
</ListAttachedGroupPoliciesResult>
<ResponseMetadata>
<RequestId>0000000000000001</RequestId>
</ResponseMetadata>
</ListAttachedGroupPoliciesResponse> |
Error Code | Description | HTTP Status Code |
---|---|---|
MalformedInput | Returned in case Marker or MaxItems is specified but it is not an integer value or out of the integer value range. | 400 Bad Request |
ValidationError |
Returned in case:
|
400 Bad Request |
NoSuchEntity |
Returned if <UserName>/<GroupName> does not exist in the current account. |
400 Bad Request |
AccountProblem |
Returned due to technical reasons related to the internal representation of the account information. |
403 Forbidden |
ActionName: AttachUserPolicy or AttachGroupPolicy
Params | Supported |
---|---|
UserName | GroupName (mandatory) | π’ YES |
PolicyArn (mandatory) | π’ YES |
Status Code | |
---|---|
200 OK | |
Specific Headers | Supported |
<none> | |
Body | |
<AttachUserPolicyResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/"> β or AttachGroupPolicyResponse
<ResponseMetadata>
<RequestId>0000000000000001</RequestId>
</ResponseMetadata>
</AttachUserPolicyResponse> |
Error Code | Description | HTTP Status Code |
---|---|---|
InvalidArgument |
Returned in case <PolicyArn> does not exist. |
400 Bad Request |
InternalError |
Returned due to technical reasons. |
500 Internal Server Error |
ActionName: DetachUserPolicy or DetachGroupPolicy
Params | Supported |
---|---|
UserName | GroupName (mandatory) | π’ YES |
PolicyArn (mandatory) | π’ YES |
Status Code | |
---|---|
200 OK | |
Specific Headers | Supported |
<none> | |
Body | |
<DetachUserPolicyResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/"> β or DetachGroupPolicyResponse
<ResponseMetadata>
<RequestId>0000000000000001</RequestId>
</ResponseMetadata>
</detachUserPolicyResponse> |
Error Code | Description | HTTP Status Code |
---|---|---|
InvalidArgument |
Returned in case <PolicyArn> does not exist. |
400 Bad Request |
InternalError |
Returned due to technical reasons. |
500 Internal Server Error |