# Update organization Update organization details. User must be an Admin or Owner of the organization. Invalidates limit caches when usage limits are updated. ## Path Parameters **`organization_id`** string required The unique identifier of the organization to update (e.g., `org_abc123def456`). ## Request Body All fields are optional. Only include fields you want to update. **`name`** string optional Organization name (1-255 characters). **`description`** string optional Organization description. **`website`** string optional Website URL (max 500 characters). **`industry`** string optional Industry or sector (max 100 characters). **`company_size`** string optional Company size range (max 50 characters). **`logo_image`** string optional Base64-encoded logo image. **`image_url`** string optional URL to organization image (max 500 characters). **`is_active`** boolean optional Whether the organization is active. **`api_usage_limit`** number optional API spending limit in CHF (must be >= 0). Updating this invalidates limit caches. **`api_key_usage_limit`** number optional Monthly spending limit for all API keys combined in CHF (must be >= 0). Updating this invalidates limit caches. **`domains`** array optional Email domains for automatic member access. Users with emails from these domains can join automatically. ## Returns An [OrganizationResponse](#organizationresponse) object with the updated organization details. Request ```bash cURL curl -X PATCH "https://api.aitronos.com/v1/organizations/org_abc123def456" \ -H "X-API-Key: $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Acme Corporation Updated", "description": "Updated description", "website": "https://acme-corp.com", "api_usage_limit": 2000.0 }' ``` ```python Python import os import requests api_key = os.environ["FREDDY_API_KEY"] organization_id = "org_abc123def456" response = requests.patch( f"https://api.aitronos.com/v1/organizations/{organization_id}", headers={ "X-API-Key": api_key, "Content-Type": "application/json" }, json={ "name": "Acme Corporation Updated", "description": "Updated description", "website": "https://acme-corp.com", "api_usage_limit": 2000.0 } ) organization = response.json() print(organization) ``` ```javascript JavaScript const apiKey = process.env.FREDDY_API_KEY; const organizationId = 'org_abc123def456'; const response = await fetch( `https://api.aitronos.com/v1/organizations/${organizationId}`, { method: 'PATCH', headers: { 'X-API-Key': apiKey, 'Content-Type': 'application/json' }, body: JSON.stringify({ name: 'Acme Corporation Updated', description: 'Updated description', website: 'https://acme-corp.com', api_usage_limit: 2000.0 }) } ); const organization = await response.json(); console.log(organization); ``` Response ```json 200 - OK { "id": "org_abc123def456", "name": "Acme Corporation Updated", "type": "Work", "description": "Updated description", "website": "https://acme-corp.com", "industry": "Technology", "company_size": "50-200", "logo_image": null, "image_url": "https://api.aitronos.com/v1/icons/icon_abc123", "is_active": true, "owner_id": "usr_xyz789", "api_usage_limit": 2000.0, "total_usage_limit": 5000.0, "storage_free_bytes_allowance": 10737418240, "pricing_tier_id": "tier_standard", "created_at": "2025-01-15T10:30:00Z", "updated_at": "2025-12-17T10:30:00Z" } ``` ```json 401 - Unauthorized { "success": false, "error": { "code": "AUTHENTICATION_REQUIRED", "message": "User authentication required", "system_message": "Authentication required", "type": "client_error", "status": 401, "trace_id": "abc-123-def", "timestamp": "2025-12-17T10:30:00Z" } } ``` ```json 403 - Forbidden { "success": false, "error": { "code": "INSUFFICIENT_PERMISSIONS", "message": "You are not authorized to update this organization", "system_message": "Insufficient permissions", "type": "client_error", "status": 403, "details": { "organization_id": "org_abc123def456" }, "trace_id": "abc-123-def", "timestamp": "2025-12-17T10:30:00Z" } } ``` ```json 404 - Not Found { "success": false, "error": { "code": "ORGANIZATION_NOT_FOUND", "message": "Organization not found", "system_message": "Organization not found", "type": "client_error", "status": 404, "details": { "organization_id": "org_abc123def456" }, "trace_id": "abc-123-def", "timestamp": "2025-12-17T10:30:00Z" } } ```