title: Set Current Organization keywords: - set current organization - put - set - current - organization # Set Current Organization Set current organization for the authenticated user. #### Request Body **`organization_id`** string required Organization ID to set as current (org_xxx format) ## Returns **`success`** boolean Whether the operation was successful **`message`** string Success message **`current_organization_id`** string The new current organization ID **`organization`** object Organization details Example ```bash cURL curl -X PUT "https://api.aitronos.com/v1/user/current-organization" \ -H "X-API-Key: $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "organization_id": "your_organization_id" }' ``` ```python Python import os import requests api_key = os.environ["FREDDY_API_KEY"] response = requests.put( "https://api.aitronos.com/v1/user/current-organization", headers={"X-API-Key": api_key}, json={'organization_id': 'your_organization_id'} ) print(response.json()) ``` ```javascript JavaScript const apiKey = process.env.FREDDY_API_KEY; const response = await fetch('https://api.aitronos.com/v1/user/current-organization', { method: 'PUT', headers: { 'X-API-Key': apiKey, 'Content-Type': 'application/json' }, body: JSON.stringify({"organization_id": "your_organization_id"}) }); const data = await response.json(); console.log(data); ``` **Response:** ```json 200 OK { "success": true, "message": "Operation completed successfully", "current_organization_id": "abc123def456", "organization": { "id": "org_abc123def456", "name": "My Resource", "type": "default" } } ``` Errors ```json 401 Unauthorized { "success": false, "error": { "code": "AUTHENTICATION_REQUIRED", "message": "Authentication required. Please provide a valid API key.", "system_message": "Missing or invalid authorization header", "type": "authentication_error", "status": 401, "details": {}, "trace_id": "req_abc123xyz", "timestamp": "2025-11-11T10:30:00Z" } } ``` ```json 403 Forbidden { "success": false, "error": { "code": "INSUFFICIENT_PERMISSIONS", "message": "You do not have permission to access this resource.", "system_message": "Insufficient permissions for this operation", "type": "authorization_error", "status": 403, "details": {}, "trace_id": "req_def456uvw", "timestamp": "2025-11-11T10:30:00Z" } } ``` ## Related Resources - [Get Profile](/docs/api-reference/users/get-profile)