API support for creating R2 S3 credentials
I need to dynamically create S3 style credentials (i.e. api key and key secret combo) to enable writes to a dynamically created R2 bucket. I'm looking to use the API to create these.
I've successfully created a bucket using the API and an auth token configured with the R2 edit permission.
I have not been able to create the S3 style credentials using the API, however.
This interface looks promising: https://developers.cloudflare.com/api/operations/user-api-tokens-create-token
However, the result does not contain (at least per the docs) the S3 creds - it only contains the token value. ALSO, I'm unable to configure an auth token with the permission to use this API call in the first place.
Under https://dash.cloudflare.com/profile/api-tokens I can add permissions for a token. However, I don't see a permission that allows editing/creating API tokens.
To summarize:
I've successfully created a bucket using the API and an auth token configured with the R2 edit permission.
I have not been able to create the S3 style credentials using the API, however.
This interface looks promising: https://developers.cloudflare.com/api/operations/user-api-tokens-create-token
However, the result does not contain (at least per the docs) the S3 creds - it only contains the token value. ALSO, I'm unable to configure an auth token with the permission to use this API call in the first place.
Under https://dash.cloudflare.com/profile/api-tokens I can add permissions for a token. However, I don't see a permission that allows editing/creating API tokens.
To summarize:
- How can I use the API to create an API token? This requires granting permission for this, which I haven't been able to do.
- How can I create an API token that returns S3 style credentials for editing an R2 bucket?
Interact with Cloudflare's products and services via the Cloudflare API