# Upload custom icon Upload a custom icon for your organization. Supports SVG, PNG, and JPG formats up to 5MB. #### Path Parameters **`org_id`** string required The ID of the organization to upload the icon for. #### Request Body This endpoint requires `multipart/form-data` content type. **`file`** file required Icon file to upload. Supported formats: SVG, PNG, JPG. Maximum size: 5MB. **`name`** string required Name of the icon. Must be unique within the organization. **`description`** string optional Optional description of the icon. **`tags`** string optional Comma-separated list of tags for categorizing the icon (e.g., "custom,brand,logo"). **`category`** string optional Icon category. Defaults to "custom". Common values: "custom", "business", "creative", "technical". ## Returns Returns an [Icon object](/docs/api-reference/objects/icon-object) if successful. Request ```bash cURL curl -X POST https://api.aitronos.com/v1/icons/organizations/org_123 \ -H "X-API-Key: $FREDDY_API_KEY" \ -F "file=@/path/to/icon.png" \ -F "name=My Custom Icon" \ -F "description=A custom icon for my assistant" \ -F "tags=custom,brand" \ -F "category=custom" ``` ```python Python import os import requests api_key = os.environ["FREDDY_API_KEY"] org_id = "org_123" url = f"https://api.aitronos.com/v1/icons/organizations/{org_id}" headers = {"X-API-Key": api_key} with open("/path/to/icon.png", "rb") as icon_file: files = {"file": icon_file} data = { "name": "My Custom Icon", "description": "A custom icon for my assistant", "tags": "custom,brand", "category": "custom" } response = requests.post(url, headers=headers, files=files, data=data) icon = response.json() print(f"Uploaded icon: {icon['id']}") ``` ```javascript JavaScript const fs = require('fs'); const FormData = require('form-data'); const apiKey = process.env.FREDDY_API_KEY; const orgId = 'org_123'; const form = new FormData(); form.append('file', fs.createReadStream('/path/to/icon.png')); form.append('name', 'My Custom Icon'); form.append('description', 'A custom icon for my assistant'); form.append('tags', 'custom,brand'); form.append('category', 'custom'); fetch(`https://api.aitronos.com/v1/icons/organizations/${orgId}`, { method: 'POST', headers: { 'X-API-Key': apiKey, ...form.getHeaders() }, body: form }) .then(res => res.json()) .then(icon => console.log('Uploaded icon:', icon.id)); ``` Response ```json 201 Created { "id": "icon_abc123def456ghi789", "name": "My Custom Icon", "description": "A custom icon for my assistant", "tags": ["custom", "brand"], "category": "custom", "file_format": "png", "is_system": false, "is_active": true, "url": "/v1/icons/icon_abc123def456ghi789", "created_at": "2025-12-03T10:00:00Z", "updated_at": "2025-12-03T10:00:00Z" } ``` ```json 400 Bad Request - Invalid file format { "success": false, "error": { "code": "INVALID_FIELD_VALUE", "message": "Invalid file format. Supported formats: SVG, PNG, JPG", "type": "client_error", "status": 400, "details": { "field": "file", "provided_format": "gif" }, "trace_id": "abc-123-def", "timestamp": "2025-12-03T10:00:00Z" } } ``` ```json 400 Bad Request - File too large { "success": false, "error": { "code": "INVALID_FIELD_VALUE", "message": "File size exceeds maximum limit of 5MB", "type": "client_error", "status": 400, "details": { "field": "file", "max_size_mb": 5, "provided_size_mb": 7.2 }, "trace_id": "abc-123-def", "timestamp": "2025-12-03T10:00:00Z" } } ``` ```json 403 Forbidden { "success": false, "error": { "code": "ORGANIZATION_ACCESS_DENIED", "message": "You do not have access to this organization", "type": "client_error", "status": 403, "details": { "org_id": "org_123" }, "trace_id": "abc-123-def", "timestamp": "2025-12-03T10:00:00Z" } } ``` ```json 409 Conflict - Duplicate name { "success": false, "error": { "code": "DUPLICATE_ICON_NAME", "message": "An icon with this name already exists in your organization", "type": "client_error", "status": 409, "details": { "name": "My Custom Icon", "existing_icon_id": "icon_existing123" }, "trace_id": "abc-123-def", "timestamp": "2025-12-03T10:00:00Z" } } ```