# List audit logs — API reference

> Returns actions with actors, resource identifiers, metadata, timestamps and pagination.

Source: https://upfour.io/docs/api/organization/list-audit-logs

[Developers](https://upfour.io/docs/api.md)/[Organization](https://upfour.io/docs/api/organization.md)

Returns actions with actors, resource identifiers, metadata, timestamps and pagination.

GET https://app.upfour.io/v1/organization/audit-logs

scope audit_log.read stable returns 200

## Returns

A successful request returns `200` with application/json.

Response fields 2 top-level fields

| Field | Type | Description |
| --- | --- | --- |
| `data` | AuditLog[]  · nullable | |
| Each item · 9 fields FieldTypeDescription `action` string `actor_email` string `created_at` string (date-time) `id` uuid `metadata` object  · nullable free-form keys Details of the action; the keys depend on the action. `organization_id` uuid `resource_id` string The id of the changed object; not always a UUID (an SSO entry carries its provider name). `resource_type` string `actor_user_id` uuid | | |
| `pagination` | Pagination | |
| Pagination · 5 fields FieldTypeDescription `cursor` string  · nullable `has_more` boolean `limit` integer 1–250 `next_cursor` string  · nullable `prev_cursor` string  · nullable | | |

## Errors

Only the errors this operation can return. Every error uses the [same envelope](https://upfour.io/docs/api/responses.md).

| Status | Code | Meaning |
| --- | --- | --- |
| 400 | [bad_request](https://upfour.io/docs/api/errors#code-bad_request) | The request is malformed or fails validation. |
| 403 | [permission_denied](https://upfour.io/docs/api/errors#code-permission_denied) | The credentials do not permit this action. |

Every call can also return `unauthorized` (401), `rate_limit_exceeded` (429) or `internal_error` (500 / 502). See [Responses and errors](https://upfour.io/docs/api/responses.md).

[PreviousUpdate AI quota](https://upfour.io/docs/api/organization/update-ai-quota.md)

## Request

### cURL

```bash
curl -s "https://app.upfour.io/v1/organization/audit-logs" \
  -H "Authorization: Bearer $UP4_API_KEY"
```

### JavaScript

```javascript
const res = await fetch("https://app.upfour.io/v1/organization/audit-logs", {
  headers: {
    Authorization: `Bearer ${process.env.UP4_API_KEY}`,
  },
});
console.log(res.status, await res.json());
```

### Python

```python
import os
import requests

res = requests.get(
    "https://app.upfour.io/v1/organization/audit-logs",
    headers={"Authorization": f"Bearer {os.environ['UP4_API_KEY']}"},
)
print(res.status_code, res.json())
```

### Go

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	req, _ := http.NewRequest("GET", "https://app.upfour.io/v1/organization/audit-logs", nil)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("UP4_API_KEY"))
	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	out, _ := io.ReadAll(res.Body)
	fmt.Println(res.StatusCode, string(out))
}
```

### PHP

```php
<?php
$ch = curl_init("https://app.upfour.io/v1/organization/audit-logs");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("UP4_API_KEY"),
    ],
]);
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), " ", $response, "\n";
curl_close($ch);
```

## Response

### 200

```json
{
  "data": [
    {
      "action": "organization.ai_quota_updated",
      "actor_email": "anna@example.com",
      "actor_user_id": "00000000-0000-4000-8000-000000000001",
      "created_at": "2026-10-27T09:00:00Z",
      "id": "00000000-0000-4000-8000-000000000002",
      "metadata": {
        "monthly_call_cap": 200,
        "monthly_cap_cents": 1000
      },
      "organization_id": "00000000-0000-4000-8000-000000000003",
      "resource_id": "00000000-0000-4000-8000-000000000003",
      "resource_type": "organization"
    },
    {
      "action": "sso.provider_updated",
      "actor_email": "anna@example.com",
      "actor_user_id": "00000000-0000-4000-8000-000000000001",
      "created_at": "2026-10-27T09:00:00Z",
      "id": "00000000-0000-4000-8000-000000000004",
      "metadata": {
        "enabled": false,
        "provider": "google"
      },
      "organization_id": "00000000-0000-4000-8000-000000000003",
      "resource_id": "google",
      "resource_type": "organization_sso_provider"
    },
    {
      "action": "organization.security_updated",
      "actor_email": "anna@example.com",
      "actor_user_id": "00000000-0000-4000-8000-000000000001",
      "created_at": "2026-10-27T09:00:00Z",
      "id": "00000000-0000-4000-8000-000000000005",
      "metadata": {
        "allow_ai_features": true,
        "audit_drain_url": "",
        "require_2fa": false
      },
      "organization_id": "00000000-0000-4000-8000-000000000003",
      "resource_id": "00000000-0000-4000-8000-000000000003",
      "resource_type": "organization"
    },
    {
      "action": "advisor.fix_applied",
      "actor_email": "anna@example.com",
      "actor_user_id": "00000000-0000-4000-8000-000000000001",
      "created_at": "2026-10-27T09:00:00Z",
      "id": "00000000-0000-4000-8000-000000000006",
      "metadata": {
        "applied": "channel_attached",
        "rule_id": "monitor_without_recipient"
      },
      "organization_id": "00000000-0000-4000-8000-000000000003",
      "resource_id": "00000000-0000-4000-8000-000000000007",
      "resource_type": "monitor"
    },
    {
      "action": "status_page.access_token_revoked",
      "actor_email": "anna@example.com",
      "actor_user_id": "00000000-0000-4000-8000-000000000001",
      "created_at": "2026-10-27T09:00:00Z",
      "id": "00000000-0000-4000-8000-000000000008",
      "metadata": {},
      "organization_id": "00000000-0000-4000-8000-000000000003",
      "resource_id": "00000000-0000-4000-8000-000000000009",
      "resource_type": "status_page"
    },
    {
      "action": "status_page.access_token_rotated",
      "actor_email": "anna@example.com",
      "actor_user_id": "00000000-0000-4000-8000-000000000001",
      "created_at": "2026-10-27T09:00:00Z",
      "id": "00000000-0000-4000-8000-000000000010",
      "metadata": {},
      "organization_id": "00000000-0000-4000-8000-000000000003",
      "resource_id": "00000000-0000-4000-8000-000000000009",
      "resource_type": "status_page"
    },
    {
      "action": "status_page.access_policy_updated",
      "actor_email": "anna@example.com",
      "actor_user_id": "00000000-0000-4000-8000-000000000001",
      "created_at": "2026-10-27T09:00:00Z",
      "id": "00000000-0000-4000-8000-000000000011",
      "metadata": {
        "access_email_codes": false,
        "ip_allowlist": [
          "203.0.113.0/24"
        ]
      },
      "organization_id": "00000000-0000-4000-8000-000000000003",
      "resource_id": "00000000-0000-4000-8000-000000000009",
      "resource_type": "status_page"
    }
  ],
  "pagination": {
    "cursor": null,
    "has_more": false,
    "limit": 50,
    "next_cursor": null,
    "prev_cursor": null
  }
}
```

### 400

```json
{
  "error": {
    "code": "bad_request",
    "message": "The request is malformed or fails validation.",
    "request_id": "req_…"
  }
}
```

### 403

```json
{
  "error": {
    "code": "permission_denied",
    "message": "The credentials do not permit this action.",
    "request_id": "req_…"
  }
}
```
