> 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.

# Auditlogs van workspace ophalen

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

Retourneert het auditlog voor de workspace. Vereist het Enterprise-niveau en de machtiging 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) — Maximumaantal vermeldingen per pagina
- `cursor` (string, optional, nullable) — Cursor voor de volgende pagina (uit het vorige antwoord)
- `time_from_unix_ms` (integer, optional, nullable) — Neem alleen items op vanaf dit tijdstip (ms sinds epoch)
- `time_to_unix_ms` (integer, optional, nullable) — Neem alleen items op tot en met dit tijdstip (ms sinds epoch)
- `actor_uid` (string, optional, nullable) — Filter op gebruikers-ID van de actor
- `class_name` (string, optional, nullable) — Filter op OCSF-eventklassenaam (bijv. Account Change)
- `activity_name` (string, optional, nullable) — Filter op naam van auditactiviteit (bijv. Subscription Creation)

## Response

### 200

Geslaagde response

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

## Errors

### 422 Unprocessable Entity Error

Validatiefout

- `detail` (list of ValidationError, optional)

## Types

### WorkspaceAuditLogEntryResponse

Auditlogvermelding met Firestore-document-ID voor API-responses.

- `activity_id` (WorkspaceAuditLogEntryResponseActivityId, required) — Activiteits-ID
- `activity_name` (string, required) — Activiteitsnaam
- `status_id` (enum, required) — Status van de actie
  - Allowed values: `0`, `1`, `2`, `99`
- `actor` (ActorModel, required) — Actor die de actie uitvoert
- `message` (string, required) — Voor mensen leesbare gebeurtenisbeschrijving
- `id` (string, required) — Firestore-document-ID
- `time_dt` (string, required) — Eventtijd in leesbare RFC 3339-indeling, afgeleid van 'time'.
- `type_uid` (integer, required) — OCSF type_uid is class_uid * 100 + activity_id.
- `type_name` (string, required) — OCSF type_name combineert class_name en activity_name.
- `metadata` (map from string to any, optional) — Metagegevens van het event
- `time` (integer, optional) — Eventtijd in milliseconden sinds epoch
- `category_name` (string, optional, default: Identity & Access Management) — Eventcategorie
- `category_uid` (integer, optional, default: 3) — Categorie-UID voor IAM
- `class_name` (string, optional, default: ) — Naam van de eventklasse
- `class_uid` (integer, optional, default: 0) — UID van de eventklasse
- `severity_id` (enum, optional) — Ernstniveau
  - Allowed values: `0`, `1`, `2`, `3`, `4`, `5`, `6`, `99`
- `device` (DeviceModel, optional, nullable) — Apparaatgegevens
- `http_request` (HttpRequestModel, optional, nullable) — Details van het HTTP-request
- `unmapped` (map from string to any, optional) — Attributen die niet aan OCSF zijn gekoppeld

### ValidationError

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

### WorkspaceAuditLogEntryResponseActivityId

Activiteits-ID

### ActorModel

OCSF Actor-object - beschrijft de entiteit die de actie heeft uitgevoerd. Specificatie: https://schema.ocsf.io/1.6.0/objects/actor

- `user` (UserModel, required) — Gebruiker die de actie heeft uitgevoerd
- `app_name` (string, optional, nullable) — Naam van clientapplicatie of -service
- `app_uid` (string, optional, nullable) — Unieke identifier van de clientapplicatie
- `session` (map from string to any, optional, nullable) — Sessie-informatie

### DeviceModel

Apparaatgegevens. Specificatie: https://schema.ocsf.io/1.6.0/objects/device

- `ip` (string, optional, nullable) — IP-adres
- `hostname` (string, optional, nullable) — Hostnaam van apparaat
- `type_id` (integer, optional, default: 99) — ID van apparaattype (99 = onbekend)

### HttpRequestModel

Details van het HTTP-request. Specificatie: https://schema.ocsf.io/1.6.0/objects/http_request

- `http_method` (string, required) — HTTP-methode (GET, POST enz.)
- `url` (UrlModel, required) — Request-URL-object
- `user_agent` (string, optional, nullable) — User agent-string
- `x_forwarded_for` (list of string, optional, nullable) — X-Forwarded-For-header als lijst

### ValidationErrorLocItems

### UserModel

OCSF User-object. Specificatie: https://schema.ocsf.io/1.6.0/objects/user

- `name` (string, optional, nullable) — Username
- `uid` (string, optional, nullable) — Unieke gebruikersidentificatiecode
- `type_id` (enum, optional) — ID van accounttype
  - Allowed values: `0`, `1`, `2`, `3`, `4`, `99`
- `type` (string, optional, nullable) — Beschrijving van accounttype
- `email_addr` (string, optional, nullable) — E-mailadres van de gebruiker
- `full_name` (string, optional, nullable) — Volledige naam van de gebruiker
- `domain` (string, optional, nullable) — Domein van de gebruiker

### UrlModel

OCSF URL-object. Specificatie: https://schema.ocsf.io/1.6.0/objects/url

- `url_string` (string, optional, nullable) — Volledige URL-tekenreeks
- `scheme` (string, optional, nullable) — URL-schema (bijvoorbeeld https)
- `hostname` (string, optional, nullable) — URL-hostnaam
- `port` (integer, optional, nullable) — URL-poort
- `path` (string, optional, nullable) — URL-pad
- `query_string` (string, optional, nullable) — URL-querystring

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