コンテンツにスキップ

Replace a storage destination credential

PUT
/api/admin/storage-destinations/{id}/credentials
Code sample: Shell / cURL
curl --request PUT \
--url https://auth.example.com/api/admin/storage-destinations/example/credentials \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "credential": { "apiTokenRef": "secret://cloudflare-r2-token" } }'

Encrypt and replace a storage destination credential after permission and high-risk approval checks.

id
required
string

Replace the encrypted credential for a storage destination. A high-risk approval grant can be required.

Media type application/json
object
credential
required
object
key
additional properties
Example
{
"credential": {
"apiTokenRef": "secret://cloudflare-r2-token"
}
}

Storage destination mutation result.

Media type application/json
object
item
required
object
key
additional properties
audit_id
One of:
string
version
integer
key
additional properties
Example
{
"item": {
"id": "sd_123",
"scope_type": "platform",
"scope_id": "platform",
"name": "audit-archive",
"display_name": "Audit Archive",
"description": "R2 bucket for audit log archives.",
"provider": "r2",
"config": {
"bindingRef": "AUDIT_ARCHIVE"
},
"managed_by": "admin",
"read_only": false,
"has_credential": false,
"credential_key_version": null,
"credential_updated_at": null,
"credential_updated_by": null,
"status": "active",
"created_by": "admin_123",
"updated_by": "admin_123",
"created_at": 1770000000000,
"updated_at": 1770000000000
},
"audit_id": "audit_123"
}

Error response.

Media type application/json
object
error
string
message
string
error_description
string
key
additional properties
Example generated
{
"error": "example",
"message": "example",
"error_description": "example"
}