Skip to content

User - Activity Logs

Base URL: https://your-domain.com

Admin endpoints for viewing system activity logs. All endpoints require admin authentication.


Fetch All Activity Logs

Retrieve all activity logs with pagination.

PropertyValue
EndpointFetch All Activity Logs
MethodGET
URL/api/v1/activity-logs
AuthenticationBearer Token

Request Headers:

HeaderValueRequired
Acceptapplication/jsonYes
AuthorizationBearer your-auth-tokenYes

Success Response (200 OK):

json
{
    "success": true,
    "data": [
        {
            "id": 1,
            "user_id": 1,
            "user_name": "Admin",
            "action": "created",
            "subject_type": "Subscriber",
            "subject_id": 5,
            "description": "Created subscriber John Doe",
            "created_at": "2024-01-15 10:30:00"
        }
    ]
}

Fetch Activity Log

Retrieve details of a specific activity log entry.

PropertyValue
EndpointFetch Activity Log
MethodGET
URL/api/v1/activity-logs/{id}
AuthenticationBearer Token

Success Response (200 OK):

json
{
    "success": true,
    "data": {
        "id": 1,
        "user_id": 1,
        "user_name": "Admin",
        "action": "created",
        "subject_type": "Subscriber",
        "subject_id": 5,
        "description": "Created subscriber John Doe",
        "properties": {"old": {}, "new": {"name": "John Doe"}},
        "ip_address": "192.168.1.100",
        "created_at": "2024-01-15 10:30:00"
    }
}

Fetch Logs By Subject

Get activity logs for a specific subject (entity).

PropertyValue
EndpointFetch Logs By Subject
MethodGET
URL/api/v1/activity-logs/by-subject
AuthenticationBearer Token

Query Parameters:

ParameterTypeRequiredDescription
subject_typestringYesEntity type (Subscriber, Package, etc.)
subject_idintegerYesEntity ID

Success Response (200 OK):

json
{
    "success": true,
    "data": [
        {
            "id": 1,
            "action": "updated",
            "user_name": "Admin",
            "description": "Updated subscriber package",
            "created_at": "2024-01-15 10:30:00"
        }
    ]
}

Fetch Logs By User

Get activity logs for a specific user.

PropertyValue
EndpointFetch Logs By User
MethodGET
URL/api/v1/activity-logs/by-user/{user_id}
AuthenticationBearer Token

Success Response (200 OK):

json
{
    "success": true,
    "data": [
        {
            "id": 1,
            "action": "created",
            "subject_type": "Subscriber",
            "description": "Created subscriber John Doe",
            "created_at": "2024-01-15 10:30:00"
        }
    ]
}

www.onezeroart.com