# Get assistant history div strong 🔨 In Development — This section is still being developed and may change. Retrieve the complete change history for a specific assistant. This is a convenience endpoint that filters audit logs for the specified assistant. Get all audit log entries for a specific assistant, showing who made changes, when, and what was modified. #### Path Parameters **`assistant_id`** string required The unique identifier of the assistant. #### Query Parameters **`action`** string optional Filter by action type. Values: `created`, `updated`, `deleted`. **`user_id`** string optional Filter by user who performed the action. **`start_date`** string optional Filter logs from this date (ISO 8601 format). **`end_date`** string optional Filter logs until this date (ISO 8601 format). **`limit`** integer optional · Defaults to `50` Number of logs to return per page. Maximum: 100. **`offset`** integer optional · Defaults to `0` Number of logs to skip for pagination. ```bash curl "https://api.freddy.aitronos.com/v1/assistants/asst_abc123/history" \ -H "Authorization: Bearer $FREDDY_API_KEY" ``` ```python import requests response = requests.get( "https://api.freddy.aitronos.com/v1/assistants/asst_abc123/history", headers={"Authorization": f"Bearer {api_key}"} ) history = response.json() print(f"Found {len(history['audit_logs'])} changes") for log in history['audit_logs']: print(f"\n{log['timestamp']} - {log['action']} by {log['user_name']}") for change in log.get('changes', []): print(f" • {change['field']}: {change['old_value']} → {change['new_value']}") ``` ```javascript const response = await fetch('https://api.freddy.aitronos.com/v1/assistants/asst_abc123/history', { headers: { 'Authorization': `Bearer ${api_key}` } }); const history = await response.json(); console.log(`Found ${history.audit_logs.length} changes`); history.audit_logs.forEach(log => { console.log(`\n${log.timestamp} - ${log.action} by ${log.user_name}`); log.changes?.forEach(change => { console.log(` • ${change.field}: ${change.old_value} → ${change.new_value}`); }); }); ``` ## Response Returns an array of [Audit Log objects](/docs/api-reference/objects/audit-log-object) for the specified assistant. ```json { "audit_logs": [ { "id": "log_abc123", "timestamp": "2025-01-20T10:30:00Z", "resource_type": "assistant", "resource_id": "asst_abc123", "resource_name": "Customer Support Bot", "action": "updated", "user_id": "uid_user123", "user_name": "John Doe", "user_email": "john@example.com", "changes": [ { "field": "temperature", "old_value": 0.7, "new_value": 0.9 }, { "field": "tools.web_search", "old_value": false, "new_value": true } ], "metadata": { "ip_address": "192.168.1.1", "user_agent": "Mozilla/5.0...", "source": "web_ui" } }, { "id": "log_def456", "timestamp": "2025-01-15T14:22:00Z", "resource_type": "assistant", "resource_id": "asst_abc123", "resource_name": "Customer Support Bot", "action": "created", "user_id": "uid_user123", "user_name": "John Doe", "user_email": "john@example.com", "changes": [], "metadata": { "ip_address": "192.168.1.1", "user_agent": "Mozilla/5.0...", "source": "web_ui" } } ], "pagination": { "total": 2, "limit": 50, "offset": 0, "has_more": false } } ``` ### Errors ```json 404 Not Found { "error": { "message": "Assistant not found", "type": "not_found_error", "code": "assistant_not_found" } } ``` ```json 401 Unauthorized { "error": { "message": "Authentication required", "type": "authentication_error", "code": "missing_authentication" } } ``` ```json 403 Forbidden { "error": { "message": "Access denied to assistant", "type": "permission_error", "code": "insufficient_permissions" } } ``` ## Related Resources - [List Audit Logs](/docs/api-reference/audit-logs/list) - Generic audit log endpoint - [Retrieve Assistant](/docs/api-reference/assistants/retrieve) - [Update Assistant](/docs/api-reference/assistants/update) - [Audit Log Object](/docs/api-reference/objects/audit-log-object)