# Update category div strong 🔨 In Development — This section is still being developed and may change. Modify an existing rule category's properties, such as display name, description, priority range, or metadata. This endpoint supports partial updates - only the fields you want to change need to be included. Update category properties while maintaining its ID and core structure. Use this to modify category settings, update descriptions, or adjust priority ranges as your organization's needs evolve. #### Path Parameters **`organizationId`** string required The organization identifier that owns the category. **`category_id`** string required The unique identifier of the category to update. This is the `name` field from the category object. #### Request Body **`display_name`** string optional Updated human-readable name for the category. **`description`** string optional Updated description explaining the category's purpose. **`priority_range`** string optional Updated priority range recommendation (format: "min-max"). **`recommended_limit`** integer optional Updated recommended character limit for rules in this category. **`metadata`** object optional Updated custom key-value pairs for tagging and organization. ## Returns A [RuleResponse](#ruleresponse) object containing the API response data. Update category description and limits ```bash curl -X PATCH "https://api.freddy.aitronos.com/v1/organizations/org_123/rules/categories/compliance" \ -H "Authorization: Bearer $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "description": "Enhanced compliance rules covering GDPR, CCPA, and industry-specific regulations", "recommended_limit": 6000, "priority_range": "95-100", "metadata": { "department": "legal", "requires_approval": "true", "last_reviewed": "2024-10-01" } }' ``` ```python import requests organization_id = "org_123" category_id = "compliance" response = requests.patch( f"https://api.freddy.aitronos.com/v1/organizations/{organization_id}/rules/categories/{category_id}", headers={ "Authorization": f"Bearer {api_key}", "Content-Type": "application/json" }, json={ "description": "Enhanced compliance rules covering GDPR, CCPA, and industry-specific regulations", "recommended_limit": 6000, "priority_range": "95-100", "metadata": { "department": "legal", "requires_approval": "true", "last_reviewed": "2024-10-01" } } ) updated_category = response.json() print(f"Updated category: {updated_category['display_name']}") ``` ```javascript const organizationId = 'org_123'; const categoryId = 'compliance'; const response = await fetch(`https://api.freddy.aitronos.com/v1/organizations/${organizationId}/rules/categories/${categoryId}`, { method: 'PATCH', headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ description: 'Enhanced compliance rules covering GDPR, CCPA, and industry-specific regulations', recommended_limit: 6000, priority_range: '95-100', metadata: { department: 'legal', requires_approval: 'true', last_reviewed: '2024-10-01' } }) }); const updatedCategory = await response.json(); console.log(`Updated category: ${updatedCategory.display_name}`); ``` Change priority range only ```bash curl -X PATCH "https://api.freddy.aitronos.com/v1/organizations/org_123/rules/categories/brand_voice" \ -H "Authorization: Bearer $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "priority_range": "75-85", "recommended_limit": 3500 }' ``` ```python import requests organization_id = "org_123" category_id = "brand_voice" response = requests.patch( f"https://api.freddy.aitronos.com/v1/organizations/{organization_id}/rules/categories/{category_id}", headers={ "Authorization": f"Bearer {api_key}", "Content-Type": "application/json" }, json={ "priority_range": "75-85", "recommended_limit": 3500 } ) print(f"Priority range updated to: {response.json()['priority_range']}") ``` ## Response 200 OK ```json { "id": "cat_compliance_001", "name": "compliance", "display_name": "Compliance & Legal", "description": "Enhanced compliance rules covering GDPR, CCPA, and industry-specific regulations", "priority_range": "95-100", "recommended_limit": 6000, "rule_count": 12, "is_default": false, "is_active": true, "organizationId": "org_xyz789", "createdBy": "user_123", "createdAt": "2024-10-04T12:00:00Z", "updatedAt": "2024-10-30T16:45:00Z", "metadata": { "department": "legal", "requires_approval": "true", "last_reviewed": "2024-10-01" } } ``` Errors ```json { "error": { "type": "invalid_request_error", "message": "No category found with the specified ID", "code": "resource_not_found", "param": "category_id" } } ``` ```json { "error": { "type": "invalid_request_error", "message": "Invalid priority range format. Must be in format 'min-max' (e.g., '70-89')", "code": "invalid_priority_range", "param": "priorityRange" } } ``` ```json { "error": { "type": "permission_error", "message": "You do not have permission to modify organization categories", "code": "insufficient_permissions" } } ```