> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orq.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# AuditLogDestinations SDK Reference

> SDK reference for the AuditLogDestinations API, available in Node.js and Python.

## AuditLogDestinations

### List AuditLogDestinations

Returns the audit log destinations of the workspace, newest first, with cursor pagination.

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:

    res = orq.audit_log_destinations.list()

    # Handle response
    print(res)

```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { Orq } from "@orq-ai/node";

const orq = new Orq({
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  const result = await orq.auditLogDestinations.list();

  console.log(result);
}

run();
```

**Parameters**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "limit": Optional[int],
    "starting_after": Optional[str],
    "ending_before": Optional[str],
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  limit?: number;
  startingAfter?: string;
  endingBefore?: string;
}
```

**Response**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "object": str,
    "data": [{
        "id": str,
        "display_name": str,
        "description": Optional[str],
        "url": str,
        "status": Literal["AUDIT_LOG_DESTINATION_STATUS_ACTIVE", "AUDIT_LOG_DESTINATION_STATUS_PAUSED"],
        "signing_secret_hint": Optional[str],
        "secret_rotated_at": str,  # optional
        "created_at": str,
        "updated_at": str,
        "created_by_id": Optional[str],
        "updated_by_id": Optional[str],
    }],
    "has_more": bool,
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  object: string;
  data: {
    id: string;
    displayName: string;
    description?: string;
    url: string;
    status: "AUDIT_LOG_DESTINATION_STATUS_ACTIVE" | "AUDIT_LOG_DESTINATION_STATUS_PAUSED";
    signingSecretHint?: string;
    secretRotatedAt?: Date;
    createdAt: Date;
    updatedAt: Date;
    createdById?: string;
    updatedById?: string;
  }[];
  hasMore: boolean;
}
```

### Create an AuditLogDestination

Creates a signed webhook destination that receives every audit log event recorded in the workspace from this point on. The signing secret is returned once in this response and never again.

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:

    res = orq.audit_log_destinations.create(display_name="Security events archive", url="https://audit.example.com/events")

    # Handle response
    print(res)

```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { Orq } from "@orq-ai/node";

const orq = new Orq({
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  const result = await orq.auditLogDestinations.create({
    displayName: "Security events archive",
    url: "https://audit.example.com/events",
  });

  console.log(result);
}

run();
```

**Parameters**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "display_name": str,  # required
    "url": str,  # required
    "description": Optional[str],
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  displayName: string;  // required
  description?: string;
  url: string;  // required
}
```

**Response**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "destination": {
        "id": str,
        "display_name": str,
        "description": Optional[str],
        "url": str,
        "status": Literal["AUDIT_LOG_DESTINATION_STATUS_ACTIVE", "AUDIT_LOG_DESTINATION_STATUS_PAUSED"],
        "signing_secret_hint": Optional[str],
        "secret_rotated_at": str,  # optional
        "created_at": str,
        "updated_at": str,
        "created_by_id": Optional[str],
        "updated_by_id": Optional[str],
    },
    "signing_secret": str,
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  destination: {
    id: string;
    displayName: string;
    description?: string;
    url: string;
    status: "AUDIT_LOG_DESTINATION_STATUS_ACTIVE" | "AUDIT_LOG_DESTINATION_STATUS_PAUSED";
    signingSecretHint?: string;
    secretRotatedAt?: Date;
    createdAt: Date;
    updatedAt: Date;
    createdById?: string;
    updatedById?: string;
  };
  signingSecret: string;
}
```

### Retrieve an AuditLogDestination

Retrieves an audit log destination by ID. The signing secret is never returned.

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:

    res = orq.audit_log_destinations.get(destination_id="<id>")

    # Handle response
    print(res)

```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { Orq } from "@orq-ai/node";

const orq = new Orq({
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  const result = await orq.auditLogDestinations.get({
    destinationId: "<id>",
  });

  console.log(result);
}

run();
```

**Parameters**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "destination_id": str,  # required
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  destinationId: string;  // required
}
```

**Response**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "destination": {
        "id": str,
        "display_name": str,
        "description": Optional[str],
        "url": str,
        "status": Literal["AUDIT_LOG_DESTINATION_STATUS_ACTIVE", "AUDIT_LOG_DESTINATION_STATUS_PAUSED"],
        "signing_secret_hint": Optional[str],
        "secret_rotated_at": str,  # optional
        "created_at": str,
        "updated_at": str,
        "created_by_id": Optional[str],
        "updated_by_id": Optional[str],
    },
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  destination: {
    id: string;
    displayName: string;
    description?: string;
    url: string;
    status: "AUDIT_LOG_DESTINATION_STATUS_ACTIVE" | "AUDIT_LOG_DESTINATION_STATUS_PAUSED";
    signingSecretHint?: string;
    secretRotatedAt?: Date;
    createdAt: Date;
    updatedAt: Date;
    createdById?: string;
    updatedById?: string;
  };
}
```

### Delete an AuditLogDestination

Deletes a destination and cancels its pending deliveries.

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:

    res = orq.audit_log_destinations.delete(destination_id="<id>")

    # Handle response
    print(res)

```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { Orq } from "@orq-ai/node";

const orq = new Orq({
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  const result = await orq.auditLogDestinations.delete({
    destinationId: "<id>",
  });

  console.log(result);
}

run();
```

**Parameters**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "destination_id": str,  # required
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  destinationId: string;  // required
}
```

### Update an AuditLogDestination

Partially updates a destination. Set `status` to `AUDIT_LOG_DESTINATION_STATUS_PAUSED` to stop deliveries while retaining the backlog, and back to `AUDIT_LOG_DESTINATION_STATUS_ACTIVE` to drain it. The URL can only change while the destination is paused.

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:

    res = orq.audit_log_destinations.update(destination_id="<id>", display_name="<value>")

    # Handle response
    print(res)

```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { Orq } from "@orq-ai/node";

const orq = new Orq({
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  const result = await orq.auditLogDestinations.update({
    destinationId: "<id>",
    updateAuditLogDestinationRequest: {
      displayName: "<value>",
    },
  });

  console.log(result);
}

run();
```

**Parameters**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "destination_id": str,  # required
    "display_name": Optional[str],
    "description": Optional[str],
    "url": Optional[str],
    "status": Optional[Literal["AUDIT_LOG_DESTINATION_STATUS_ACTIVE", "AUDIT_LOG_DESTINATION_STATUS_PAUSED"]],
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  destinationId: string;  // required
  updateAuditLogDestinationRequest: {  // required
    displayName?: string;
    description?: string;
    url?: string;
    status?: "AUDIT_LOG_DESTINATION_STATUS_ACTIVE" | "AUDIT_LOG_DESTINATION_STATUS_PAUSED";
  };
}
```

**Response**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "destination": {
        "id": str,
        "display_name": str,
        "description": Optional[str],
        "url": str,
        "status": Literal["AUDIT_LOG_DESTINATION_STATUS_ACTIVE", "AUDIT_LOG_DESTINATION_STATUS_PAUSED"],
        "signing_secret_hint": Optional[str],
        "secret_rotated_at": str,  # optional
        "created_at": str,
        "updated_at": str,
        "created_by_id": Optional[str],
        "updated_by_id": Optional[str],
    },
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  destination: {
    id: string;
    displayName: string;
    description?: string;
    url: string;
    status: "AUDIT_LOG_DESTINATION_STATUS_ACTIVE" | "AUDIT_LOG_DESTINATION_STATUS_PAUSED";
    signingSecretHint?: string;
    secretRotatedAt?: Date;
    createdAt: Date;
    updatedAt: Date;
    createdById?: string;
    updatedById?: string;
  };
}
```

### List Deliveries

Returns the delivery history of a destination, newest first, optionally filtered by status.

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:

    res = orq.audit_log_destinations.list_deliveries(destination_id="<id>")

    # Handle response
    print(res)

```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { Orq } from "@orq-ai/node";

const orq = new Orq({
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  const result = await orq.auditLogDestinations.listDeliveries({
    destinationId: "<id>",
  });

  console.log(result);
}

run();
```

**Parameters**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "destination_id": str,  # required
    "limit": Optional[int],
    "starting_after": Optional[str],
    "ending_before": Optional[str],
    "status": List[Literal["AUDIT_LOG_DELIVERY_STATUS_PENDING", "AUDIT_LOG_DELIVERY_STATUS_DELIVERING", "AUDIT_LOG_DELIVERY_STATUS_SUCCEEDED", "AUDIT_LOG_DELIVERY_STATUS_FAILED", "AUDIT_LOG_DELIVERY_STATUS_CANCELLED"]],  # optional
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  destinationId: string;  // required
  limit?: number;
  startingAfter?: string;
  endingBefore?: string;
  status?: ("AUDIT_LOG_DELIVERY_STATUS_PENDING" | "AUDIT_LOG_DELIVERY_STATUS_DELIVERING" | "AUDIT_LOG_DELIVERY_STATUS_SUCCEEDED" | "AUDIT_LOG_DELIVERY_STATUS_FAILED" | "AUDIT_LOG_DELIVERY_STATUS_CANCELLED")[];
}
```

**Response**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "object": str,
    "data": [{
        "id": str,
        "destination_id": str,
        "event_id": str,
        "kind": Literal["AUDIT_LOG_DELIVERY_KIND_EVENT", "AUDIT_LOG_DELIVERY_KIND_REPLAY", "AUDIT_LOG_DELIVERY_KIND_TEST"],
        "status": Literal["AUDIT_LOG_DELIVERY_STATUS_PENDING", "AUDIT_LOG_DELIVERY_STATUS_DELIVERING", "AUDIT_LOG_DELIVERY_STATUS_SUCCEEDED", "AUDIT_LOG_DELIVERY_STATUS_FAILED", "AUDIT_LOG_DELIVERY_STATUS_CANCELLED"],
        "attempts": int,
        "next_attempt_at": str,  # optional
        "last_attempt_at": str,  # optional
        "last_status_code": Optional[int],
        "last_error": Optional[str],
        "delivered_at": str,  # optional
        "created_at": str,
        "replay_id": Optional[str],
    }],
    "has_more": bool,
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  object: string;
  data: {
    id: string;
    destinationId: string;
    eventId: string;
    kind: "AUDIT_LOG_DELIVERY_KIND_EVENT" | "AUDIT_LOG_DELIVERY_KIND_REPLAY" | "AUDIT_LOG_DELIVERY_KIND_TEST";
    status: "AUDIT_LOG_DELIVERY_STATUS_PENDING" | "AUDIT_LOG_DELIVERY_STATUS_DELIVERING" | "AUDIT_LOG_DELIVERY_STATUS_SUCCEEDED" | "AUDIT_LOG_DELIVERY_STATUS_FAILED" | "AUDIT_LOG_DELIVERY_STATUS_CANCELLED";
    attempts: number;
    nextAttemptAt?: Date;
    lastAttemptAt?: Date;
    lastStatusCode?: number;
    lastError?: string;
    deliveredAt?: Date;
    createdAt: Date;
    replayId?: string;
  }[];
  hasMore: boolean;
}
```

### Replay an AuditLogDestination

Queues a new delivery for every retained audit event recorded in the time window, up to 10,000 events per request. Replays keep the original event IDs and never extend event retention.

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
from orq_ai_sdk import Orq
from orq_ai_sdk.utils import parse_datetime
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:

    res = orq.audit_log_destinations.replay(destination_id="<id>", from_=parse_datetime("2026-10-01T00:00:00Z"), to=parse_datetime("2026-10-15T00:00:00Z"))

    # Handle response
    print(res)

```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { Orq } from "@orq-ai/node";

const orq = new Orq({
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  const result = await orq.auditLogDestinations.replay({
    destinationId: "<id>",
    replayAuditLogDeliveriesRequest: {
      from: new Date("2026-10-01T00:00:00Z"),
      to: new Date("2026-10-15T00:00:00Z"),
    },
  });

  console.log(result);
}

run();
```

**Parameters**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "destination_id": str,  # required
    "from_": str,  # required
    "to": str,  # required
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  destinationId: string;  // required
  replayAuditLogDeliveriesRequest: {  // required
    from: Date;  // required
    to: Date;  // required
  };
}
```

**Response**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "replay_id": str,
    "queued": int,
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  replayId: string;
  queued: number;
}
```

### Rotate Secret

Generates a new signing secret for the destination. Deliveries attempted after the rotation are signed with the new secret. The new secret is returned once in this response and never again.

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:

    res = orq.audit_log_destinations.rotate_secret(destination_id="<id>")

    # Handle response
    print(res)

```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { Orq } from "@orq-ai/node";

const orq = new Orq({
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  const result = await orq.auditLogDestinations.rotateSecret({
    destinationId: "<id>",
  });

  console.log(result);
}

run();
```

**Parameters**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "destination_id": str,  # required
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  destinationId: string;  // required
}
```

**Response**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "destination": {
        "id": str,
        "display_name": str,
        "description": Optional[str],
        "url": str,
        "status": Literal["AUDIT_LOG_DESTINATION_STATUS_ACTIVE", "AUDIT_LOG_DESTINATION_STATUS_PAUSED"],
        "signing_secret_hint": Optional[str],
        "secret_rotated_at": str,  # optional
        "created_at": str,
        "updated_at": str,
        "created_by_id": Optional[str],
        "updated_by_id": Optional[str],
    },
    "signing_secret": str,
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  destination: {
    id: string;
    displayName: string;
    description?: string;
    url: string;
    status: "AUDIT_LOG_DESTINATION_STATUS_ACTIVE" | "AUDIT_LOG_DESTINATION_STATUS_PAUSED";
    signingSecretHint?: string;
    secretRotatedAt?: Date;
    createdAt: Date;
    updatedAt: Date;
    createdById?: string;
    updatedById?: string;
  };
  signingSecret: string;
}
```

### Test an AuditLogDestination

Sends a signed synthetic `audit_log.test` event to the destination synchronously and returns the receiver outcome. Test deliveries appear in the delivery history.

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:

    res = orq.audit_log_destinations.test(destination_id="<id>")

    # Handle response
    print(res)

```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { Orq } from "@orq-ai/node";

const orq = new Orq({
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  const result = await orq.auditLogDestinations.test({
    destinationId: "<id>",
  });

  console.log(result);
}

run();
```

**Parameters**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "destination_id": str,  # required
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  destinationId: string;  // required
}
```

**Response**

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "delivery": {
        "id": str,
        "destination_id": str,
        "event_id": str,
        "kind": Literal["AUDIT_LOG_DELIVERY_KIND_EVENT", "AUDIT_LOG_DELIVERY_KIND_REPLAY", "AUDIT_LOG_DELIVERY_KIND_TEST"],
        "status": Literal["AUDIT_LOG_DELIVERY_STATUS_PENDING", "AUDIT_LOG_DELIVERY_STATUS_DELIVERING", "AUDIT_LOG_DELIVERY_STATUS_SUCCEEDED", "AUDIT_LOG_DELIVERY_STATUS_FAILED", "AUDIT_LOG_DELIVERY_STATUS_CANCELLED"],
        "attempts": int,
        "next_attempt_at": str,  # optional
        "last_attempt_at": str,  # optional
        "last_status_code": Optional[int],
        "last_error": Optional[str],
        "delivered_at": str,  # optional
        "created_at": str,
        "replay_id": Optional[str],
    },
}
```

```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  delivery: {
    id: string;
    destinationId: string;
    eventId: string;
    kind: "AUDIT_LOG_DELIVERY_KIND_EVENT" | "AUDIT_LOG_DELIVERY_KIND_REPLAY" | "AUDIT_LOG_DELIVERY_KIND_TEST";
    status: "AUDIT_LOG_DELIVERY_STATUS_PENDING" | "AUDIT_LOG_DELIVERY_STATUS_DELIVERING" | "AUDIT_LOG_DELIVERY_STATUS_SUCCEEDED" | "AUDIT_LOG_DELIVERY_STATUS_FAILED" | "AUDIT_LOG_DELIVERY_STATUS_CANCELLED";
    attempts: number;
    nextAttemptAt?: Date;
    lastAttemptAt?: Date;
    lastStatusCode?: number;
    lastError?: string;
    deliveredAt?: Date;
    createdAt: Date;
    replayId?: string;
  };
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.