# Create organization div strong 🔨 In Development — This section is still being developed and may change. Create a new organization that the current user can manage. Organizations allow you to group users, manage access controls, and organize resources. #### Request Body **`name`** string required Organization name (e.g., "Aitronos Corp"). **`type`** string required Organization type. Must be one of: `"Work"`, `"Personal"`, or `"School"`. **`description`** string optional Organization description. **`logo_image`** string optional Base64-encoded logo image string. Automatically resized to 512x512 and compressed. Max upload size: 50MB. **`email_domains`** array optional Array of allowed email domains for auto-joining (e.g., `["aitronos.com", "example.org"]`). ## Returns A [CreateOrganizationResponse](#createorganizationresponse) object containing the API response data. Create Work Organization ```bash curl -X POST https://api.freddy.aitronos.com/v1/organizations \ -H "Authorization: Bearer $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Aitronos Corp", "type": "Work", "description": "Leading AI technology company", "email_domains": ["aitronos.com"] }' ``` ```python import requests response = requests.post( "https://api.freddy.aitronos.com/v1/organizations", headers={"Authorization": f"Bearer {api_key}"}, json={ "name": "Aitronos Corp", "type": "Work", "description": "Leading AI technology company", "email_domains": ["aitronos.com"] } ) organization = response.json() print(f"Created organization: {organization['organization']['name']}") ``` ```javascript const response = await fetch('https://api.freddy.aitronos.com/v1/organizations', { method: 'POST', headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ name: 'Aitronos Corp', type: 'Work', description: 'Leading AI technology company', email_domains: ['aitronos.com'] }) }); const organization = await response.json(); console.log(`Created organization: ${organization.organization.name}`); ``` Create Personal Organization ```bash curl -X POST https://api.freddy.aitronos.com/v1/organizations \ -H "Authorization: Bearer $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "My Personal AI", "type": "Personal", "description": "Personal AI experiments and projects" }' ``` ```python import requests response = requests.post( "https://api.freddy.aitronos.com/v1/organizations", headers={"Authorization": f"Bearer {api_key}"}, json={ "name": "My Personal AI", "type": "Personal", "description": "Personal AI experiments and projects" } ) organization = response.json() print(f"Created organization: {organization['organization']['name']}") ``` ```javascript const response = await fetch('https://api.freddy.aitronos.com/v1/organizations', { method: 'POST', headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ name: 'My Personal AI', type: 'Personal', description: 'Personal AI experiments and projects' }) }); const organization = await response.json(); console.log(`Created organization: ${organization.organization.name}`); ``` Create Organization with Logo ```bash # Convert image to base64 first LOGO_BASE64=$(base64 -i logo.png) curl -X POST https://api.freddy.aitronos.com/v1/organizations \ -H "Authorization: Bearer $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Tech Startup Inc", "type": "Work", "description": "Innovative tech startup", "logo_image": "'$LOGO_BASE64'", "email_domains": ["startup.com", "startup.org"] }' ``` ```python import requests import base64 # Read and encode logo image with open('logo.png', 'rb') as f: logo_base64 = base64.b64encode(f.read()).decode() response = requests.post( "https://api.freddy.aitronos.com/v1/organizations", headers={"Authorization": f"Bearer {api_key}"}, json={ "name": "Tech Startup Inc", "type": "Work", "description": "Innovative tech startup", "logo_image": logo_base64, "email_domains": ["startup.com", "startup.org"] } ) organization = response.json() print(f"Created organization with logo: {organization['organization']['name']}") ``` ```javascript // Read file as base64 const logoFile = await fetch('logo.png'); const logoArrayBuffer = await logoFile.arrayBuffer(); const logoBase64 = btoa(String.fromCharCode(...new Uint8Array(logoArrayBuffer))); const response = await fetch('https://api.freddy.aitronos.com/v1/organizations', { method: 'POST', headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ name: 'Tech Startup Inc', type: 'Work', description: 'Innovative tech startup', logo_image: logoBase64, email_domains: ['startup.com', 'startup.org'] }) }); const organization = await response.json(); console.log(`Created organization with logo: ${organization.organization.name}`); ``` Create School Organization ```bash curl -X POST https://api.freddy.aitronos.com/v1/organizations \ -H "Authorization: Bearer $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Tech University", "type": "School", "description": "Computer Science Department", "email_domains": ["techuni.edu", "cs.techuni.edu"] }' ``` ```python import requests response = requests.post( "https://api.freddy.aitronos.com/v1/organizations", headers={"Authorization": f"Bearer {api_key}"}, json={ "name": "Tech University", "type": "School", "description": "Computer Science Department", "email_domains": ["techuni.edu", "cs.techuni.edu"] } ) organization = response.json() print(f"Created organization: {organization['organization']['name']}") ``` ```javascript const response = await fetch('https://api.freddy.aitronos.com/v1/organizations', { method: 'POST', headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ name: 'Tech University', type: 'School', description: 'Computer Science Department', email_domains: ['techuni.edu', 'cs.techuni.edu'] }) }); const organization = await response.json(); console.log(`Created organization: ${organization.organization.name}`); ``` ## Response ```json { "success": true, "message": "Organization created successfully", "organization": { "id": "ORG_797C4DDB256A300C", "name": "Aitronos Corp", "type": "Work", "description": "Leading AI technology company", "logo_image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...", "image_url": null, "email_domains": ["aitronos.com"], "is_active": true, "created_at": "2025-01-15T10:30:00Z", "updated_at": "2025-01-15T10:30:00Z", "departments": [ { "id": "DEPT_1234567890ABCD", "name": "Engineering", "description": "Software development and engineering" }, { "id": "DEPT_1234567890ABCE", "name": "Product", "description": "Product management and design" }, { "id": "DEPT_1234567890ABCF", "name": "Sales", "description": "Sales and business development" }, { "id": "DEPT_1234567890ABCG", "name": "Marketing", "description": "Marketing and communications" }, { "id": "DEPT_1234567890ABCH", "name": "Operations", "description": "Operations and administration" } ], "providers": { "openai": { "id": "PRV_1234567890ABCD", "name": "OpenAI", "is_active": true }, "anthropic": { "id": "PRV_1234567890ABCE", "name": "Anthropic", "is_active": true } } } } ```