# Retrieve an audit event (/docs/api-reference/audit-log/get-audit-event)

One event of the organization's audit log.

`GET https://api.coss.com/v1/audit_events/{id}`

Authenticate with your API key as a bearer token (`Authorization: Bearer coss_test_…`). Responses are JSON with snake_case fields; errors are `{ error: { type, code, message, param?, issues?, request_id } }` (https://coss.com/docs/api-reference/errors.md).

## Path parameters

- `id` (string, required): The audit event's id.

## Example request

TypeScript (the `coss` package):

```ts
import { Coss } from "coss";

const coss = new Coss({
  apiKey: process.env.COSS_API_KEY,
  baseUrl: "https://api.coss.com",
});

const { data, error } = await coss.auditEvents.get("oaudit_01k7c8m4q2f3e9v6t5r1n0p8yz");
```

HTTP:

```sh
curl -X GET "https://api.coss.com/v1/audit_events/oaudit_01k7c8m4q2f3e9v6t5r1n0p8yz" \
  -H "Authorization: Bearer $COSS_API_KEY"
```

Python:

```python
from coss import Coss

client = Coss()  # api_key= or COSS_API_KEY

client.audit_events.get(
    id="oaudit_01k7c8m4q2f3e9v6t5r1n0p8yz",
)
```

Go:

```go
import (
	"context"

	coss "github.com/cosscom/coss-go"
	cossclient "github.com/cosscom/coss-go/client"
)

client := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY

request := &coss.GetAuditEventsRequest{
    ID: "oaudit_01k7c8m4q2f3e9v6t5r1n0p8yz",
}
client.AuditEvents.Get(
    context.TODO(),
    request,
)
```

Ruby:

```ruby
require "coss"

client = Coss::Client.new # api_key: or COSS_API_KEY

client.audit_events.get(id: "oaudit_01k7c8m4q2f3e9v6t5r1n0p8yz")
```

PHP:

```php
<?php

use Coss\Coss;

$client = new Coss(); // apiKey: or COSS_API_KEY

$client->auditEvents->get(
    'oaudit_01k7c8m4q2f3e9v6t5r1n0p8yz',
);
```

Java:

```java
import com.coss.Coss;
import com.coss.resources.auditevents.requests.GetAuditEventsRequest;

Coss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY

client.auditEvents().get(
    "oaudit_01k7c8m4q2f3e9v6t5r1n0p8yz",
    GetAuditEventsRequest
        .builder()
        .build()
);
```

.NET:

```csharp
using Coss;

var client = new CossClient(); // apiKey: or COSS_API_KEY

await client.AuditEvents.GetAsync(
    new GetAuditEventsRequest { Id = "oaudit_01k7c8m4q2f3e9v6t5r1n0p8yz" }
);
```

## Response 200

The audit event.

- `object` ("audit_event", required)
- `id` (string, required)
- `created_at` (string, required, date-time)
- `actor_type` ("user" | "api_key" | "system", required): `user`: a member, in the dashboard (`actor_id` is the user's id, `actor_label` their email). `api_key`: a request made with an API key (`actor_id` is the key's id). `system`: coss.com itself, including coss.com support.
- `actor_id` (string | null, required): The user's or API key's id; `null` for the system.
- `actor_label` (string, required): Who made the change, copied when it was recorded so it outlives them: the user's email, the API key's id, or `coss.com support`.
- `action` (string, required): `<resource>.<verb>`, e.g. `api_key.created`, `domain.deleted`, `member.role_changed`.
- `target_type` (string | null, required): What was changed: `domain`, `api_key`, `member`…
- `target_id` (string | null, required): The id of what it acted on. `null`: nothing in particular.
- `target_label` (string | null, required): A readable name for the target when it was changed.
- `project_id` (string | null, required): `null` for organization-wide changes (domains, members…).
- `environment_id` (string | null, required): `null` for organization-wide changes (domains, members…).
- `metadata` (map of any, required): Details of the change; API changes include their `request_id`.
- `client_ip` (string | null, required): The actor's address. `null`: unknown.
- `user_agent` (string | null, required): The actor's `User-Agent`. `null`: unknown.

Example:

```json
{
  "object": "audit_event",
  "id": "oaudit_01k7c8m4q2f3e9v6t5r1n0p8yz",
  "created_at": "2026-01-15T09:30:00.000Z",
  "actor_type": "api_key",
  "actor_id": "key_01k7c8m4q2f3e9v6t5r1n0p8yz",
  "actor_label": "key_01k7c8m4q2f3e9v6t5r1n0p8yz",
  "action": "suppression.created",
  "target_type": "suppression",
  "target_id": "sup_01k7c8m4q2f3e9v6t5r1n0p8yz",
  "target_label": "user@example.com",
  "project_id": "proj_01k7c8m4q2f3e9v6t5r1n0p8yz",
  "environment_id": "env_01k7c8m4q2f3e9v6t5r1n0p8yz",
  "metadata": {
    "scope": "*",
    "request_id": "req_01k7c8m4q2f3e9v6t5r1n0p8yz"
  },
  "client_ip": "203.0.113.7",
  "user_agent": "coss-node/0.1.0"
}
```

## Errors

- `400`: The `Coss-Version` header names an unknown API version (`invalid_api_version`).
- `401`: The API key is missing, invalid, revoked or expired (`authentication_error`).
- `402`: The organization's plan doesn't include the audit log (`plan_feature_unavailable`) (`billing_error`). Never retried: it needs a plan change or a payment.
- `403`: The API key lacks the permission this endpoint needs (`permission_error`), or its organization is suspended (`organization_suspended`).
- `404`: No audit event with this id exists in the organization (`not_found`).
- `429`: Too many requests with this API key (`rate_limited`), or too many requests with invalid keys from this address (`too_many_failed_authentications`). Retry after `Retry-After` seconds. Successful responses carry `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset` (seconds until the limit is fully restored).
- `500`: Unexpected server error (`api_error` / `internal_error`).
- `503`: The API key could not be verified right now; retry (`service_unavailable`).