Create buckets in the intended compartment with the console or CLI before using them through the S3 API. Audit existing S3-created buckets for root-compartment placement if your IAM model is compartment-scoped. Remember the two APIs are congruent: data written via S3 is readable via the native API and vice versa.

Context: Official docs (Oracle Object Storage FAQ): all buckets created through the Amazon S3 Compatibility API land in the root compartment, because the S3 API has no compartment concept. If root-compartment buckets are not acceptable, you must create the bucket in your chosen compartment via the console or CLI first, then operate on it through the S3 API. Agents that provision buckets via S3 and then apply compartment-scoped IAM policies find the policies do not match the bucket's actual location.