---
title: "Create Audit Log Export"
method: POST
path: "/audit-log-export"
tags: ["Audit Log Export"]
---

# Create Audit Log Export

`POST /audit-log-export`

## Request

- Base URL: `https://oneuptime.com/api`
- URL: `https://oneuptime.com/api/audit-log-export`
- Auth: API key in header `APIKey`
- TypeScript: <https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification/docs/audit-log-export/post.ts> (a function with typed inputs; its response is checked against the schema)

Endpoint to create a new Audit Log Export

## Request body

- object
  - `data` AuditLogExportCreateSchema, required: Create schema for AuditLogExport model. Create
    - `projectId` string, uuid: ID of the project whose audit log is exported. Empty for an export of the whole instance. Permissions - Create: [Project Owner, Project Admin], Read: [Project Owner, Project Admin], Update: [No access - you don't have permission for this operation]
    - `name` string, required: A name for this export, such as Compliance archive. Permissions - Create: [Project Owner, Project Admin], Read: [Project Owner, Project Admin], Update: [Project Owner, Project Admin]
    - `destinationType` 's3' | 's3-compatible' | 'google-cloud-storage' | 'azure-blob-storage' | 'webhook' | 'syslog', required: Where entries are sent: s3, s3-compatible, google-cloud-storage, azure-blob-storage, webhook or syslog. Fixed once created. Permissions - Create: [Project Owner, Project Admin], Read: [Project Owner, Project Admin], Update: [No access - you don't have permission for this operation]
    - `config` object: The destination's settings that are not secret, such as the bucket and the region. Keys are defined by the destination. Permissions - Create: [Project Owner, Project Admin], Read: [Project Owner, Project Admin], Update: [Project Owner, Project Admin]
    - `secrets` string, password: The destination's secrets, such as an access key's secret, as a JSON object. Encrypted at rest and never returned by the API. Permissions - Create: [Project Owner, Project Admin], Read: [No access - you don't have permission for this operation], Update: [Project Owner, Project Admin]
    - `isEnabled` boolean: Whether entries are exported. A paused export keeps its place. Permissions - Create: [Project Owner, Project Admin], Read: [Project Owner, Project Admin], Update: [Project Owner, Project Admin]
    - `startsAt` object: Entries recorded from this time on are exported. Empty on create means from now; an earlier date also sends the entries kept since then. Permissions - Create: [Project Owner, Project Admin], Read: [Project Owner, Project Admin], Update: [Project Owner, Project Admin]

## Response `201`

Created successfully

- object
  - `data` AuditLogExportReadSchema: Read schema for AuditLogExport model. Read
    - `_id` string, uuid: ID of this object. Permissions - Create: [Project Owner, Project Admin], Read: [Project Owner, Project Admin], Update: [Project Owner, Project Admin]
    - `createdAt` object: Date and Time when the object was created. Permissions - Create: [Project Owner, Project Admin], Read: [Project Owner, Project Admin], Update: [Project Owner, Project Admin]
    - `updatedAt` object: Date and Time when the object was updated. Permissions - Create: [Project Owner, Project Admin], Read: [Project Owner, Project Admin], Update: [Project Owner, Project Admin]
    - `deletedAt` object: Date and Time when the object was deleted. Permissions - Create: [Project Owner, Project Admin], Read: [Project Owner, Project Admin], Update: [Project Owner, Project Admin]
    - `projectId` string, uuid: ID of the project whose audit log is exported. Empty for an export of the whole instance. Permissions - Create: [Project Owner, Project Admin], Read: [Project Owner, Project Admin], Update: [No access - you don't have permission for this operation]
    - `name` string, required: A name for this export, such as Compliance archive. Permissions - Create: [Project Owner, Project Admin], Read: [Project Owner, Project Admin], Update: [Project Owner, Project Admin]
    - `destinationType` 's3' | 's3-compatible' | 'google-cloud-storage' | 'azure-blob-storage' | 'webhook' | 'syslog', required: Where entries are sent: s3, s3-compatible, google-cloud-storage, azure-blob-storage, webhook or syslog. Fixed once created. Permissions - Create: [Project Owner, Project Admin], Read: [Project Owner, Project Admin], Update: [No access - you don't have permission for this operation]
    - `config` object: The destination's settings that are not secret, such as the bucket and the region. Keys are defined by the destination. Permissions - Create: [Project Owner, Project Admin], Read: [Project Owner, Project Admin], Update: [Project Owner, Project Admin]
    - `isEnabled` boolean: Whether entries are exported. A paused export keeps its place. Permissions - Create: [Project Owner, Project Admin], Read: [Project Owner, Project Admin], Update: [Project Owner, Project Admin]
    - `startsAt` object: Entries recorded from this time on are exported. Empty on create means from now; an earlier date also sends the entries kept since then. Permissions - Create: [Project Owner, Project Admin], Read: [Project Owner, Project Admin], Update: [Project Owner, Project Admin]
    - `cursorCreatedAt` object: When the last entry delivered was recorded: where the next batch starts. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin], Update: [No access - you don't have permission for this operation]
    - `cursorEntryId` string, uuid: The ID of the last entry delivered, which orders the entries recorded in the same second. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin], Update: [No access - you don't have permission for this operation]
    - `exportedEntryCount` number: How many entries have been delivered so far. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin], Update: [No access - you don't have permission for this operation]
    - `lastExportedAt` object: When entries were last delivered. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin], Update: [No access - you don't have permission for this operation]
    - `lastAttemptAt` object: When OneUptime last tried to deliver entries. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin], Update: [No access - you don't have permission for this operation]
    - `lastError` string: Why the last delivery failed, with credentials redacted. Cleared by the next delivery that succeeds. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin], Update: [No access - you don't have permission for this operation]
    - `failingSince` object: When deliveries started failing. Cleared by the next delivery that succeeds. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin], Update: [No access - you don't have permission for this operation]
    - `consecutiveFailureCount` number: How many deliveries in a row have failed. It sets how long the next retry waits. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin], Update: [No access - you don't have permission for this operation]
    - `nextAttemptAt` object: While deliveries fail: when OneUptime tries again. Saving the export's settings tries again at once. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin], Update: [No access - you don't have permission for this operation]
    - `createdByUserId` string, uuid: ID of the user who created this export. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin], Update: [No access - you don't have permission for this operation]
    - `deletedByUserId` string, uuid: ID of the user who deleted this export. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin], Update: [No access - you don't have permission for this operation]

## Other responses

- `400`: Bad request. This response indicates that the request was malformed or contained invalid data.
- `401`: Unauthorized. This response indicates that the request requires user authentication.
- `402`: Payment Required. This response indicates that the request requires payment or a valid subscription.
- `403`: Forbidden. This response indicates that the server understood the request, but refuses to authorize it.
- `405`: Project not found. This response indicates that the requested project does not exist or is not accessible.
- `408`: Request Timeout. This response indicates that the server timed out waiting for the request.
- `415`: Unable to reach server. This response indicates that the server is currently unreachable or down.
- `422`: Not authorized. This response indicates that the user does not have permission to access the requested resource.
- `500`: Internal Server Error. This response indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.

---

[API](https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification.md) - [All operations](https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification/llms.txt) - [OpenAPI document](https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification/revisions/ba3307d00304?raw)
