Skip to main content
GET
/
api
/
v1
/
workspaces
/
{workspaceId}
/
submissions
/
{submissionId}
/
audit-trail
Get Submission Audit Trail
curl --request GET \
  --url https://api.example.com/api/v1/workspaces/{workspaceId}/submissions/{submissionId}/audit-trail
{
  "submissionId": "<string>",
  "templateId": "<string>",
  "templateName": "<string>",
  "locationId": "<string>",
  "locationName": "<string>",
  "completionRecord": {
    "status": "<string>",
    "score": 123,
    "rating": "<string>",
    "totalItems": 123,
    "completedItems": 123,
    "flaggedItems": 123
  },
  "timestamps": {
    "startedAt": "<string>",
    "submittedAt": "<string>",
    "lastEditedAt": "<string>",
    "signedOffAt": "<string>"
  },
  "completedBy": {
    "userId": "<string>",
    "name": "<string>",
    "role": "<string>",
    "email": "<string>"
  },
  "flags": [
    {
      "itemId": "<string>",
      "itemLabel": "<string>",
      "response": "<string>",
      "note": "<string>",
      "photoUrls": [
        {}
      ],
      "correctiveActionId": "<string>",
      "flaggedAt": "<string>"
    }
  ],
  "correctiveActions": [
    {
      "id": "<string>",
      "title": "<string>",
      "assignedTo": {},
      "status": "<string>",
      "createdAt": "<string>",
      "resolvedAt": "<string>",
      "triggeredByItemId": "<string>"
    }
  ],
  "editHistory": [
    {
      "editId": "<string>",
      "editedBy": {},
      "editedAt": "<string>",
      "itemId": "<string>",
      "itemLabel": "<string>",
      "previousValue": "<string>",
      "newValue": "<string>",
      "reason": "<string>"
    }
  ],
  "signature": {
    "signedBy": "<string>",
    "userId": "<string>",
    "signedAt": "<string>",
    "signatureUrl": "<string>"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.xenia.team/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The audit trail endpoint provides a full chronological record of every action taken on a submission from initiation to final sign-off. This includes who completed each item, when it was completed, what was flagged, what corrective actions were triggered, and any edits made after initial submission. All audit trail records are append-only and immutable. Records cannot be deleted or altered via the API.
Audit trail records are retained for a minimum of 7 years in compliance with standard operational record-keeping requirements.

Path Parameters

workspaceId
string
required
The unique identifier of your workspace.
submissionId
string
required
The unique identifier of the submission to retrieve the audit trail for.

Query Parameters

includeEdits
boolean
default:"true"
Include post-submission edit records in the response.
includeCorrectiveActions
boolean
default:"true"
Include corrective actions triggered by failed or flagged items.

Response Fields

submissionId
string
Unique identifier of the submission.
templateId
string
The template this submission was created from.
templateName
string
Display name of the template.
locationId
string
The location where the submission was completed.
locationName
string
Display name of the location.
completionRecord
object
Summary of the submission completion state.
timestamps
object
Key timestamps across the submission lifecycle.
completedBy
object
The user who completed and submitted the form.
flags
array
Array of items that triggered a flag, failed response, or corrective action.
correctiveActions
array
Array of corrective tasks automatically created from flagged items.
editHistory
array
Append-only log of all post-submission edits. Empty array if no edits have occurred.
signature
object
Digital signature record if the template required sign-off.

Example Request

curl https://api.xenia.team/api/v1/workspaces/:workspaceId/submissions/:submissionId/audit-trail \
  -H "Authorization: <your-token>" \
  -H "Content-Type: application/json"

Example Response

{
  "submissionId": "sub_xxxxxxxx",
  "templateId": "tpl_xxxxxxxx",
  "templateName": "Daily Operations Audit",
  "locationId": "loc_xxxxxxxx",
  "locationName": "Location Name",
  "completionRecord": {
    "status": "submitted",
    "score": 87.5,
    "rating": "Silver",
    "totalItems": 12,
    "completedItems": 12,
    "flaggedItems": 2
  },
  "timestamps": {
    "startedAt": "2026-01-15T09:14:22Z",
    "submittedAt": "2026-01-15T09:31:08Z",
    "lastEditedAt": "2026-01-15T10:02:45Z",
    "signedOffAt": "2026-01-15T09:30:57Z"
  },
  "completedBy": {
    "userId": "usr_xxxxxxxx",
    "name": "Jane Smith",
    "role": "Field Auditor",
    "email": "jane.smith@yourcompany.com"
  },
  "flags": [
    {
      "itemId": "item_xxxxxxxx",
      "itemLabel": "Equipment temperature within safe range?",
      "response": "No",
      "note": "Temperature reading below required threshold",
      "photoUrls": [
        "https://storage.xenia.team/photos/signed/ph_xxxxxxxx..."
      ],
      "correctiveActionId": "ca_xxxxxxxx",
      "flaggedAt": "2026-01-15T09:22:11Z"
    }
  ],
  "correctiveActions": [
    {
      "id": "ca_xxxxxxxx",
      "title": "Temperature non-compliance — requires immediate review",
      "assignedTo": {
        "userId": "usr_xxxxxxxx",
        "name": "John Manager",
        "role": "Operations Manager"
      },
      "status": "open",
      "createdAt": "2026-01-15T09:22:11Z",
      "resolvedAt": null,
      "triggeredByItemId": "item_xxxxxxxx"
    }
  ],
  "editHistory": [
    {
      "editId": "edit_xxxxxxxx",
      "editedBy": {
        "userId": "usr_xxxxxxxx",
        "name": "Jane Smith",
        "role": "Field Auditor",
        "email": "jane.smith@yourcompany.com"
      },
      "editedAt": "2026-01-15T10:02:45Z",
      "itemId": "item_xxxxxxxx",
      "itemLabel": "PPE compliance confirmed?",
      "previousValue": "No",
      "newValue": "Yes",
      "reason": "Item corrected before audit window closed"
    }
  ],
  "signature": {
    "signedBy": "Jane Smith",
    "userId": "usr_xxxxxxxx",
    "signedAt": "2026-01-15T09:30:57Z",
    "signatureUrl": "https://storage.xenia.team/signatures/signed/sig_xxxxxxxx..."
  }
}
Photo and signature URLs are signed and expire after 24 hours. If you need persistent access to media assets, download and store files in your own infrastructure after retrieval.