BREAGEN Logo
Audit Log API Service

Audit Log API Service

The Audit Log Service provides a comprehensive solution for tracking and recording user actions and system events across your applications. This service ensures transparency, accountability, and security by maintaining detailed logs that can be queried and analyzed. With a robust set of APIs, the Audit Log Service enables flexible querying and data retrieval based on client ID, tenant ID, action, service name, and unique identifiers. It supports comprehensive data management by allowing the retrieval of all audit logs for holistic system activity monitoring and the saving of new audit records in real-time. This service is essential for organizations seeking to enhance their security posture, comply with auditing standards, and gain valuable insights into user and system behavior.

Audit Log API Service - Get By Client Id GET /v1/api/audit/get_by_client_id

Resource URL/v1/api/audit/get_by_client_id
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Example Request

curl -X 'GET' \
'http://192.168.1.4:8000/v1/api/audit/get_by_client_id?client_id=054amk&page=1&limit=10' \
-H 'accept: application/json'

HTTP Responses

HTTP CodeMessage
200Success
403Authentication Required

Example Response

{
    "is_error": false,
    "message": "Get Audit by Client ID retrieved successfully",
    "total_records": 28,
    "page_number": 1,
    "page_size": 10,
    "total_pages": 3,
    "results": [
        {
        "date": "2024-06-07",
        "audit": [
            {
            "_id": "6662a86be2019feb851769e2",
            "client_id": "054amk",
            "tenant_id": "054amkT",
            "process_name": "Entity Search",
            "action": "Get",
            "message": "User analyst searched for entity SILVIA PATRICIA JIMENEZ CID with template 2",
            "metadata": {
                "search_model": {
                "template": "2",
                "entity_name": "SILVIA PATRICIA JIMENEZ CID",
                "entity_type": "person",
                "date": "",
                "jurisdiction": "",
                "min_threshold": 0,
                "max_threshold": 1,
                "watchlists": [
                    "pep-list-001-20240515"
                ],
                "user_name": "analyst"
                }
            },
            "service_name": "Screening API Service",
            "identifier": "6662a80be2019feb851769e0",
            "create_datetime": "2024-06-07T11:57:55.614000"
            },
            {
            "_id": "6662a99de2019feb851769e3",
            "client_id": "054amk",
            "tenant_id": "054amkT",
            "process_name": "Get Draft Data",
            "action": "Get",
            "message": "User analyst get draft data from 2024-04-03 to 2024-05-03",
            "metadata": {},
            "service_name": "Screening API Service",
            "identifier": "",
            "create_datetime": "2024-06-07T12:03:01.197000"
            }
        ]
        }
    ]
}

HTTP Responses

HTTP CodeMessage
200Succcess
204No Content
400Bad Request
401Unauthorized
403Invalid Input
404invalid or not founc type

Audit Log API Service - Get List POST /v1/api/audit/get_list

Resource URL/v1/api/audit/get_list
Response FormatJson
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Example Request

curl -X 'POST' \
'http://192.168.1.4:8000/v1/api/audit/get_list' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
    "filter_model": {
        "create_datetime": {
            "type": "date",
            "filters": [
                {
                    "operator": "between",
                    "values": ["2024-06-01", "2024-06-30"]
                }
            ]
        },
        "client_id": {
            "type": "text",
            "filters": [
                {
                    "operator": "contains",
                    "value": "054"
                }
            ]
        },
        "process_name": {
            "type": "text",
            "filters": [
                {
                    "operator": "contains",
                    "value": "Documents"
                }
            ]
        },
        "action": {
            "type": "text",
            "filters": [
                {
                    "operator": "contains",
                    "value": "Get"
                }
            ]
        }
    },
    "columns": [
        "client_id",
        "tenant_id",
        "process_name",
        "action",
        "message",
        "create_datetime"
    ],
    "order_model": {
        "create_datetime": "desc"
    },
    "pagination": {
        "page_size": 10,
        "page": 1
    },
    "group_by_date": false
}'

HTTP Responses

HTTP CodeMessage
200Success
403Authentication Required

Example Response

{
    "is_error": false,
    "message": "Get Audit List retrieved successfully",
    "total_records": 15,
    "page_number": 1,
    "page_size": 10,
    "total_pages": 2,
    "results": [
        {
            "date": "2024-06-07",
            "audit": [
                {
                    "_id": "6662a86be2019feb851769e2",
                    "client_id": "054amk",
                    "tenant_id": "054amkT",
                    "process_name": "Documents Processing",
                    "action": "Get",
                    "message": "Retrieved document list",
                    "metadata": {},
                    "service_name": "Document Service",
                    "identifier": "",
                    "create_datetime": "2024-06-07T11:57:55.614000"
                }
            ]
        }
    ]
}

HTTP Responses

HTTP CodeMessage
200Succcess
204No Content
400Bad Request
401Unauthorized
403Invalid Input
404invalid or not founc type

Audit Log API Service - Get By Tenant Id GET /v1/api/audit/get_by_tenant_id

Resource URL/v1/api/audit/get_by_tenant_id
Response FormatJson
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Example Request

curl -X 'GET' \
'http://192.168.1.4:8000/v1/api/audit/get_by_tenant_id?tenant_id=054amkT&client_id=054amk&page=1&limit=5' \
-H 'accept: application/json'

HTTP Responses

HTTP CodeMessage
200Success
403Authentication Required

Example Response

{
    "is_error": false,
    "message": "Get Audit by Tenant ID retrieved successfully",
    "total_records": 28,
    "page_number": 1,
    "page_size": 5,
    "total_pages": 6,
    "results": [
        {
        "date": "2024-06-07",
        "audit": [
            {
            "_id": "6662a86be2019feb851769e2",
            "client_id": "054amk",
            "tenant_id": "054amkT",
            "process_name": "Entity Search",
            "action": "Get",
            "message": "User analyst searched for entity SILVIA PATRICIA JIMENEZ CID with template 2",
            "metadata": {
                "search_model": {
                "template": "2",
                "entity_name": "SILVIA PATRICIA JIMENEZ CID",
                "entity_type": "person",
                "date": "",
                "jurisdiction": "",
                "min_threshold": 0,
                "max_threshold": 1,
                "watchlists": [
                    "pep-list-001-20240515"
                ],
                "user_name": "analyst"
                }
            },
            "service_name": "Screening API Service",
            "identifier": "6662a80be2019feb851769e0",
            "create_datetime": "2024-06-07T11:57:55.614000"
            },
            {
            "_id": "6662a99de2019feb851769e3",
            "client_id": "054amk",
            "tenant_id": "054amkT",
            "process_name": "Get Draft Data",
            "action": "Get",
            "message": "User analyst get draft data from 2024-04-03 to 2024-05-03",
            "metadata": {},
            "service_name": "Screening API Service",
            "identifier": "",
            "create_datetime": "2024-06-07T12:03:01.197000"
            }
        ]
        }
    ]
}

HTTP Responses

HTTP CodeMessage
200Succcess
204No Content
400Bad Request
401Unauthorized
403Invalid Input
404invalid or not founc type

Audit Log API Service - Get By Action GET /v1/api/audit/get_by_action

Resource URL/v1/api/audit/get_by_action
Response FormatJson
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Example Request

curl -X 'GET' \
'http://192.168.1.4:8000/v1/api/audit/get_by_action?action=Get&tenant_id=054amkT&client_id=054amk&page=1&limit=5' \
-H 'accept: application/json'

HTTP Responses

HTTP CodeMessage
200Success
403Authentication Required

HTTP Response

{
    "is_error": false,
    "message": "Get Audit by Action retrieved successfully",
    "total_records": 25,
    "page_number": 1,
    "page_size": 5,
    "total_pages": 5,
    "results": [
        {
        "date": "2024-06-07",
        "audit": [
            {
            "_id": "6662a86be2019feb851769e2",
            "client_id": "054amk",
            "tenant_id": "054amkT",
            "process_name": "Entity Search",
            "action": "Get",
            "message": "User analyst searched for entity SILVIA PATRICIA JIMENEZ CID with template 2",
            "metadata": {
                "search_model": {
                "template": "2",
                "entity_name": "SILVIA PATRICIA JIMENEZ CID",
                "entity_type": "person",
                "date": "",
                "jurisdiction": "",
                "min_threshold": 0,
                "max_threshold": 1,
                "watchlists": [
                    "pep-list-001-20240515"
                ],
                "user_name": "analyst"
                }
            },
            "service_name": "Screening API Service",
            "identifier": "6662a80be2019feb851769e0",
            "create_datetime": "2024-06-07T11:57:55.614000"
            },
            {
            "_id": "6662a99de2019feb851769e3",
            "client_id": "054amk",
            "tenant_id": "054amkT",
            "process_name": "Get Draft Data",
            "action": "Get",
            "message": "User analyst get draft data from 2024-04-03 to 2024-05-03",
            "metadata": {},
            "service_name": "Screening API Service",
            "identifier": "",
            "create_datetime": "2024-06-07T12:03:01.197000"
            }
        ]
        }
    ]
}

HTTP Responses

HTTP CodeMessage
200Succcess
204No Content
400Bad Request
401Unauthorized
403Invalid Input
404invalid or not founc type

Audit Log API Service - Get By Service Name GET /v1/api/audit/get_by_service_name

Resource URL/v1/api/audit/get_by_service_name
Response FormatJson
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Example Request

curl -X 'GET' \
'http://192.168.1.4:8000/v1/api/audit/get_by_service_name?service_name=Screening%20API%20Service&tenant_id=054amkT&client_id=054amk&page=1&limit=5' \
-H 'accept: application/json'

HTTP Responses

HTTP CodeMessage
200Success
403Authentication Required

Example Response

{
    "is_error": false,
    "message": "Get Audit by Service Name retrieved successfully",
    "total_records": 4,
    "page_number": 1,
    "page_size": 5,
    "total_pages": 1,
    "results": [
        {
        "date": "2024-06-07",
        "audit": [
            {
            "_id": "6662a86be2019feb851769e2",
            "client_id": "054amk",
            "tenant_id": "054amkT",
            "process_name": "Entity Search",
            "action": "Get",
            "message": "User analyst searched for entity SILVIA PATRICIA JIMENEZ CID with template 2",
            "metadata": {
                "search_model": {
                "template": "2",
                "entity_name": "SILVIA PATRICIA JIMENEZ CID",
                "entity_type": "person",
                "date": "",
                "jurisdiction": "",
                "min_threshold": 0,
                "max_threshold": 1,
                "watchlists": [
                    "pep-list-001-20240515"
                ],
                "user_name": "analyst"
                }
            },
            "service_name": "Screening API Service",
            "identifier": "6662a80be2019feb851769e0",
            "create_datetime": "2024-06-07T11:57:55.614000"
            },
            {
            "_id": "6662a99de2019feb851769e3",
            "client_id": "054amk",
            "tenant_id": "054amkT",
            "process_name": "Get Draft Data",
            "action": "Get",
            "message": "User analyst get draft data from 2024-04-03 to 2024-05-03",
            "metadata": {},
            "service_name": "Screening API Service",
            "identifier": "",
            "create_datetime": "2024-06-07T12:03:01.197000"
            }
        ]
        }
    ]
}

HTTP Responses

HTTP CodeMessage
200Succcess
204No Content
400Bad Request
401Unauthorized
403Invalid Input
404invalid or not founc type

Audit Log API Service - Get By Identifier GET /v1/api/audit/get_by_identifier

Resource URL/v1/api/audit/get_by_identifier
Response FormatJson
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Example Request

curl -X 'GET' \
'http://192.168.1.4:8000/v1/api/audit/get_by_identifier?identifier=6662a80be2019feb851769e0&tenant_id=054amkT&client_id=054amk' \
-H 'accept: application/json'

HTTP Responses

HTTP CodeMessage
200Success
403Authentication Required

Example Response

{
    "is_error": false,
    "message": "Get Audit by Identifier retrieved successfully",
    "results": [
        {
        "date": "2024-06-07",
        "audit": [
            {
            "_id": "6662a86be2019feb851769e2",
            "client_id": "054amk",
            "tenant_id": "054amkT",
            "process_name": "Entity Search",
            "action": "Get",
            "message": "User analyst searched for entity SILVIA PATRICIA JIMENEZ CID with template 2",
            "metadata": {
                "search_model": {
                "template": "2",
                "entity_name": "SILVIA PATRICIA JIMENEZ CID",
                "entity_type": "person",
                "date": "",
                "jurisdiction": "",
                "min_threshold": 0,
                "max_threshold": 1,
                "watchlists": [
                    "pep-list-001-20240515"
                ],
                "user_name": "analyst"
                }
            },
            "service_name": "Screening API Service",
            "identifier": "6662a80be2019feb851769e0",
            "create_datetime": "2024-06-07T11:57:55.614000"
            }
        ]
        }
    ]
}

HTTP Responses

HTTP CodeMessage
200Succcess
204No Content
400Bad Request
401Unauthorized
403Invalid Input
404invalid or not founc type

Audit Log API Service - Get All GET /v1/api/audit/get_all

Resource URL/v1/api/audit/get_all
Response FormatJson
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Example Request

curl -X 'GET' \
'http://192.168.1.4:8000/v1/api/audit/get_all?page=1&limit=10' \
-H 'accept: application/json'

HTTP Responses

HTTP CodeMessage
200Success
403Authentication Required

Example Response

{
    "is_error": false,
    "message": "Get All Audits retrieved successfully",
    "total_records": 29,
    "page_number": 1,
    "page_size": 10,
    "total_pages": 3,
    "results": [
        {
        "date": "2024-06-07",
        "audit": [
            {
            "_id": "6662a86be2019feb851769e2",
            "client_id": "054amk",
            "tenant_id": "054amkT",
            "process_name": "Entity Search",
            "action": "Get",
            "message": "User analyst searched for entity SILVIA PATRICIA JIMENEZ CID with template 2",
            "metadata": {
                "search_model": {
                "template": "2",
                "entity_name": "SILVIA PATRICIA JIMENEZ CID",
                "entity_type": "person",
                "date": "",
                "jurisdiction": "",
                "min_threshold": 0,
                "max_threshold": 1,
                "watchlists": [
                    "pep-list-001-20240515"
                ],
                "user_name": "Analyst"
                }
            },
            "service_name": "Screening API Service",
            "identifier": "6662a80be2019feb851769e0",
            "create_datetime": "2024-06-07T11:57:55.614000"
            },
            {
            "_id": "6662a99de2019feb851769e3",
            "client_id": "054amk",
            "tenant_id": "054amkT",
            "process_name": "Get Draft Data",
            "action": "Get",
            "message": "User analyst get draft data from 2024-04-03 to 2024-05-03",
            "metadata": {},
            "service_name": "Screening API Service",
            "identifier": "",
            "create_datetime": "2024-06-07T12:03:01.197000"
            },
            {
            "_id": "6662a9bde2019feb851769e4",
            "client_id": "054amk",
            "tenant_id": "054amkT",
            "process_name": "Get Recent Search Data",
            "action": "Get",
            "message": "User analyst get recent search data from 2024-04-03 to 2024-05-03",
            "metadata": {
                "start_date": "2024-04-03",
                "end_date": "2024-05-03",
                "page_no": 1,
                "page_size": 10,
                "query": ""
            },
            "service_name": "Screening API Service",
            "identifier": "",
            "create_datetime": "2024-06-07T12:03:33.069000"
            }
        ]
        }
    ]
}

HTTP Responses

HTTP CodeMessage
200Succcess
204No Content
400Bad Request
401Unauthorized
403Invalid Input
404invalid or not founc type

Audit Log API Service - Save Audit POST /v1/api/audit/save

Resource URL/v1/api/audit/save
Response FormatJson
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Parameters

client_idString client id
tenant_idString tenant id
process_nameString process name
actionString action
messageString message
metadataString metadata
service_nameString service name
identifierString identifier

Example Request

curl -X 'POST' \
'http://192.168.1.4:8000/v1/api/audit/save' \
-H 'accept: application/json' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'client_id=054amk&tenant_id=054amkT&process_name=Entity%20Search&action=Get&message=User%20Anuka%20Mithara%20searched%20for%20entity%20SILVIA%20PATRICIA%20JIMENEZ%20CID%20with%20template%201&metadata=%7B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22search_model%22%3A%20%7B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22template%22%3A%20%222%22%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22entity_name%22%3A%20%22SILVIA%20PATRICIA%20JIMENEZ%20CID%22%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22entity_type%22%3A%20%22person%22%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22date%22%3A%20%22%22%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22jurisdiction%22%3A%20%22%22%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22min_threshold%22%3A%200%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22max_threshold%22%3A%201%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22watchlists%22%3A%20%5B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22pep-list-001-20240515%22%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5D%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22user_name%22%3A%20%22Anuka%22%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D&service_name=Screening%20API%20Service&identifier=6662a80be2019feb851769e0'

HTTP Responses

HTTP CodeMessage
200Success
403Authentication Required

Example Response

{
    "is_error": false,
    "message": "Audit created successfully",
    "results": {
        "_id": "66630520774677e60734d844",
        "client_id": "054amk",
        "tenant_id": "054amkT",
        "process_name": "Entity Search",
        "action": "Get",
        "message": "User analyst searched for entity SILVIA PATRICIA JIMENEZ CID with template 1",
        "metadata": {
        "search_model": {
            "template": "2",
            "entity_name": "SILVIA PATRICIA JIMENEZ CID",
            "entity_type": "person",
            "date": "",
            "jurisdiction": "",
            "min_threshold": 0,
            "max_threshold": 1,
            "watchlists": [
            "pep-list-001-20240515"
            ],
            "user_name": "Analyst"
        }
        },
        "service_name": "Screening API Service",
        "identifier": "6662a80be2019feb851769e0",
        "create_datetime": "2024-06-07T18:33:28.383000"
    }
}

HTTP Responses

HTTP CodeMessage
200Succcess
204No Content
400Bad Request
401Unauthorized
403Invalid Input
404invalid or not founc type