Auth API reference

Auth API · App-Audit-Sink

patch/v1/apps/{app_id}/audit-sinkAuth

Change the address or switch export on or off, keeping the signing secret.

Send `url`, `enabled` or both. `enabled: false` pauses export; `enabled: true` resumes it and clears a stop after repeated failures and the failure count. The position in the audit log is never moved: nothing is skipped and nothing is replayed twice on purpose. A new `url` is checked by the same address guard as `PUT`.

Path parameters

app_id*string

Id of the app.

Request body

urlstring

New HTTPS address. The signing secret is kept (unlike `PUT`, which issues a new one). Changing it clears the receiver-test proof.

Example: "https://siem.customer.example.com/ingest/productcraft-auth"

enabledboolean

`false` pauses export; `true` turns it back on and clears a stop after repeated failures. The position is kept either way: records written meanwhile are sent once export is on, within the audit log retention period.

Example: true

Response · 200 The updated sink.

id*string

Unique identifier of the audit sink.

app_id*string

The Auth app the audit sink belongs to.

url*string

HTTPS endpoint that receives the batched audit rows.

signing_secret_hint*string

Last 4 chars of the signing secret.

enabled*boolean

Whether the audit sink is enabled.

disabled_at*string · date-time

When the audit sink was disabled (ISO 8601), or `null` while enabled.

disabled_reason*string

`manual` (switched off by a caller) or `failing` (switched off after failed deliveries); `null` while enabled.

consecutive_failures*number

Failed deliveries in a row; a success resets it.

last_delivered_at*string · date-time

When a batch was last accepted (2xx) by the receiver.

state*object

`active`: sending. `paused`: switched off with `PATCH { enabled: false }`. `auto_disabled`: stopped after repeated failures (`disabled_reason` says which); `PATCH { enabled: true }` or a `PUT` turns it back on.

Example: "active"

last_attempt_at*string · date-time

Most recent POST to the receiver, accepted or not (a real batch or a test).

last_attempt_kind*object

`batch`: a real delivery. `test`: "Send test batch".

last_attempt_ok*boolean

Whether the receiver accepted the most recent attempt (2xx).

last_attempt_status_code*number

HTTP status of the most recent attempt; null when no response arrived (DNS, TLS, timeout, refused address).

Example: 200

last_error*string

Why the most recent attempt failed, in a short sentence; null after a success.

Example: "Your receiver answered HTTP 401: invalid signature"

last_test_succeeded_at*string · date-time

When the receiver last accepted a test batch. Cleared when the address or the signing secret changes.

created_at*string · date-time

When the audit sink was created (ISO 8601).

updated_at*string · date-time

When the audit sink was last changed (ISO 8601).

Example

Request

PATCH https://api.auth.productcraft.co/v1/apps/{app_id}/audit-sink
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

{
  "url": "https://siem.customer.example.com/ingest/productcraft-auth",
  "enabled": true
}

Response

{
  "id": "string",
  "app_id": "string",
  "url": "string",
  "signing_secret_hint": "string",
  "enabled": false,
  "disabled_at": "2026-01-01T00:00:00.000Z",
  "disabled_reason": "string",
  "consecutive_failures": 0,
  "last_delivered_at": "2026-01-01T00:00:00.000Z",
  "state": "active",
  "last_attempt_at": "2026-01-01T00:00:00.000Z",
  "last_attempt_kind": {},
  "last_attempt_ok": false,
  "last_attempt_status_code": 200,
  "last_error": "Your receiver answered HTTP 401: invalid signature",
  "last_test_succeeded_at": "2026-01-01T00:00:00.000Z",
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}