{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/contraforce/json-schema/contraforce-export-audit-response-schema.json",
  "title": "ExportAuditResponse",
  "description": "Response envelope for the workspace audit-export endpoint.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/contraforce-export-api-openapi.yml#/components/schemas/ExportAuditResponse",
  "required": [
    "value"
  ],
  "type": "object",
  "properties": {
    "value": {
      "type": [
        "null",
        "array"
      ],
      "items": {
        "description": "One workspace audit event in the machine-export shape.",
        "$ref": "#/$defs/ExportedAuditEventDto"
      },
      "description": "The audit events in this page."
    },
    "nextPageToken": {
      "type": [
        "null",
        "string"
      ],
      "description": "URL-safe token for the next page, or `null` when this is the last page."
    }
  },
  "$defs": {
    "ExportedAuditEventDto": {
      "required": [
        "id",
        "timeGenerated",
        "workspaceId",
        "discriminator",
        "activityType",
        "activityAction",
        "actorId",
        "targetResourceType",
        "targetResourceId"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The audit entry's unique id.",
          "format": "uuid"
        },
        "timeGenerated": {
          "type": "string",
          "description": "When the audited activity happened (UTC).",
          "format": "date-time"
        },
        "workspaceId": {
          "type": "string",
          "description": "The ContraForce workspace the event belongs to.",
          "format": "uuid"
        },
        "activityType": {
          "type": [
            "null",
            "string"
          ],
          "description": "The activity type name, e.g. `WorkspaceRoleChanged`."
        },
        "activityAction": {
          "type": [
            "null",
            "string"
          ],
          "description": "The activity action name, e.g. `Update`."
        },
        "actorId": {
          "type": "string",
          "description": "The id of the user or agent that performed the activity.",
          "format": "uuid"
        },
        "actorName": {
          "type": [
            "null",
            "string"
          ],
          "description": "The display name of the actor, when recorded."
        },
        "actorEmail": {
          "type": [
            "null",
            "string"
          ],
          "description": "The email of the actor, when recorded."
        },
        "targetResourceType": {
          "type": [
            "null",
            "string"
          ],
          "description": "The type of the resource the activity targeted, e.g. `Incident` or `User`."
        },
        "targetResourceId": {
          "type": [
            "null",
            "string"
          ],
          "description": "The id of the resource the activity targeted."
        },
        "targetResourceName": {
          "type": [
            "null",
            "string"
          ],
          "description": "The human-readable name of the target resource, when recorded."
        },
        "metadata": {
          "type": [
            "null",
            "string"
          ],
          "description": "The entry's activity-specific metadata serialized as a JSON string (including its\n`$type` discriminator), or `null` when the entry carries none."
        }
      },
      "description": "One workspace audit event in the machine-export shape."
    }
  }
}