Create a storage connection
POST/program/api/v2/storage/connections
Creates a project-scoped, reusable storage connection. One connection may back more than one storage feature, so a customer using a single bucket for two surfaces enters the credentials once rather than once per surface.
The connection is verified against its bucket before it is recorded. A connection that fails to verify is refused and nothing is written. The four verification failures are reported as 400 with these error codes:
connection_invalid_credentials— the provider rejected the access key or secret.connection_bucket_not_found— the credentials authenticated, but the named bucket does not exist.connection_endpoint_mismatch— the endpoint or region is wrong for this provider or bucket.connection_unreachable— the endpoint did not respond.
endpoint is required for every provider except Amazon S3,
where the region derives it.
Credentials are write-only: accepted here, persisted to Vault, and never echoed in any response.
name is unique within the project; a collision is refused with
409 connection_name_in_use.
Write access is never probed directly. Proving it would mean
putting an object into the customer's bucket and removing it
again, so verification records only what listing could observe.
Credentials that read but cannot write still create the
connection. Nothing can observe write access without writing, so
readOnly starts false. The first upload that fails with 403
connection_read_only, naming the missing permission
(s3:PutObject), sets it to true.
Request
Responses
- 201
- 400
- 403
- 409
- 500
Connection created and verified
Validation failure, or the connection failed verification
(connection_invalid_credentials /
connection_bucket_not_found /
connection_endpoint_mismatch / connection_unreachable).
Nothing is written.
Forbidden — no project access
A connection with this name already exists in the project (connection_name_in_use)
Internal Server Error