Domain name for API request: mongodb.intl.tencentcloudapi.com.
This API is used to query database audit logs.
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| Action | Yes | String | Common Params. The value used for this API: DescribeAuditLogs. |
| Version | Yes | String | Common Params. The value used for this API: 2019-07-25. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
| InstanceId | Yes | String | Instance ID, in the format of cmgo-xftsghuy. It is the same as the instance ID displayed on the TencentDB console page. |
| StartTime | Yes | String | Start time, format: "2017-07-12 10:29:20". |
| EndTime | Yes | String | End time, format: "2017-07-12 10:29:20". |
| Filter | No | AuditLogFilter | Filter conditions. You can filter logs based on these conditions. |
| Limit | No | Integer | Pagination parameter indicates the number of returned data entries. Default value is 100. Maximum value is 100. |
| Offset | No | Integer | Pagination offset. |
| Order | No | String | Sorting method of the audit log.
|
| OrderBy | No | String | Sorting field of the audit log, including:
|
| Parameter Name | Type | Description |
|---|---|---|
| TotalCount | Integer | Number of eligible audit log entries. |
| Items | Array of AuditLog | Audit log details. Note: This field may return null, indicating that no valid values can be obtained. |
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
POST / HTTP/1.1
Host: mongodb.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeAuditLogs
<Common request parameters>
{
"InstanceId": "cmgo-f0vo457l",
"StartTime": "2022-09-28 14:25:38",
"EndTime": "2026-09-28 15:25:38",
"Filter": {
"Atype": [
"insert"
],
"Result": [
"0"
],
"Param": [
"insert"
]
}
}
{
"Response": {
"Items": [
{
"AffectRows": 2,
"Atype": "insert",
"ExecTime": 0,
"Host": "10.0.xx.xx",
"Param": "{ ns: dbinsert_2.collinsert_1, cmd: { _id: ObjectId('1'), df: [ \"sw\", \"re\" ], likes: 100, title: 3 } }",
"Result": 0,
"Roles": "xxx@admin",
"Timestamp": "2026-01-27 10:54:17",
"User": "mongouser@xxx"
}
],
"TotalCount": 2,
"RequestId": "184c371f-8635-4af9-881b-d0f29856c0f7"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Error Code | Description |
|---|---|
| InternalError.AuditCreateLogFileError | Error creating an audit log file. |
| InternalError.AuditDeleteLogFileError | Error deleting the audit log. |
| InternalError.AuditDescribeLogError | Error querying the audit log. |
| InternalError.AuditError | Internal audit service error. |
| InternalError.AuditModifyStatusError | Failed to modify audit status. |
| InternalError.CheckAppIdFailed | appId verification failed. |
| InternalError.DBError | Database exception. |
| InternalError.DBOperationError | Database operation failed. |
| InternalError.DatabaseAccessError | Database internal error. |
| InternalError.InnerCommonError | Internal service error. |
| InternalError.JSONError | json parsing failure. |
| InternalError.JsonUnmarshalError | Json deserialization error. |
| InternalError.TradeError | Transaction system error. |
| InvalidParameter.InvalidParameterError | Parameter is invalid. |
| InvalidParameterValue.DataConvertError | Data conversion failed |
| OperationDenied.AuditPolicyConflictError | Audit policy conflict. |
| OperationDenied.AuditPolicyExistError | Audit policy already exists. |
| OperationDenied.AuditPolicyNotExistError | Audit policy not found. |
| OperationDenied.AuditPolicyOverQuotaError | Number of audit policies exceeds the limit. |
| OperationDenied.AuditStatusError | The audit status is abnormal. |
| OperationDenied.AuditTaskConflictError | Audit task conflict. |
| OperationDenied.ResourceNotFundError | Resource is not found. |
| OperationDenied.UnsupportOpenAuditError | Audit activation is not supported. |
피드백