{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/SyncStatusResult",
  "title": "Sync status",
  "type": "object",
  "description": "Represents the status of a managed bank feed sync.",
  "properties": {
    "syncId": {
      "type": "string",
      "format": "uuid",
      "description": "The unique identifier for the sync."
    },
    "clientId": {
      "type": "string",
      "format": "uuid",
      "description": "The ID of the client associated with the company that owns the source bank account."
    },
    "companyId": {
      "type": "string",
      "format": "uuid",
      "description": "The ID of the company that owns the source bank account."
    },
    "companyName": {
      "type": "string",
      "description": "The name of the company that owns the source bank account."
    },
    "dataConnectionId": {
      "type": "string",
      "format": "uuid",
      "description": "The ID of the target accounting data connection."
    },
    "sourceAccountId": {
      "type": "string",
      "description": "The ID of the source bank account from which transactions are fetched."
    },
    "periodStartUtc": {
      "type": "string",
      "format": "date-time",
      "description": "The start of the sync period."
    },
    "periodEndUtc": {
      "type": "string",
      "format": "date-time",
      "description": "The end of the sync period."
    },
    "executionStartUtc": {
      "type": "string",
      "format": "date-time",
      "description": "The UTC timestamp when the sync started executing."
    },
    "status": {
      "type": "string",
      "description": "The current status of the sync. Known values are `Started`, `Failed`, `SuccessDataPushed`, `SuccessNoDataPushed`, `PartialSuccessDataPushed`.",
      "example": "SuccessDataPushed"
    },
    "executionEndUtc": {
      "type": "string",
      "format": "date-time",
      "nullable": true,
      "description": "The UTC timestamp when the sync execution ended, if completed (i.e. `status` is any value other than `Started`)."
    },
    "errorMessage": {
      "type": "string",
      "nullable": true,
      "description": "Error message if the sync failed."
    },
    "errorCode": {
      "type": "string",
      "nullable": true,
      "description": "Error code if the sync failed."
    },
    "pushOperationKeys": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "nullable": true,
      "description": "List of write operation keys associated with the sync, if the sync resulted in write attempts."
    }
  },
  "required": [
    "syncId",
    "clientId",
    "companyId",
    "companyName",
    "dataConnectionId",
    "sourceAccountId",
    "periodStartUtc",
    "periodEndUtc",
    "executionStartUtc",
    "status"
  ]
}