AuditCakeDevelopersBook a walkthrough

Update an audit

Correct the details previously sent — a mistyped policy number, a new working contact, a revised estimate — or withdraw an audit no longer needed.

PATCHhttps://auditcake.com/api/v1/audits/:id

:id is the auditCode or the caller's own carrierControlId, same as the read endpoint. Send only the fields to change — anything omitted is left as-is. AuditCake re-cleans contacts on the way in (names parsed, emails typo-corrected, phones converted to E.164) and returns the updated audit in the same shape the read endpoint uses.

Editable fields

Any field supplied at create time can be changed here, using the same names and nesting:

FieldNotes
policynumber, termStart, termEnd, estimatedPremium.
insuredlegalName, dbaName, fein.
location.addressAny of line1, line2, city, state, zip.
agencyname, agencyCode, and an agent contact (name / email / phone).
workingContactname, email, phone, role.
sourcesorderNumber, referenceNumber, accountNumber. The carrierControlId is fixed and cannot be changed.
auditWindowAny of the audit-period and key-date fields.
classCodesRevise the estimated exposure of an existing class code — [{ "code": "10220", "estimatedExposure": "600000.00" }]. Adding or removing a class code isn't supported here — contact AuditCake.

AuditCake runs the audit's workflow for you — but if you operate the audit yourself, you can also provide the insured's reported figures and advance its status through to SUBMITTED over the API (see below), or withdraw it (cancellation, further below).

Provide data & advance the audit

If you operate the audit end-to-end yourself, the same PATCH can supply the insured's reported figures and move the audit forward through its workflow states. Send bakeState with the next state; AuditCake validates the progression and rejects an out-of-order jump with 409. Provide the reported figures alongside it:

FieldForNotes
insuredCategoriesSales audits[{ "id": "food", "label": "Food", "sales": "250000.00" }] — the insured's reported sales per category.
employees / payrollTotalsPayroll auditsThe reported per-employee wages and/or the payroll summary.
bakeStateAllThe next workflow state, e.g. "CONTACTING" then "SUBMITTED". Progression is validated; reaching SUBMITTED queues the audit for review.
# 1) open the audit for input
curl -X PATCH https://auditcake.com/api/v1/audits/K7M4PQ \
  -H "x-api-key: ack_live_<api-key>" -H "Content-Type: application/json" \
  -d '{ "bakeState": "CONTACTING" }'

# 2) provide the reported figures and submit
curl -X PATCH https://auditcake.com/api/v1/audits/K7M4PQ \
  -H "x-api-key: ack_live_<api-key>" -H "Content-Type: application/json" \
  -d '{
    "bakeState": "SUBMITTED",
    "insuredCategories": [{ "id": "food", "label": "Food", "sales": "250000.00" }]
  }'

Documents are attached separately (see Add & read documents). Once an audit reaches SUBMITTED you can run an AI Review on it.

curl -X PATCH https://auditcake.com/api/v1/audits/K7M4PQ \
  -H "x-api-key: ack_live_<carrier-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "policy": { "number": "GL-555-0099" },
    "workingContact": { "name": "Samuel Vimes", "email": "sam@example.com" },
    "classCodes": [{ "code": "10220", "estimatedExposure": "600000.00" }]
  }'

The response is the full, updated audit — the same shape as GET /audits/:id.

Cancel an audit

Send cancel to withdraw an audit. Pass true, or an object with a reason AuditCake records on the timeline.

curl -X PATCH https://auditcake.com/api/v1/audits/K7M4PQ \
  -H "x-api-key: ack_live_<carrier-api-key>" \
  -H "Content-Type: application/json" \
  -d '{ "cancel": { "reason": "Policy cancelled flat" } }'

The audit moves to status: "CANCELLED". An audit that has already been sent back to the carrier or invoiced can no longer be cancelled through the API — that returns 409.

Error responses

StatusMeaning
401The x-api-key header is missing or not recognized.
404No audit with that id falls within the calling key's scope.
409The requested change isn't allowed for the audit's current state (e.g. cancelling an already-invoiced audit).
500An unexpected error on AuditCake's side. Safe to retry.
Next: Add & read documents →