# Update organization API key div strong 🔨 In Development — This section is still being developed and may change. Modify metadata, spending limits, or activation status for an organization API key. #### Path Parameters **`organization_id`** string required Organization scope. **`api_key_id`** string required API key identifier (prefixed with `apk_`). #### Request Body Provide any combination of the following fields: - **`name`** string — Friendly label displayed in dashboards. - **`monthly_limit`** number or null — Spending limit in CHF (`null` removes the limit). - **`is_active`** boolean — Enables or disables the key immediately. - **`is_paused`** boolean — Temporarily pause the key without revoking it. ## Returns Updated API key metadata reflecting the changes. ```json { "id": "apk_7f21a9d94e6f48b1", "organizationId": "ORG_1234567890abcdef", "maskedKey": "oak_prod_1f33…9b2", "name": "Production backend", "status": "active", "monthlyLimit": 3000, "currentMonthCost": 912.11, "updatedAt": "2025-11-05T08:15:03Z" } ``` ## Request example ```bash curl -X PUT "https://api.freddy.aitronos.com/v1/organizations/ORG_1234567890abcdef/api/apk_7f21a9d94e6f48b1" \ -H "Authorization: Bearer $FREDDY_API_KEY" \ -H "Content-Type": "application/json" \ -d '{ "monthly_limit": 3000, "is_paused": false }' ``` ```python import requests response = requests.put( "https://api.freddy.aitronos.com/v1/organizations/ORG_1234567890abcdef/api/apk_7f21a9d94e6f48b1", headers={ "Authorization": f"Bearer {api_key}", "Content-Type": "application/json" }, json={ "monthly_limit": 3000, "is_paused": False } ) response.raise_for_status() print(response.json()["monthlyLimit"]) ``` ```javascript const response = await fetch( 'https://api.freddy.aitronos.com/v1/organizations/ORG_1234567890abcdef/api/apk_7f21a9d94e6f48b1', { method: 'PUT', headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ monthly_limit: 3000, is_paused: false }) } ); if (!response.ok) { throw new Error('Failed to update API key'); } const updated = await response.json(); console.log(updated.monthlyLimit); ``` ## Related resources - [Retrieve organization API key](/docs/api-reference/organizations/management/api-keys/retrieve) - [Delete organization API key](/docs/api-reference/organizations/management/api-keys/delete) - [Update organization API limits](/docs/api-reference/organizations/analytics/update-api-limit)