> For the complete documentation index, see [llms.txt](https://run-ai-docs.nvidia.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://run-ai-docs.nvidia.com/api/2.23/audit/audit-logs.md).

# Audit Logs

The audit log provides audit trail information for user activity, changes to business objects and other important information. For more information, see [Audit log](https://run-ai-docs.nvidia.com/self-hosted/2.23/infrastructure-setup/procedures/event-history).

## Get audit logs

> Get audit logs based on query params filter

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.23"},"tags":[{"name":"AuditLogs","description":"The audit log provides audit trail information for user activity, changes to business objects and other important information. For more information, see [Audit log](https://run-ai-docs.nvidia.com/self-hosted/2.23/infrastructure-setup/procedures/event-history)."}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"StartRequired":{"name":"start","in":"query","description":"Start date of time range to fetch data in ISO 8601 timestamp format.","required":true,"schema":{"type":"string","format":"date-time"}},"EndRequired":{"name":"end","in":"query","description":"End date of time range to fetch data in ISO 8601 timestamp format.","required":true,"schema":{"type":"string","format":"date-time"}},"Offset":{"name":"offset","in":"query","required":false,"description":"The offset of the first item returned in the collection.","schema":{"type":"integer","format":"int32"}},"NumberOfSamples":{"name":"numberOfSamples","in":"query","description":"The number of samples to take in the specified time range.","required":false,"schema":{"type":"integer","maximum":1000,"minimum":0,"default":20}},"SortOrder":{"name":"sortOrder","in":"query","required":false,"description":"Sort results in descending or ascending order.","schema":{"type":"string","enum":["asc","desc"],"default":"asc"}},"AuditLogSort":{"name":"sortBy","in":"query","required":false,"description":"Sort results by a parameters.","schema":{"type":"string","enum":["timestamp","subject","subject_type","source_ip","action","http_method","result","url","entity_type","entity_name","entity_id"]}},"AuditLogFilter":{"name":"filterBy","in":"query","required":false,"explode":false,"description":"Filter results by a parameter. Use the format field-name operator value. Operators are == Equals, != Not equals, <= Less than or equal, >= Greater than or equal, =@ contains, !@ Does not contains, =^ Starts with and =$ Ends with. Dates are in ISO 8601 timestamp format and available for operators ==, !=, <= and >=.","schema":{"type":"array","items":{"type":"string","pattern":"^(timestamp|subject|subject_type|source_ip|action|result|url|entity_type|entity_name|cluster_name)(==|!=|<=|>=|=@|!@|=\\^|=\\$).+$"}}}},"schemas":{"AuditLogs":{"type":"array","items":{"$ref":"#/components/schemas/AuditLog"}},"AuditLog":{"type":"object","required":["tenant_id","subject","subject_type","action","result"],"properties":{"id":{"type":"string","format":"uuid"},"timestamp":{"type":"string","format":"date-time"},"tenant_id":{"type":"string","description":"the ID of the tenant"},"subject":{"type":"string","description":"the user/app which triggered this API"},"subject_type":{"type":"string","enum":["User","App"],"default":"User"},"source_ip":{"type":"string","format":"ipv4"},"action":{"type":"string","enum":["create","update","delete","sign-in","sign-out","reset-password"]},"http_method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE","CREATE"]},"url":{"type":"string","format":"uri"},"entity_type":{"type":"string"},"entity_name":{"type":"string"},"entity_id":{"type":"string"},"result":{"type":"string","enum":["Succeeded","Failed"]},"http_status_code":{"type":"integer"},"cluster_name":{"type":"string"},"cluster_id":{"type":"string","format":"uuid"},"request_id":{"type":"string","format":"uuid"},"metadata":{"type":"object","maxProperties":10,"additionalProperties":{"type":"string"}}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/audit/log":{"get":{"description":"Get audit logs based on query params filter","summary":"Get audit logs","operationId":"getAuditLogs","tags":["AuditLogs"],"parameters":[{"$ref":"#/components/parameters/StartRequired"},{"$ref":"#/components/parameters/EndRequired"},{"$ref":"#/components/parameters/Offset"},{"$ref":"#/components/parameters/NumberOfSamples"},{"$ref":"#/components/parameters/SortOrder"},{"$ref":"#/components/parameters/AuditLogSort"},{"$ref":"#/components/parameters/AuditLogFilter"}],"responses":{"200":{"description":"Executed successfully","content":{"application/json":{"schema":{"type":"object","required":["logs"],"properties":{"total":{"type":"integer"},"next":{"type":"integer"},"audit_logs":{"$ref":"#/components/schemas/AuditLogs"}}}}}},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## Download audit logs

> Download audit logs as a file, based on query params filter

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.23"},"tags":[{"name":"AuditLogs","description":"The audit log provides audit trail information for user activity, changes to business objects and other important information. For more information, see [Audit log](https://run-ai-docs.nvidia.com/self-hosted/2.23/infrastructure-setup/procedures/event-history)."}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"StartRequired":{"name":"start","in":"query","description":"Start date of time range to fetch data in ISO 8601 timestamp format.","required":true,"schema":{"type":"string","format":"date-time"}},"EndRequired":{"name":"end","in":"query","description":"End date of time range to fetch data in ISO 8601 timestamp format.","required":true,"schema":{"type":"string","format":"date-time"}},"NumberOfSamples":{"name":"numberOfSamples","in":"query","description":"The number of samples to take in the specified time range.","required":false,"schema":{"type":"integer","maximum":1000,"minimum":0,"default":20}},"AuditLogFilter":{"name":"filterBy","in":"query","required":false,"explode":false,"description":"Filter results by a parameter. Use the format field-name operator value. Operators are == Equals, != Not equals, <= Less than or equal, >= Greater than or equal, =@ contains, !@ Does not contains, =^ Starts with and =$ Ends with. Dates are in ISO 8601 timestamp format and available for operators ==, !=, <= and >=.","schema":{"type":"array","items":{"type":"string","pattern":"^(timestamp|subject|subject_type|source_ip|action|result|url|entity_type|entity_name|cluster_name)(==|!=|<=|>=|=@|!@|=\\^|=\\$).+$"}}}},"responses":{"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}}},"paths":{"/api/v1/audit/log/file":{"get":{"description":"Download audit logs as a file, based on query params filter","summary":"Download audit logs","operationId":"downloadAuditLogs","tags":["AuditLogs"],"parameters":[{"in":"query","name":"file_type","schema":{"type":"string","enum":["CSV","JSON"],"default":"CSV"},"required":false},{"$ref":"#/components/parameters/StartRequired"},{"$ref":"#/components/parameters/EndRequired"},{"$ref":"#/components/parameters/NumberOfSamples"},{"$ref":"#/components/parameters/AuditLogFilter"}],"responses":{"200":{"description":"File downloaded","content":{"application/octet-stream":{}}},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://run-ai-docs.nvidia.com/api/2.23/audit/audit-logs.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
