S3 API Documentation

Use any AWS SDK or S3-compatible client against our endpoint. Full support for SigV4, presigned URLs, and public buckets.

Endpoint
s3.petadata.com.br:2222
Region
us-east-1
Authentication
SigV4 / Presigned

πŸš€ Quickstart

Three steps to start uploading files to Petadata Storage with your favorite SDK.

  1. Create an access key (Access Key + Secret) in the customer panel under Keys.
  2. Point your S3 client to https://s3.petadata.com.br:2222 with region us-east-1.
  3. Use S3 operations as usual. List, upload, download, delete, multipart, presigned URLs, all compatible.
Python (boto3)$ pip install boto3
import boto3
from botocore.config import Config

s3 = boto3.client(
    's3',
    endpoint_url='https://s3.petadata.com.br:2222',
    aws_access_key_id='SUA_ACCESS_KEY',
    aws_secret_access_key='SUA_SECRET_KEY',
    region_name='us-east-1',
    config=Config(s3={'addressing_style': 'path'}),
)

for b in s3.list_buckets()['Buckets']:        # lista buckets
    print(b['Name'])

s3.upload_file('photo.jpg', 'meu-bucket', 'fotos/photo.jpg')          # upload
s3.download_file('meu-bucket', 'fotos/photo.jpg', 'local.jpg')        # download
s3.delete_object(Bucket='meu-bucket', Key='fotos/photo.jpg')         # delete

url = s3.generate_presigned_url(                # presigned URL (GET, 1h)
    'get_object',
    Params={'Bucket': 'meu-bucket', 'Key': 'fotos/photo.jpg'},
    ExpiresIn=3600,
)

πŸ” Authentication

πŸ”‘

SigV4

AWS standard. Every key generated in the panel signs correctly when used with SDKs.

πŸ”—

Presigned URLs

Issue temporary URLs for upload or download without exposing your key. Validity from 1 second to 7 days.

🌐

Anonymous (public)

Buckets with a public policy allow GET and HEAD with no credentials. Handy for static distribution.

Where to get your credentials: In the customer panel, open Keys, create a new key, copy the Access Key and Secret Key. Each key can be bound to specific buckets.

πŸ“¦ Supported operations

Exhaustive table of available operations. Blocks are intentional, for security or business-model reasons.

βœ… Fully supported ⚠️ Supported with caveats

πŸ—‚οΈ Bucket operations

Operation HTTP Status Notes
ListBucketsGET /βœ…Lists only buckets owned by your account, using public names.
HeadBucketHEAD /{bucket}βœ…β€”
ListObjects / V2GET /{bucket}βœ…Accepts prefix, delimiter, max-keys, continuation-token (V2), and start-after.
GetBucketPolicyGET /{bucket}?policyβœ…The returned policy references buckets by their public names within your account.
PutBucketPolicyPUT /{bucket}?policy⚠️The policy must reference only buckets within your account.
DeleteBucketPolicyDELETE /{bucket}?policyβœ…β€”
Versioning/{bucket}?versioningβœ…Versioning and bucket/object tagging are supported via the S3 API.
Bucket / Object Tagging/{bucket}[/{key}]?taggingβœ…β€”
Lifecycle/{bucket}?lifecycleβœ…Expiration and transition rules are supported; expiration permanently deletes objects that match the rule.

πŸ“„ Object operations

Operation HTTP Status Notes
GetObjectGET /{bucket}/{key}βœ…Accepts Range, If-Match, If-None-Match, and other standard headers.
HeadObjectHEAD /{bucket}/{key}βœ…β€”
PutObjectPUT /{bucket}/{key}βœ…Supports aws-chunked and STREAMING-AWS4-HMAC-SHA256-PAYLOAD bodies for large uploads.
DeleteObjectDELETE /{bucket}/{key}βœ…β€”
CopyObjectPUT + x-amz-copy-sourceβœ…Use the public name of the source bucket in x-amz-copy-source. Copies between buckets within your account are supported.
GetObjectTagging / PutObjectTagging/{bucket}/{key}?taggingβœ…β€”

🧩 Multipart upload

Operation HTTP Status
CreateMultipartUploadPOST /{bucket}/{key}?uploadsβœ…
UploadPartPUT /{bucket}/{key}?partNumber=N&uploadId=...βœ…
ListPartsGET /{bucket}/{key}?uploadId=...βœ…
CompleteMultipartUploadPOST /{bucket}/{key}?uploadId=...βœ…
AbortMultipartUploadDELETE /{bucket}/{key}?uploadId=...βœ…
ListMultipartUploadsGET /{bucket}?uploadsβœ…

πŸ”— Presigned URLs

Generate temporary upload (PUT) or download (GET) links without exposing your keys. The signature and expiry are validated on every request before access is authorized.

  • ⏱️Accepted validity: 1 second up to 7 days (604800 seconds).
  • πŸ•’Clock skew tolerance: Β±15 minutes. Keep your server NTP-synced.
  • πŸ”Works for GET, PUT, DELETE, and any other operation your SDK can presign.

🌐 Public (anonymous) buckets

Apply a BucketPolicy granting GetObject to Principal "*" and the content becomes available via direct URL. Useful for CDN, static sites, or shared assets.

bucket policy JSON
{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Principal": "*",
    "Action": ["s3:GetObject"],
    "Resource": ["arn:aws:s3:::meu-bucket/*"]
  }]
}

Direct URL for public objects:

https://s3.petadata.com.br:2222/meu-bucket/imagem.jpg

🚨 Common error codes

Code HTTP Meaning
SignatureDoesNotMatch403Request signature does not match. Check your Secret Key, the region (us-east-1), and your server clock.
InvalidAccessKeyId403The Access Key does not exist or has been disabled. Check it in the panel.
AccessDenied403The key used has no permission for this operation or this bucket.
NoSuchBucket404Bucket not found for your account. Check the name in the panel.
NoSuchKey404Object not found within the given bucket.
KeyTooLongError400A segment of the object key exceeded 255 bytes.
RequestTimeTooSkewed403Clock difference between your client and our server exceeds 15 minutes.
AccountSuspended403Your account is suspended (balance or manual block). Add credits or contact support to reactivate.
QuotaExceeded403Storage quota exceeded. The account goes read-only: listing, downloading, and deleting stay available so you can free space, but new uploads are blocked until you are back under the limit or reserve more space.
AuthorizationQueryParametersError400Invalid presigned URL parameters: X-Amz-Expires outside 1..604800 seconds, or a malformed X-Amz-Date.
MigrationInProgress503Your account is being migrated between instances. Write operations (PUT/POST/DELETE) are temporarily unavailable; reads keep working.
ServiceUnavailable503The storage service is temporarily unavailable (instance or server down). Retry shortly.
NotImplemented501The requested feature (e.g., per-bucket CORS or website configuration) is not supported by the storage backend.

⚠️ Limitations and gotchas

Unsupported S3 operations

Operation Notes
CreateBucketBucket creation happens in the customer panel, not via SDK.
DeleteBucketBucket deletion happens in the customer panel, not via SDK.
Get/PutBucketAcl, Get/PutObjectAclBucket and object ACLs are not supported (returns AccessDenied). Use BucketPolicy to control access.
GetBucketLoggingServer-access logging via the S3 API is not supported (returns AccessDenied); use bucket notifications.
CORSCross-origin requests are allowed globally; per-bucket CORS configuration is not supported (returns 501).
WebsiteStatic website hosting configuration is not supported by the storage backend (returns 501).
πŸ›£οΈ

Path-style only

URLs in the form https://s3.petadata.com.br:2222/bucket/key. Virtual-host-style (bucket.s3.petadata.com.br) is not supported. Set forcePathStyle = true in the SDK.

πŸ“

Max key segment length

Each slash-separated segment of the object key supports up to 255 bytes. Larger keys return 400 KeyTooLongError.

🌍

Fixed region us-east-1

The service assumes us-east-1 for every SigV4 signature. Use exactly that region in the SDK; declaring another region causes SignatureDoesNotMatch.

πŸ”’

HTTPS required

The endpoint only accepts TLS connections on port 2222. Plain HTTP is rejected.

πŸ’¬ Need help?

Our team replies in Portuguese, English, and Spanish. For urgent issues prefer WhatsApp.