---
title: "Record an audit event for a change made in the console"
method: POST
path: "/audit"
tags: ["Enterprise"]
---

# Record an audit event for a change made in the console

`POST /audit`

## Request

- Base URL: `https://api.customdomain.ai/v1`
- URL: `https://api.customdomain.ai/v1/audit`
- Auth: HTTP bearer

Ingest for the few mutations that happen in the customer console's own database, so the control plane never sees them. Everything the control plane changes itself is recorded by its own handler and is not accepted here. The organization, actor, address and time are derived on the server; the body names only the action, an optional target and a small before and after summary. Requires an API key whose role may manage identity settings (admin or owner); a widget JWT is refused with `403`, and a `503` means the audit log is not configured on the deployment.

## Request body

- object
  - `action` 'whitelabel.configured' | 'api_key.default_revealed', required: The console-recordable verb. Any other value is refused with `400`.
  - `target` string: What the event is about. Defaults to the caller's own organization when empty.
  - `before` object: A small summary of the state before the change; at most 24 keys.
  - `after` object: A small summary of the state after the change; at most 24 keys.

## Response `200`

Recorded

- object
  - `recorded` boolean, required
  - `action` string, required: The verb that was recorded.

## Other responses

- `400`: Error envelope: {code, title, details}.
- `401`: Error envelope: {code, title, details}.
- `403`: Error envelope: {code, title, details}.
- `503`: Error envelope: {code, title, details}.

---

[API](https://skmtc.dev/customdomain/apis/customdomain-control-plane-api.md) · [All operations](https://skmtc.dev/customdomain/apis/customdomain-control-plane-api/llms.txt) · [OpenAPI document](https://skmtc.dev/customdomain/apis/customdomain-control-plane-api/revisions/34d89cb7a7cd?raw)
