Batch Events

Create multiple audit events in a single API request for improved performance and reduced overhead.

POST /events/batch
Required Scope
This endpoint requires the events:write scope.

Request Body

Parameter Type Required Description
events array Yes Array of event objects (max 100 events per request)

Each event object in the array follows the same structure as the Create Event endpoint.

Batch Limit
You can send up to 100 events in a single batch request. For larger volumes, split into multiple batches.

Response

Returns an array of created events with a 201 status code.

{
  "data": [
    {
      "id": "evt_2Nz9Q8kL3Fy",
      "sequence_number": 42315,
      "action": "user.login",
      "actor": {
        "id": "usr_4Hx8K9mP1Qz",
        "type": "user",
        "meta": {
          "name": "Jane Doe",
          "email": "jane@example.com"
        }
      },
      "target": null,
      "context": {
        "ip": "203.0.113.42"
      },
      "diff": null,
      "metadata": {},
      "hash": "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9",
      "previous_hash": "a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456",
      "occurred_at": "2026-02-10T14:32:15.000000Z",
      "received_at": "2026-02-10T14:32:15.123456Z",
      "created_at": "2026-02-10T14:32:15.123456Z"
    },
    {
      "id": "evt_3Pz8R7jK2Dx",
      "sequence_number": 42316,
      "action": "document.created",
      "actor": {
        "id": "usr_4Hx8K9mP1Qz",
        "type": "user",
        "meta": {
          "name": "Jane Doe",
          "email": "jane@example.com"
        }
      },
      "target": {
        "type": "document",
        "id": "doc_6Ry2M3nT5Wx",
        "meta": {
          "title": "Q4 Financial Report"
        }
      },
      "context": {
        "ip": "203.0.113.42"
      },
      "diff": null,
      "metadata": {
        "department": "finance"
      },
      "hash": "c84f28c0123d4f09b63f63e8db8ebcfbd595fge48b6491ff0099g8bdf3fgdef0",
      "previous_hash": "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9",
      "occurred_at": "2026-02-10T14:32:16.000000Z",
      "received_at": "2026-02-10T14:32:16.234567Z",
      "created_at": "2026-02-10T14:32:16.234567Z"
    }
  ]
}

Examples

curl -X POST https://logproof.de/v1/events/batch \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "events": [
      {
        "action": "user.login",
        "actor": {
          "id": "usr_4Hx8K9mP1Qz",
          "type": "user",
          "meta": {
            "name": "Jane Doe",
            "email": "jane@example.com"
          }
        },
        "context": {
          "ip": "203.0.113.42"
        },
        "occurred_at": "2026-02-10T14:32:15Z"
      },
      {
        "action": "document.created",
        "actor": {
          "id": "usr_4Hx8K9mP1Qz",
          "type": "user",
          "meta": {
            "name": "Jane Doe",
            "email": "jane@example.com"
          }
        },
        "target": {
          "type": "document",
          "id": "doc_6Ry2M3nT5Wx",
          "meta": {
            "title": "Q4 Financial Report"
          }
        },
        "context": {
          "ip": "203.0.113.42"
        },
        "metadata": {
          "department": "finance"
        },
        "occurred_at": "2026-02-10T14:32:16Z"
      }
    ]
  }'
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://logproof.de/v1/',
    'headers' => [
        'Authorization' => 'Bearer YOUR_API_KEY',
        'Content-Type' => 'application/json',
    ]
]);

$response = $client->post('events/batch', [
    'json' => [
        'events' => [
            [
                'action' => 'user.login',
                'actor' => [
                    'id' => 'usr_4Hx8K9mP1Qz',
                    'type' => 'user',
                    'meta' => [
                        'name' => 'Jane Doe',
                        'email' => 'jane@example.com',
                    ]
                ],
                'context' => [
                    'ip' => '203.0.113.42',
                ],
                'occurred_at' => '2026-02-10T14:32:15Z',
            ],
            [
                'action' => 'document.created',
                'actor' => [
                    'id' => 'usr_4Hx8K9mP1Qz',
                    'type' => 'user',
                    'meta' => [
                        'name' => 'Jane Doe',
                        'email' => 'jane@example.com',
                    ]
                ],
                'target' => [
                    'type' => 'document',
                    'id' => 'doc_6Ry2M3nT5Wx',
                    'meta' => [
                        'title' => 'Q4 Financial Report',
                    ]
                ],
                'context' => [
                    'ip' => '203.0.113.42',
                ],
                'metadata' => [
                    'department' => 'finance',
                ],
                'occurred_at' => '2026-02-10T14:32:16Z',
            ]
        ]
    ]
]);

$events = json_decode($response->getBody(), true);
const axios = require('axios');

const response = await axios.post('https://logproof.de/v1/events/batch', {
  events: [
    {
      action: 'user.login',
      actor: {
        id: 'usr_4Hx8K9mP1Qz',
        type: 'user',
        meta: {
          name: 'Jane Doe',
          email: 'jane@example.com'
        }
      },
      context: {
        ip: '203.0.113.42'
      },
      occurred_at: '2026-02-10T14:32:15Z'
    },
    {
      action: 'document.created',
      actor: {
        id: 'usr_4Hx8K9mP1Qz',
        type: 'user',
        meta: {
          name: 'Jane Doe',
          email: 'jane@example.com'
        }
      },
      target: {
        type: 'document',
        id: 'doc_6Ry2M3nT5Wx',
        meta: {
          title: 'Q4 Financial Report'
        }
      },
      context: {
        ip: '203.0.113.42'
      },
      metadata: {
        department: 'finance'
      },
      occurred_at: '2026-02-10T14:32:16Z'
    }
  ]
}, {
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
});

const events = response.data;
import requests

response = requests.post(
    'https://logproof.de/v1/events/batch',
    headers={
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json'
    },
    json={
        'events': [
            {
                'action': 'user.login',
                'actor': {
                    'id': 'usr_4Hx8K9mP1Qz',
                    'type': 'user',
                    'meta': {
                        'name': 'Jane Doe',
                        'email': 'jane@example.com'
                    }
                },
                'context': {
                    'ip': '203.0.113.42'
                },
                'occurred_at': '2026-02-10T14:32:15Z'
            },
            {
                'action': 'document.created',
                'actor': {
                    'id': 'usr_4Hx8K9mP1Qz',
                    'type': 'user',
                    'meta': {
                        'name': 'Jane Doe',
                        'email': 'jane@example.com'
                    }
                },
                'target': {
                    'type': 'document',
                    'id': 'doc_6Ry2M3nT5Wx',
                    'meta': {
                        'title': 'Q4 Financial Report'
                    }
                },
                'context': {
                    'ip': '203.0.113.42'
                },
                'metadata': {
                    'department': 'finance'
                },
                'occurred_at': '2026-02-10T14:32:16Z'
            }
        ]
    }
)

events = response.json()