div strong 🔨 In Development — This section is still being developed and may change. Invalidate limit caches for organization and API keys. Use this endpoint when limits are updated directly in the database to ensure the cache reflects the new limits immediately. **Admin only** - Requires global admin privileges. ## Request Body **`organization_id`** string required The organization ID whose limit caches should be invalidated. **`api_key_ids`** array of strings optional Array of API key IDs to invalidate per-key limit caches. If not provided, only organization-level caches are cleared. ## Returns Returns a response with success status and count of caches cleared by type (organization limit, total API key limit, per-key limits). ```bash cURL curl -X POST https://api.aitronos.com/v1/cache/invalidate-limits \ -H "X-API-Key: $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "organization_id": "org_abc123", "api_key_ids": ["key_xyz789", "key_def456"] }' ``` ```python Python import os import requests api_key = os.environ["FREDDY_API_KEY"] response = requests.post( "https://api.aitronos.com/v1/cache/invalidate-limits", headers={"X-API-Key": api_key}, json={ "organization_id": "org_abc123", "api_key_ids": ["key_xyz789", "key_def456"] } ) result = response.json() ``` ```javascript JavaScript const apiKey = process.env.FREDDY_API_KEY; const response = await fetch( 'https://api.aitronos.com/v1/cache/invalidate-limits', { method: 'POST', headers: { 'X-API-Key': apiKey, 'Content-Type': 'application/json' }, body: JSON.stringify({ organization_id: 'org_abc123', api_key_ids: ['key_xyz789', 'key_def456'] }) } ); const result = await response.json(); ``` ## Response ```json { "success": true, "message": "Limit caches invalidated successfully", "caches_cleared": { "organization_limit": 1, "total_api_key_limit": 1, "per_key_limit": 2 } } ``` ## Error Responses ### 403 Forbidden ```json { "success": false, "error": { "code": "INSUFFICIENT_PERMISSIONS", "message": "Admin privileges required", "status": 403 } } ```