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

# Pobierz dzienniki audytu obszaru roboczego

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

Zwraca dziennik audytu obszaru roboczego. Wymaga planu Enterprise i uprawnienia 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) — Maksymalna liczba wpisów na stronę
- `cursor` (string, optional, nullable) — Kursor następnej strony (z poprzedniej odpowiedzi)
- `time_from_unix_ms` (integer, optional, nullable) — Uwzględniaj tylko wpisy od tego czasu (ms od epoki) lub późniejsze
- `time_to_unix_ms` (integer, optional, nullable) — Uwzględniaj tylko wpisy do tego czasu (ms od epoki) lub wcześniejsze
- `actor_uid` (string, optional, nullable) — Filtruj według ID użytkownika wykonującego działanie
- `class_name` (string, optional, nullable) — Filtruj według nazwy klasy zdarzenia OCSF (np. Zmiana konta)
- `activity_name` (string, optional, nullable) — Filtruj według nazwy aktywności audytu (np. Utworzenie subskrypcji)

## Response

### 200

Pomyślna odpowiedź

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

## Errors

### 422 Unprocessable Entity Error

Błąd walidacji

- `detail` (list of ValidationError, optional)

## Types

### WorkspaceAuditLogEntryResponse

Wpis dziennika audytu z identyfikatorem dokumentu Firestore dla odpowiedzi API.

- `activity_id` (WorkspaceAuditLogEntryResponseActivityId, required) — ID aktywności
- `activity_name` (string, required) — Nazwa aktywności
- `status_id` (enum, required) — Status działania
  - Allowed values: `0`, `1`, `2`, `99`
- `actor` (ActorModel, required) — Podmiot wykonujący działanie
- `message` (string, required) — Czytelny opis zdarzenia
- `id` (string, required) — ID dokumentu Firestore
- `time_dt` (string, required) — Czas zdarzenia w czytelnym formacie RFC 3339, pochodzący z 'time'.
- `type_uid` (integer, required) — OCSF type_uid to class_uid * 100 + activity_id.
- `type_name` (string, required) — OCSF type_name łączy class_name i activity_name.
- `metadata` (map from string to any, optional) — Metadane zdarzenia
- `time` (integer, optional) — Czas zdarzenia w milisekundach od epoki
- `category_name` (string, optional, default: Identity & Access Management) — Kategoria zdarzenia
- `category_uid` (integer, optional, default: 3) — UID kategorii dla IAM
- `class_name` (string, optional, default: ) — Nazwa klasy zdarzenia
- `class_uid` (integer, optional, default: 0) — UID klasy zdarzenia
- `severity_id` (enum, optional) — Poziom ważności
  - Allowed values: `0`, `1`, `2`, `3`, `4`, `5`, `6`, `99`
- `device` (DeviceModel, optional, nullable) — Informacje o urządzeniu
- `http_request` (HttpRequestModel, optional, nullable) — Szczegóły żądania HTTP
- `unmapped` (map from string to any, optional) — Atrybuty nieprzypisane do OCSF

### ValidationError

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

### WorkspaceAuditLogEntryResponseActivityId

ID aktywności

- AccountChangeActivityId: enum
  - Allowed values: `0`, `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `11`, `12`, `99`
- AuthenticationActivityId: enum
  - Allowed values: `0`, `1`, `2`, `3`, `4`, `5`, `6`, `7`, `99`
- EntityManagementActivityId: enum
  - Allowed values: `0`, `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `11`, `12`, `13`, `99`
- UserAccessManagementActivityId: enum
  - Allowed values: `0`, `1`, `2`, `99`
- GroupManagementActivityId: enum
  - Allowed values: `0`, `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `99`

### ActorModel

Obiekt Actor OCSF — opisuje podmiot, który wykonał działanie. Specyfikacja: https://schema.ocsf.io/1.6.0/objects/actor

- `user` (UserModel, required) — Użytkownik, który wykonał działanie
- `app_name` (string, optional, nullable) — Nazwa aplikacji lub usługi klienta
- `app_uid` (string, optional, nullable) — Unikalny identyfikator aplikacji klienta
- `session` (map from string to any, optional, nullable) — Informacje o sesji

### DeviceModel

Informacje o urządzeniu. Specyfikacja: https://schema.ocsf.io/1.6.0/objects/device

- `ip` (string, optional, nullable) — Adres IP
- `hostname` (string, optional, nullable) — Nazwa hosta urządzenia
- `type_id` (integer, optional, default: 99) — ID typu urządzenia (99 = Nieznany)

### HttpRequestModel

Szczegóły żądania HTTP. Specyfikacja: https://schema.ocsf.io/1.6.0/objects/http_request

- `http_method` (string, required) — Metoda HTTP (GET, POST itd.)
- `url` (UrlModel, required) — Obiekt adresu URL żądania
- `user_agent` (string, optional, nullable) — Ciąg user agenta
- `x_forwarded_for` (list of string, optional, nullable) — Nagłówek X-Forwarded-For jako lista

### ValidationErrorLocItems

- string
- integer

### UserModel

Obiekt User OCSF. Specyfikacja: https://schema.ocsf.io/1.6.0/objects/user

- `name` (string, optional, nullable) — Username
- `uid` (string, optional, nullable) — Unikalny identyfikator użytkownika
- `type_id` (enum, optional) — Identyfikator typu konta
  - Allowed values: `0`, `1`, `2`, `3`, `4`, `99`
- `type` (string, optional, nullable) — Opis typu konta
- `email_addr` (string, optional, nullable) — Adres e-mail użytkownika
- `full_name` (string, optional, nullable) — Pełne imię i nazwisko użytkownika
- `domain` (string, optional, nullable) — Domena użytkownika

### UrlModel

Obiekt URL OCSF. Specyfikacja: https://schema.ocsf.io/1.6.0/objects/url

- `url_string` (string, optional, nullable) — Pełny ciąg URL
- `scheme` (string, optional, nullable) — Schemat URL (np. https)
- `hostname` (string, optional, nullable) — Nazwa hosta URL
- `port` (integer, optional, nullable) — Port URL
- `path` (string, optional, nullable) — Ścieżka URL
- `query_string` (string, optional, nullable) — Ciąg zapytania URL

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