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

# ワークスペース監査ログを取得

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

ワークスペースの監査ログを返します。エンタープライズプランと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) — ページあたりのエントリ最大数
- `cursor` (string, optional, nullable) — 次のページ用カーソル（前回のレスポンスから取得）
- `time_from_unix_ms` (integer, optional, nullable) — この時刻以降のエントリのみを含めます（エポックからのミリ秒）。
- `time_to_unix_ms` (integer, optional, nullable) — この時刻以前のエントリのみを含めます（エポックからのミリ秒）。
- `actor_uid` (string, optional, nullable) — 実行者ユーザーIDでフィルター
- `class_name` (string, optional, nullable) — OCSFイベントクラス名でフィルター（例：Account Change）
- `activity_name` (string, optional, nullable) — 監査アクティビティ名でフィルター（例：Subscription Creation）

## Response

### 200

成功レスポンス。

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

## Errors

### 422 Unprocessable Entity Error

検証エラー

- `detail` (list of ValidationError, optional)

## Types

### WorkspaceAuditLogEntryResponse

APIレスポンス用のFirestoreドキュメントIDを含む監査ログエントリ。

- `activity_id` (WorkspaceAuditLogEntryResponseActivityId, required) — アクティビティID
- `activity_name` (string, required) — アクティビティ名
- `status_id` (enum, required) — アクションのステータス。
  - Allowed values: `0`, `1`, `2`, `99`
- `actor` (ActorModel, required) — アクションを実行するアクター
- `message` (string, required) — 人間が読めるイベントの説明
- `id` (string, required) — FirestoreドキュメントID
- `time_dt` (string, required) — 'time'から取得した、人間が読みやすいRFC 3339形式のイベント時刻です。
- `type_uid` (integer, required) — OCSF type_uidはclass_uid * 100 + activity_idです。
- `type_name` (string, required) — OCSF type_nameはclass_nameとactivity_nameを組み合わせたものです。
- `metadata` (map from string to any, optional) — イベントメタデータ
- `time` (integer, optional) — エポックからのミリ秒単位のイベント時刻
- `category_name` (string, optional, default: Identity & Access Management) — イベントカテゴリ
- `category_uid` (integer, optional, default: 3) — IAMのカテゴリUID
- `class_name` (string, optional, default: ) — イベントクラス名
- `class_uid` (integer, optional, default: 0) — イベントクラスUID
- `severity_id` (enum, optional) — 重要度
  - Allowed values: `0`, `1`, `2`, `3`, `4`, `5`, `6`, `99`
- `device` (DeviceModel, optional, nullable) — デバイス情報
- `http_request` (HttpRequestModel, optional, nullable) — HTTPリクエストの詳細
- `unmapped` (map from string to any, optional) — OCSFにマッピングされていない属性

### ValidationError

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

### WorkspaceAuditLogEntryResponseActivityId

アクティビティID

### ActorModel

OCSF Actorオブジェクト：アクションを実行したエンティティを示します。 仕様：https://schema.ocsf.io/1.6.0/objects/actor

- `user` (UserModel, required) — 操作を行ったユーザー
- `app_name` (string, optional, nullable) — クライアントアプリケーションまたはサービス名
- `app_uid` (string, optional, nullable) — クライアントアプリケーションの一意識別子
- `session` (map from string to any, optional, nullable) — セッション情報

### DeviceModel

デバイス情報。 仕様：https://schema.ocsf.io/1.6.0/objects/device

- `ip` (string, optional, nullable) — IPアドレス
- `hostname` (string, optional, nullable) — デバイスのホスト名
- `type_id` (integer, optional, default: 99) — デバイスタイプID（99＝不明）

### HttpRequestModel

HTTPリクエストの詳細。 仕様：https://schema.ocsf.io/1.6.0/objects/http_request

- `http_method` (string, required) — HTTPメソッド（GET、POSTなど）
- `url` (UrlModel, required) — リクエストURLオブジェクト
- `user_agent` (string, optional, nullable) — ユーザーエージェント文字列
- `x_forwarded_for` (list of string, optional, nullable) — リスト形式のX-Forwarded-Forヘッダー

### ValidationErrorLocItems

### UserModel

OCSF Userオブジェクトです。 仕様：https://schema.ocsf.io/1.6.0/objects/user

- `name` (string, optional, nullable) — Username
- `uid` (string, optional, nullable) — 一意のユーザー識別子
- `type_id` (enum, optional) — アカウントタイプ識別子
  - Allowed values: `0`, `1`, `2`, `3`, `4`, `99`
- `type` (string, optional, nullable) — アカウントタイプの説明
- `email_addr` (string, optional, nullable) — ユーザーメールアドレス
- `full_name` (string, optional, nullable) — ユーザーのフルネーム
- `domain` (string, optional, nullable) — ユーザーのドメイン

### UrlModel

OCSF URLオブジェクトです。 仕様：https://schema.ocsf.io/1.6.0/objects/url

- `url_string` (string, optional, nullable) — 完全なURL文字列
- `scheme` (string, optional, nullable) — URLスキーム（例：https）
- `hostname` (string, optional, nullable) — URLホスト名
- `port` (integer, optional, nullable) — URLポート
- `path` (string, optional, nullable) — URLパス
- `query_string` (string, optional, nullable) — 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()
```