Configure Cross-Origin Resource Sharing (CORS) settings for your storage bucket to control browser access to your files.
This endpoint requires authentication via API key.
Array of allowed HTTP methods (default: [“GET”, “POST”, “PUT”, “DELETE”])
Array of allowed headers (default: [”*”])
Maximum age for preflight cache in seconds (default: 3600)
curl -X POST https://api.verbalisai.com/v1/storage/configure-cors \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"allowedOrigins": ["https://example.com", "https://app.example.com"],
"allowedMethods": ["GET", "POST", "PUT"],
"allowedHeaders": ["Content-Type", "Authorization"],
"maxAgeSeconds": 7200
}'
{
"success": true,
"message": "CORS configuration updated successfully",
"data": {
"allowedOrigins": ["https://example.com", "https://app.example.com"],
"allowedMethods": ["GET", "POST", "PUT"],
"allowedHeaders": ["Content-Type", "Authorization"],
"maxAgeSeconds": 7200,
"updatedAt": "2024-01-15T10:30:00Z"
}
}
Get CORS Configuration
Retrieve the current CORS configuration for your storage bucket.
curl -X GET https://api.verbalisai.com/v1/storage/cors-config \
-H "Authorization: Bearer YOUR_API_KEY"
{
"success": true,
"data": {
"allowedOrigins": ["https://example.com", "https://app.example.com"],
"allowedMethods": ["GET", "POST", "PUT"],
"allowedHeaders": ["Content-Type", "Authorization"],
"maxAgeSeconds": 7200,
"lastUpdated": "2024-01-15T10:30:00Z"
}
}
Response Fields
Indicates if the request was successful
Show CORS Configuration Object
Array of allowed origins for CORS requests
Array of allowed HTTP methods
Array of allowed request headers
Maximum age for preflight cache in seconds
ISO timestamp when configuration was last updated
ISO timestamp when configuration was last updated (GET endpoint)
Notes
- CORS configuration affects browser access to your stored files
- Wildcard origins (”*”) should be used carefully in production
- Changes may take a few minutes to propagate
- Invalid configurations will be rejected with detailed error messages