Get paginated audit logs for a specific member. #### Path Parameters **`organization_id`** string required Organization ID **`user_id`** string required User ID to get change logs for #### Request Body **`skip`** integer optional · Defaults to `0` Number of records to skip (min: 0). **`take`** integer optional · Defaults to `50` Number of records to return (min: 1, max: 100). **`start_date`** datetime optional Filter logs from this date (ISO 8601 format). **`end_date`** datetime optional Filter logs until this date (ISO 8601 format). **`resource_type`** string optional Filter by resource type. Valid values: `organization_user`, `assistant`, `rule`, `document`. **`action`** string optional Filter by action. Valid values: `created`, `updated`, `deleted`, `added`, `removed`, `restored`, `entity_attached`, `entity_detached`. ## Returns Returns paginated audit logs for the specific member. ## Notes - Returns only audit logs related to the specific member - Validates that user_id exists and is a member of the organization - Returns 404 if user is not found in the organization ## Authorization Requires Admin or Owner role. ```bash curl -X POST https://api.aitronos.com/v1/organizations/org_abc123/users/usr_xyz789/change-logs \ -H "X-API-Key: $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "skip": 0, "take": 50, "resource_type": "organization_user", "action": "updated" }' ``` ```python import requests import os api_key = os.environ["FREDDY_API_KEY"] org_id = "org_abc123" user_id = "usr_xyz789" response = requests.post( f"https://api.aitronos.com/v1/organizations/{org_id}/users/{user_id}/change-logs", headers={ "X-API-Key": api_key, "Content-Type": "application/json" }, json={ "skip": 0, "take": 50, "resource_type": "organization_user", "action": "updated" } ) logs = response.json() ``` ```javascript const response = await fetch('https://api.aitronos.com/v1/organizations/org_abc123/users/usr_xyz789/change-logs', { method: 'POST', headers: { 'Authorization': `Bearer ${process.env.FREDDY_API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ skip: 0, take: 50, resource_type: 'organization_user', action: 'updated' }) }); const logs = await response.json(); ``` **Response:** 200 OK ```json { "logs": [ { "id": "log_abc123", "user_id": "usr_xyz789", "user_name": "Admin User", "user_email": "admin@example.com", "action": "updated", "timestamp": "2025-01-20T14:45:00Z", "resource_type": "organization_user", "resource_id": "usr_def456", "resource_name": "John Doe", "changes": [ { "field": "status_id", "old_value": "status_active", "new_value": "status_inactive" } ] } ], "total_count": 12, "skip": 0, "take": 50 } ``` 404 Not Found ```json { "success": false, "error": { "code": "USER_NOT_FOUND", "message": "We couldn't find an account with that information.", "system_message": "User not found in organization", "type": "client_error", "status": 404, "details": { "user_id": "invalid_user_id", "organization_id": "org_xxx" } } } ```