Audit Logs

Info about logs.

STAGING_URL: https://switch-api-staging.herokuapp.com
LIVE_URL: https://switchapi.azurewebsites.net

Get Audit Logs

GET https://switch-api-staging.herokuapp.com/admin/audits

Retrieves the audit logs.

Query Parameters

Name
Type
Description

search_query

string

Query string to search by user's name and email, as well as admin email

user_type

string

Filter by admin or user activities. Could be admin or user. Don't pass this param at all (or make it empty) to retrieve all logs of both types

start_date

string

Date filter in the format YYYY-MM-DD

end_date

string

Date filter in the format YYYY-MM-DD

log_type

string

The type of logs to be retrieved. Could be either of the following: - transactions - enrolments - disable_requests - enable_requests - verification - service_profile

page

string

Defaults to 1

per_page

string

Defaults to 20

Headers

Name
Type
Description

SWI-CID

string

Client ID

Authorization

string

Format is Bearer token

{
    "message": "Audit logs returned successfully",
    "data": [
        {
            "id": 10680,
            "auditable_id": 4,
            "auditable_type": "Admin",
            "user_type": null,
            "user": null,
            "action_performed": "signed in",
            "updated_object": {
                "id": 4,
                "email": "omitirand@gmail.com",
                "role": "super_admin",
                "disabled": false,
                "locked": false,
                "has_changed_password": true
            },
            "location": null,
            "remote_address": "127.0.0.1",
            "request_uuid": "c561124f-9fcd-4e4a-9ab3-f4d78fef2f4b",
            "created_at": "2019-08-14T11:15:54.012Z"
        },
        {
            "id": 10679,
            "auditable_id": 4,
            "auditable_type": "Admin",
            "user_type": null,
            "user": null,
            "action_performed": "signed in",
            "updated_object": {
                "id": 4,
                "email": "omitirand@gmail.com",
                "role": "super_admin",
                "disabled": false,
                "locked": false,
                "has_changed_password": true
            },
            "location": null,
            "remote_address": "127.0.0.1",
            "request_uuid": "59a64d49-785d-48c0-bf36-cd12397a07cc",
            "created_at": "2019-08-14T10:35:09.045Z"
        },
        {
            "id": 10678,
            "auditable_id": 4,
            "auditable_type": "Admin",
            "user_type": null,
            "user": null,
            "action_performed": "signed in",
            "updated_object": {
                "id": 4,
                "email": "omitirand@gmail.com",
                "role": "super_admin",
                "disabled": false,
                "locked": false,
                "has_changed_password": true
            },
            "location": null,
            "remote_address": "127.0.0.1",
            "request_uuid": "4f3a8a03-4e2c-45d0-a56d-1e43779102e3",
            "created_at": "2019-08-14T09:57:40.742Z"
        },
        {
            "id": 10677,
            "auditable_id": 4,
            "auditable_type": "Admin",
            "user_type": null,
            "user": null,
            "action_performed": "signed in",
            "updated_object": {
                "id": 4,
                "email": "omitirand@gmail.com",
                "role": "super_admin",
                "disabled": false,
                "locked": false,
                "has_changed_password": true
            },
            "location": null,
            "remote_address": "127.0.0.1",
            "request_uuid": "13e24da3-09e7-4e10-af0f-284b714c78ae",
            "created_at": "2019-08-11T15:59:31.115Z"
        },
        {
            "id": 10676,
            "auditable_id": 4,
            "auditable_type": "Admin",
            "user_type": null,
            "user": null,
            "action_performed": "signed in",
            "updated_object": {
                "id": 4,
                "email": "omitirand@gmail.com",
                "role": "super_admin",
                "disabled": false,
                "locked": false,
                "has_changed_password": true
            },
            "location": null,
            "remote_address": "127.0.0.1",
            "request_uuid": "525f5565-3e9a-45b4-9101-377ea369ec96",
            "created_at": "2019-08-09T17:20:18.836Z"
        },
        {
            "id": 10675,
            "auditable_id": 4,
            "auditable_type": "Admin",
            "user_type": null,
            "user": null,
            "action_performed": "signed in",
            "updated_object": {
                "id": 4,
                "email": "omitirand@gmail.com",
                "role": "super_admin",
                "disabled": false,
                "locked": false,
                "has_changed_password": true
            },
            "location": null,
            "remote_address": "127.0.0.1",
            "request_uuid": "a70e38a6-1820-4ae8-967a-42e23652ec8f",
            "created_at": "2019-08-09T16:46:48.507Z"
        },
        {
            "id": 10674,
            "auditable_id": 4,
            "auditable_type": "Admin",
            "user_type": null,
            "user": null,
            "action_performed": "signed in",
            "updated_object": {
                "id": 4,
                "email": "omitirand@gmail.com",
                "role": "super_admin",
                "disabled": false,
                "locked": false,
                "has_changed_password": true
            },
            "location": null,
            "remote_address": "127.0.0.1",
            "request_uuid": "9287a415-d26e-4e16-9b8e-98f7c28f0d1a",
            "created_at": "2019-08-09T16:11:29.623Z"
        },
        {
            "id": 10673,
            "auditable_id": 4,
            "auditable_type": "Admin",
            "user_type": null,
            "user": null,
            "action_performed": "signed in",
            "updated_object": {
                "id": 4,
                "email": "omitirand@gmail.com",
                "role": "super_admin",
                "disabled": false,
                "locked": false,
                "has_changed_password": true
            },
            "location": null,
            "remote_address": "127.0.0.1",
            "request_uuid": "1ae897e1-5cfd-42cb-b507-fb48b768fb7a",
            "created_at": "2019-08-09T15:15:41.748Z"
        },
        {
            "id": 10672,
            "auditable_id": 4,
            "auditable_type": "Admin",
            "user_type": null,
            "user": null,
            "action_performed": "signed in",
            "updated_object": {
                "id": 4,
                "email": "omitirand@gmail.com",
                "role": "super_admin",
                "disabled": false,
                "locked": false,
                "has_changed_password": true
            },
            "location": null,
            "remote_address": "127.0.0.1",
            "request_uuid": "729e32a8-611a-4f67-ab9c-b2817ff4c83b",
            "created_at": "2019-08-09T10:23:56.013Z"
        },
        {
            "id": 10671,
            "auditable_id": 4,
            "auditable_type": "Admin",
            "user_type": null,
            "user": null,
            "action_performed": "signed in",
            "updated_object": {
                "id": 4,
                "email": "omitirand@gmail.com",
                "role": "super_admin",
                "disabled": false,
                "locked": false,
                "has_changed_password": true
            },
            "location": null,
            "remote_address": "127.0.0.1",
            "request_uuid": "8f0196fa-169d-4d92-b2be-9cec0eabab19",
            "created_at": "2019-08-08T16:12:26.815Z"
        },
        {
            "id": 10670,
            "auditable_id": 4,
            "auditable_type": "Admin",
            "user_type": null,
            "user": null,
            "action_performed": "signed in",
            "updated_object": {
                "id": 4,
                "email": "omitirand@gmail.com",
                "role": "super_admin",
                "disabled": false,
                "locked": false,
                "has_changed_password": true
            },
            "location": null,
            "remote_address": "127.0.0.1",
            "request_uuid": "f31a8123-d97d-47b5-810d-558d6eff7e1d",
            "created_at": "2019-08-08T15:42:13.072Z"
        },
        {
            "id": 10669,
            "auditable_id": 195,
            "auditable_type": "User",
            "user_type": "User",
            "user": {
                "id": 195,
                "full_name": "Jamie Foxx",
                "email": "jamie_foxx@gmail.com"
            },
            "action_performed": "signed in",
            "updated_object": {
                "id": 195,
                "first_name": "Jamie",
                "last_name": "Foxx",
                "email": "jamie_foxx@gmail.com",
                "is_verified": false,
                "switch_id": 100295,
                "image_selfie_url": "+2348028643414_image_selfie_url_Batman-wallpaper-10943564.jpg",
                "disabled": false,
                "fraud_status": "whitelisted"
            },
            "location": null,
            "remote_address": "127.0.0.1",
            "request_uuid": "d1bb6ee5-4df2-4905-a7b7-e7496039328c",
            "created_at": "2019-08-08T15:34:07.604Z"
        },
        {
            "id": 10668,
            "auditable_id": 195,
            "auditable_type": "User",
            "user_type": "User",
            "user": {
                "id": 195,
                "full_name": "Jamie Foxx",
                "email": "jamie_foxx@gmail.com"
            },
            "action_performed": "unsuccessfully attempted to sign in",
            "updated_object": {
                "id": 195,
                "first_name": "Jamie",
                "last_name": "Foxx",
                "email": "jamie_foxx@gmail.com",
                "is_verified": false,
                "switch_id": 100295,
                "image_selfie_url": "+2348028643414_image_selfie_url_Batman-wallpaper-10943564.jpg",
                "disabled": false,
                "fraud_status": "whitelisted"
            },
            "location": null,
            "remote_address": "127.0.0.1",
            "request_uuid": "f4c37385-be4c-47fd-ac42-cef2c15bf334",
            "created_at": "2019-08-08T15:32:48.769Z"
        },
        {
            "id": 10667,
            "auditable_id": 195,
            "auditable_type": "User",
            "user_type": "User",
            "user": {
                "id": 195,
                "full_name": "Jamie Foxx",
                "email": "jamie_foxx@gmail.com"
            },
            "action_performed": "signed in",
            "updated_object": {
                "id": 195,
                "first_name": "Jamie",
                "last_name": "Foxx",
                "email": "jamie_foxx@gmail.com",
                "is_verified": false,
                "switch_id": 100295,
                "image_selfie_url": "+2348028643414_image_selfie_url_Batman-wallpaper-10943564.jpg",
                "disabled": false,
                "fraud_status": "whitelisted"
            },
            "location": null,
            "remote_address": "127.0.0.1",
            "request_uuid": "39fa7dda-8e3f-44e7-b378-4df1d99fa9be",
            "created_at": "2019-08-08T15:14:56.069Z"
        },
        {
            "id": 10665,
            "auditable_id": 195,
            "auditable_type": "User",
            "user_type": "User",
            "user": {
                "id": 195,
                "full_name": "Jamie Foxx",
                "email": "jamie_foxx@gmail.com"
            },
            "action_performed": "unsuccessfully attempted to sign in",
            "updated_object": {
                "id": 195,
                "first_name": "Jamie",
                "last_name": "Foxx",
                "email": "jamie_foxx@gmail.com",
                "is_verified": false,
                "switch_id": 100295,
                "image_selfie_url": "+2348028643414_image_selfie_url_Batman-wallpaper-10943564.jpg",
                "disabled": false,
                "fraud_status": "whitelisted"
            },
            "location": null,
            "remote_address": "127.0.0.1",
            "request_uuid": "b44af714-42be-4efa-b2e9-783ce854de94",
            "created_at": "2019-08-08T15:14:44.562Z"
        },
        {
            "id": 10664,
            "auditable_id": 195,
            "auditable_type": "User",
            "user_type": "User",
            "user": {
                "id": 195,
                "full_name": "Jamie Foxx",
                "email": "jamie_foxx@gmail.com"
            },
            "action_performed": "signed in",
            "updated_object": {
                "id": 195,
                "first_name": "Jamie",
                "last_name": "Foxx",
                "email": "jamie_foxx@gmail.com",
                "is_verified": false,
                "switch_id": 100295,
                "image_selfie_url": "+2348028643414_image_selfie_url_Batman-wallpaper-10943564.jpg",
                "disabled": false,
                "fraud_status": "whitelisted"
            },
            "location": null,
            "remote_address": "127.0.0.1",
            "request_uuid": "609878b3-d4fc-4c27-a5bc-372d0efa6294",
            "created_at": "2019-08-08T15:14:32.298Z"
        },
        {
            "id": 10663,
            "auditable_id": 195,
            "auditable_type": "User",
            "user_type": "User",
            "user": {
                "id": 195,
                "full_name": "Jamie Foxx",
                "email": "jamie_foxx@gmail.com"
            },
            "action_performed": "signed in",
            "updated_object": {
                "id": 195,
                "first_name": "Jamie",
                "last_name": "Foxx",
                "email": "jamie_foxx@gmail.com",
                "is_verified": false,
                "switch_id": 100295,
                "image_selfie_url": "+2348028643414_image_selfie_url_Batman-wallpaper-10943564.jpg",
                "disabled": false,
                "fraud_status": "whitelisted"
            },
            "location": null,
            "remote_address": "127.0.0.1",
            "request_uuid": "100a30c8-6834-453a-ab06-263165b043df",
            "created_at": "2019-08-08T15:11:43.501Z"
        },
        {
            "id": 10661,
            "auditable_id": 4,
            "auditable_type": "Admin",
            "user_type": null,
            "user": null,
            "action_performed": "signed in",
            "updated_object": {
                "id": 4,
                "email": "omitirand@gmail.com",
                "role": "super_admin",
                "disabled": false,
                "locked": false,
                "has_changed_password": true
            },
            "location": null,
            "remote_address": "127.0.0.1",
            "request_uuid": "fd5a83bf-1900-4f9c-b357-d75f13a383f5",
            "created_at": "2019-08-08T15:05:54.178Z"
        },
        {
            "id": 10660,
            "auditable_id": 195,
            "auditable_type": "User",
            "user_type": "User",
            "user": {
                "id": 195,
                "full_name": "Jamie Foxx",
                "email": "jamie_foxx@gmail.com"
            },
            "action_performed": "unsuccessfully attempted to sign in",
            "updated_object": {
                "id": 195,
                "first_name": "Jamie",
                "last_name": "Foxx",
                "email": "jamie_foxx@gmail.com",
                "is_verified": false,
                "switch_id": 100295,
                "image_selfie_url": "+2348028643414_image_selfie_url_Batman-wallpaper-10943564.jpg",
                "disabled": false,
                "fraud_status": "whitelisted"
            },
            "location": null,
            "remote_address": "127.0.0.1",
            "request_uuid": "aa03f181-b560-40de-b70c-0838cf749238",
            "created_at": "2019-08-08T14:56:31.413Z"
        },
        {
            "id": 10659,
            "auditable_id": 195,
            "auditable_type": "User",
            "user_type": null,
            "user": null,
            "action_performed": "unlocked account",
            "updated_object": {
                "id": 195,
                "first_name": "Jamie",
                "last_name": "Foxx",
                "email": "jamie_foxx@gmail.com",
                "is_verified": false,
                "switch_id": 100295,
                "image_selfie_url": "+2348028643414_image_selfie_url_Batman-wallpaper-10943564.jpg",
                "disabled": false,
                "fraud_status": "whitelisted"
            },
            "location": null,
            "remote_address": "127.0.0.1",
            "request_uuid": "6339c485-13ee-40af-bcb6-2bb18506dcb2",
            "created_at": "2019-08-08T14:52:59.279Z"
        }
    ],
    "meta": {
        "total": 1612,
        "per_page": 20,
        "page": 1,
        "page_count": 81
    }
}

Get Audit log

GET https://switch-api-staging.herokuapp.com/admin/audits/:log_id

Retrieves an audit log by id.

Path Parameters

Name
Type
Description

log_id

string

The id of the audit log

Headers

Name
Type
Description

SWI-CID

string

Client ID

auth_token

string

Format for auth_token is Bearer token_string

{
    "message": "Audit log retrieved successfully",
    "data": {
        "data": {
            "id": "10026",
            "type": "audit",
            "attributes": {
                "id": 10026,
                "auditable_id": 23,
                "auditable_type": "User",
                "user_type": "User",
                "user": {
                    "id": 23,
                    "full_name": "Opemipo Bolaji",
                    "email": "bolajipemipo@gmail.com"
                },
                "action": "update",
                "audited_changes": {
                    "last_sign_in_ip": [
                        "105.112.68.71",
                        "105.112.32.36"
                    ]
                },
                "remote_address": "105.112.32.36",
                "request_uuid": "543707c1-474f-4b9c-9a19-1cafb088f780",
                "created_at": "2019-05-16T17:54:21.179Z"
            }
        }
    }
}

Last updated

Was this helpful?