> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/recovery/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/recovery/_mcp/server.

# Ingest audit events

POST /v1/audit/events
Content-Type: application/json

Submit a batch of producer audit events to Audit Trail. A successful response reports full or partial acceptance, not durable persistence. Do not retry partially accepted batches; retry an overloaded request using the same idempotency keys.

Reference: https://docs.nvidia.com/recovery/gateway-reference/audit-service/createauditevents

## Request

### Body (application/json)

This endpoint expects a v1CreateAuditEventsRequest.

- `items` (list of v1ProducerAuditEvent, optional) — Events in this ingestion batch.

## Response

### 200

A successful response.

- `partialSuccess` (v1AuditEventPartialSuccess, optional) — AuditEventPartialSuccess describes events rejected from an otherwise accepted batch.

## Types

### v1ProducerAuditEvent

ProducerAuditEvent is one structured event emitted by an NVIDIA Recovery component.

- `heimdallJobId` (string, optional) — NVIDIA Recovery's internal identifier for the job.
- `eventProducer` (string, optional) — Component that produced the event.
- `eventType` (string, optional) — Stable event-type identifier.
- `eventLevel` (string, optional) — Stable audit event-level identifier.
- `payload` (V1ProducerAuditEventPayload, optional) — Event-specific structured data.
- `eventProducedAt` (string, optional) — Producer emission time as Unix microseconds.
- `idempotencyKey` (string, optional) — Producer-computed key used to discard duplicate events.

### v1AuditEventPartialSuccess

AuditEventPartialSuccess describes events rejected from an otherwise accepted batch.

- `rejectedEvents` (integer, optional) — Number of rejected events.
- `errorMessage` (string, optional) — Human-readable explanation of why events were rejected.

### V1ProducerAuditEventPayload

Event-specific structured data.

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "partialSuccess": {
    "rejectedEvents": 1,
    "errorMessage": "string"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.example.com/v1/audit/events"

payload = {}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.example.com/v1/audit/events';
const options = {method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{}'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/v1/audit/events"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/audit/events")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.example.com/v1/audit/events")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.example.com/v1/audit/events', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.example.com/v1/audit/events");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/audit/events")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```