Assign an automation to a folder or remove it from a folder. ## Path Parameters **`automation_id`** string required Automation ID (sauto_ prefixed) ## Request Body **`folder_id`** string | null required Target folder ID or null to remove from folder **`display_order`** integer optional Sort position within folder ## Returns Returns the updated automation object with folder assignment. Request ```bash cURL - Move to Folder curl -X PATCH "https://api.aitronos.com/api/v1/streamline/automations/sauto_jkl012/folder" \ -H "X-API-Key: $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "folder_id": "sfold_abc123", "display_order": 2 }' ``` ```bash cURL - Remove from Folder curl -X PATCH "https://api.aitronos.com/api/v1/streamline/automations/sauto_jkl012/folder" \ -H "X-API-Key: $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "folder_id": null }' ``` ```python Python import os import requests api_key = os.environ["FREDDY_API_KEY"] automation_id = "sauto_jkl012" # Move to folder response = requests.patch( f"https://api.aitronos.com/api/v1/streamline/automations/{automation_id}/folder", headers={"X-API-Key": api_key}, json={ "folder_id": "sfold_abc123", "display_order": 2 } ) automation = response.json() print(f"Moved automation to folder: {automation['folder_id']}") ``` ```javascript JavaScript const apiKey = process.env.FREDDY_API_KEY; const automationId = "sauto_jkl012"; // Move to folder const response = await fetch( `https://api.aitronos.com/api/v1/streamline/automations/${automationId}/folder`, { method: "PATCH", headers: { "X-API-Key": apiKey, "Content-Type": "application/json" }, body: JSON.stringify({ folder_id: "sfold_abc123", display_order: 2 }) } ); const automation = await response.json(); console.log(`Moved automation to folder: ${automation.folder_id}`); ``` Response ```json 200 OK { "id": "sauto_jkl012", "name": "Customer Onboarding", "folder_id": "sfold_abc123", "display_order": 2, "organization_id": "org_xyz789", "git_sync_status": "healthy", "created_at": "2025-11-28T09:00:00Z", "updated_at": "2025-11-28T14:30:00Z" } ``` ```json 422 Unprocessable Entity { "success": false, "error": { "code": "ORGANIZATION_MISMATCH", "message": "Folder and automation belong to different organizations", "status": 422 } } ```