> This is a page from the ElevenLabs documentation. For a complete page index, fetch https://elevenlabs.io/docs/llms.txt. For the full documentation in a single file, fetch https://elevenlabs.io/docs/llms-full.txt.

# Workspace-Audit-Logs abrufen

GET https://api.elevenlabs.io/v1/workspace/audit-logs

Gibt das Audit-Protokoll für den Workspace zurück. Erfordert den Enterprise-Tarif und die Berechtigung audit_log_read.

Reference: https://elevenlabs.io/docs/api-reference/workspace/audit-logs/list

## Servers

- `https://api.elevenlabs.io` (Production, default)
- `https://api.us.elevenlabs.io` (Production US)
- `https://api.eu.residency.elevenlabs.io` (Production EU)
- `https://api.in.residency.elevenlabs.io` (Production India)
- `https://api.sg.residency.elevenlabs.io` (Production Singapore)

## Request

### Query parameters

- `limit` (integer, optional, default: 50) — Maximale Anzahl Einträge pro Seite
- `cursor` (string, optional, nullable) — Cursor für die nächste Seite (aus vorheriger Antwort)
- `time_from_unix_ms` (integer, optional, nullable) — Nur Einträge ab diesem Zeitpunkt einschließen (ms seit Epoch)
- `time_to_unix_ms` (integer, optional, nullable) — Nur Einträge bis zu diesem Zeitpunkt einschließen (ms seit Epoch)
- `actor_uid` (string, optional, nullable) — Nach Benutzer-ID des Akteurs filtern
- `class_name` (string, optional, nullable) — Nach OCSF-Ereignisklassenname filtern (z. B. Account Change)
- `activity_name` (string, optional, nullable) — Nach Name der Audit-Aktivität filtern (z. B. Subscription Creation)

## Response

### 200

Erfolgreiche Antwort

- `entries` (list of WorkspaceAuditLogEntryResponse, required)
- `has_more` (boolean, required)
- `next_cursor` (string, required, nullable)

## Errors

### 422 Unprocessable Entity Error

Validierungsfehler

- `detail` (list of ValidationError, optional)

## Types

### WorkspaceAuditLogEntryResponse

Audit-Log-Eintrag mit Firestore-Dokument-ID für API-Antworten.

- `activity_id` (WorkspaceAuditLogEntryResponseActivityId, required) — Aktivitäts-ID
- `activity_name` (string, required) — Aktivitätsname
- `status_id` (enum, required) — Status der Aktion
  - Allowed values: `0`, `1`, `2`, `99`
- `actor` (ActorModel, required) — Akteur, der die Aktion ausführt
- `message` (string, required) — Menschenlesbare Ereignisbeschreibung
- `id` (string, required) — Firestore-Dokument-ID
- `time_dt` (string, required) — Ereigniszeit im menschenlesbaren RFC-3339-Format, abgeleitet aus 'time'.
- `type_uid` (integer, required) — OCSF type_uid ist class_uid * 100 + activity_id.
- `type_name` (string, required) — OCSF type_name kombiniert class_name und activity_name.
- `metadata` (map from string to any, optional) — Ereignismetadaten
- `time` (integer, optional) — Ereigniszeit in Millisekunden seit der Epoche
- `category_name` (string, optional, default: Identity & Access Management) — Ereigniskategorie
- `category_uid` (integer, optional, default: 3) — Kategorie-UID für IAM
- `class_name` (string, optional, default: ) — Name der Ereignisklasse
- `class_uid` (integer, optional, default: 0) — UID der Ereignisklasse
- `severity_id` (enum, optional) — Schweregrad
  - Allowed values: `0`, `1`, `2`, `3`, `4`, `5`, `6`, `99`
- `device` (DeviceModel, optional, nullable) — Geräteinformationen
- `http_request` (HttpRequestModel, optional, nullable) — Details zur HTTP-Anfrage
- `unmapped` (map from string to any, optional) — Nicht OCSF zugeordnete Attribute

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### WorkspaceAuditLogEntryResponseActivityId

Aktivitäts-ID

### ActorModel

OCSF-Actor-Objekt – beschreibt die Entität, die die Aktion ausgeführt hat. Spezifikation: https://schema.ocsf.io/1.6.0/objects/actor

- `user` (UserModel, required) — Nutzer, der die Aktion ausgeführt hat
- `app_name` (string, optional, nullable) — Name der Client-Anwendung oder des Dienstes
- `app_uid` (string, optional, nullable) — Eindeutiger Identifier der Client-Anwendung
- `session` (map from string to any, optional, nullable) — Sitzungsinformationen

### DeviceModel

Geräteinformationen. Spezifikation: https://schema.ocsf.io/1.6.0/objects/device

- `ip` (string, optional, nullable) — IP-Adresse
- `hostname` (string, optional, nullable) — Hostname des Geräts
- `type_id` (integer, optional, default: 99) — Gerätetyp-ID (99 = Unbekannt)

### HttpRequestModel

Details zur HTTP-Anfrage. Spezifikation: https://schema.ocsf.io/1.6.0/objects/http_request

- `http_method` (string, required) — HTTP-Methode (GET, POST usw.)
- `url` (UrlModel, required) — Anfrage-URL-Objekt
- `user_agent` (string, optional, nullable) — User-Agent-Zeichenfolge
- `x_forwarded_for` (list of string, optional, nullable) — X-Forwarded-For-Header als Liste

### ValidationErrorLocItems

### UserModel

OCSF-User-Objekt. Spezifikation: https://schema.ocsf.io/1.6.0/objects/user

- `name` (string, optional, nullable) — Username
- `uid` (string, optional, nullable) — Eindeutige Nutzerkennung
- `type_id` (enum, optional) — Kennung des Kontotyps
  - Allowed values: `0`, `1`, `2`, `3`, `4`, `99`
- `type` (string, optional, nullable) — Beschreibung des Kontotyps
- `email_addr` (string, optional, nullable) — E-Mail-Adresse des Nutzers
- `full_name` (string, optional, nullable) — Vollständiger Name des Nutzers
- `domain` (string, optional, nullable) — Domain des Nutzers

### UrlModel

OCSF-URL-Objekt. Spezifikation: https://schema.ocsf.io/1.6.0/objects/url

- `url_string` (string, optional, nullable) — Vollständige URL-Zeichenfolge
- `scheme` (string, optional, nullable) — URL-Schema (z. B. https)
- `hostname` (string, optional, nullable) — URL-Hostname
- `port` (integer, optional, nullable) — URL-Port
- `path` (string, optional, nullable) — URL-Pfad
- `query_string` (string, optional, nullable) — URL-Abfragezeichenfolge

## Examples

**Response**

```json
{
  "entries": [
    {
      "activity_id": 0,
      "activity_name": "string",
      "status_id": 0,
      "actor": {
        "user": {
          "name": "string",
          "uid": "string",
          "type_id": 0,
          "type": "string",
          "email_addr": "string",
          "full_name": "string",
          "domain": "string"
        },
        "app_name": "string",
        "app_uid": "string",
        "session": {}
      },
      "message": "string",
      "id": "string",
      "time_dt": "string",
      "type_uid": 1,
      "type_name": "string",
      "metadata": {},
      "time": 1,
      "category_name": "Identity & Access Management",
      "category_uid": 3,
      "class_name": "",
      "class_uid": 0,
      "severity_id": 0,
      "device": {
        "ip": "string",
        "hostname": "string",
        "type_id": 99
      },
      "http_request": {
        "http_method": "string",
        "url": {
          "url_string": "string",
          "scheme": "string",
          "hostname": "string",
          "port": 1,
          "path": "string",
          "query_string": "string"
        },
        "user_agent": "string",
        "x_forwarded_for": [
          "string"
        ]
      },
      "unmapped": {}
    }
  ],
  "has_more": true,
  "next_cursor": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.elevenlabs.io/v1/workspace/audit-logs"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://api.elevenlabs.io/v1/workspace/audit-logs';
const options = {method: 'GET'};

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"
	"net/http"
	"io"
)

func main() {

	url := "https://api.elevenlabs.io/v1/workspace/audit-logs"

	req, _ := http.NewRequest("GET", url, nil)

	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.elevenlabs.io/v1/workspace/audit-logs")

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

request = Net::HTTP::Get.new(url)

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.get("https://api.elevenlabs.io/v1/workspace/audit-logs")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.elevenlabs.io/v1/workspace/audit-logs');

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

```csharp
using RestSharp;

var client = new RestClient("https://api.elevenlabs.io/v1/workspace/audit-logs");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.elevenlabs.io/v1/workspace/audit-logs")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

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()
```