{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/atlar/json-schema/atlar-connection-report-schema.json",
  "title": "ConnectionReport",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/atlar-connections-api-openapi.yml#/components/schemas/ConnectionReport",
  "type": "object",
  "properties": {
    "organizationId": {
      "$ref": "#/$defs/OrganizationID",
      "readOnly": true
    },
    "connectionId": {
      "$ref": "#/$defs/ResourceID",
      "readOnly": true
    },
    "id": {
      "$ref": "#/$defs/ResourceID",
      "readOnly": true
    },
    "details": {
      "$ref": "#/$defs/ConnectionReportDetails"
    },
    "content": {
      "$ref": "#/$defs/ContentMetadata"
    },
    "converted": {
      "type": "boolean"
    },
    "thirdPartyCodes": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The third parties this report holds data for.\n\nTypically, the bank BICs occurring in the report, for example an end-of-day\nreport carrying several statements, each reporting for one BIC.\nReports from parties without a BIC, such as PSPs and ERPs, use a\nsynthetic code instead, for example `PSP_AIRWALLEX`.\n",
      "x-omitempty": true
    },
    "metadata": {
      "$ref": "#/$defs/Metadata"
    },
    "version": {
      "$ref": "#/$defs/ResourceVersion"
    },
    "etag": {
      "$ref": "#/$defs/ETag"
    },
    "created": {
      "$ref": "#/$defs/CreatedTimestamp"
    },
    "updated": {
      "$ref": "#/$defs/UpdatedTimestamp"
    }
  },
  "required": [
    "organizationId",
    "connectionId",
    "id",
    "details",
    "content",
    "converted",
    "created",
    "updated",
    "version",
    "etag"
  ],
  "$defs": {
    "ConnectionReportDetails": {
      "type": "object",
      "oneOf": [
        {
          "$ref": "#/$defs/ConnectionReportStatementDetails"
        }
      ]
    },
    "ConnectionReportStatementDetails": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/$defs/ReportType"
        },
        "statementType": {
          "$ref": "#/$defs/StatementType"
        }
      },
      "required": [
        "type",
        "statementType"
      ]
    },
    "ContentMetadata": {
      "description": "Metadata describing the contents that was retrieved over the Connection.",
      "type": "object",
      "readOnly": true,
      "properties": {
        "contentType": {
          "$ref": "#/$defs/ContentType"
        },
        "size": {
          "type": "integer",
          "format": "int64",
          "description": "The size of the input content in bytes.\n"
        },
        "checksum": {
          "type": "string",
          "description": "A checksum of the batch input contents.\n\nThe checksum digest value will be prefixed by an\nidentifier of the hash algorithm used, e.g. `sha256`. A\ncolon `:` is used as separator between the algorithm\nidentifier and the digest value.\n"
        },
        "name": {
          "type": "string",
          "description": "The name of the content that retrieved over the connection.\n\nIf the connection is a file transfer, the filename will be used.\n\nIf the third-party does not provide a name, Atlar will create one.\n"
        }
      },
      "required": [
        "name",
        "contentType",
        "size",
        "checksum"
      ]
    },
    "ContentType": {
      "type": "string",
      "description": "The content type of the data.",
      "enum": [
        "application/vnd.iso20022.pain.001.001.03+xml",
        "application/vnd.iso20022.pain.001.001.03.ch.02+xml",
        "application/vnd.iso20022.pain.001.001.09+xml",
        "application/vnd.iso20022.pain.001.001.09.ch.03+xml",
        "application/vnd.iso20022.pain.002.001.03+xml",
        "application/vnd.iso20022.pain.002.001.10+xml",
        "application/vnd.iso20022.pain.008.001.02+xml",
        "application/vnd.iso20022.pain.008.001.02.ch.03+xml",
        "application/vnd.iso20022.pain.008.001.03+xml",
        "application/vnd.iso20022.pain.008.001.08+xml",
        "application/vnd.iso20022.camt.052.001.02+xml",
        "application/vnd.iso20022.camt.052.001.03+xml",
        "application/vnd.iso20022.camt.052.001.04+xml",
        "application/vnd.iso20022.camt.052.001.08+xml",
        "application/vnd.iso20022.camt.053.001.02+xml",
        "application/vnd.iso20022.camt.053.001.03+xml",
        "application/vnd.iso20022.camt.053.001.04+xml",
        "application/vnd.iso20022.camt.053.001.08+xml",
        "application/vnd.iso20022.camt.053.001.10+xml",
        "application/vnd.iso20022.camt.053.001.11+xml",
        "application/vnd.iso20022.camt.054.001.02+xml",
        "application/vnd.iso20022.pacs.002.001.10+xml",
        "application/vnd.iso20022.pacs.008.001.02+xml",
        "application/vnd.iso20022.pacs.008.001.08+xml",
        "application/vnd.swift.mt.101",
        "application/vnd.swift.mt.103",
        "application/vnd.swift.mt.900",
        "application/vnd.swift.mt.940",
        "application/vnd.swift.mt.942",
        "application/vnd.bai.bai2",
        "application/vnd.bgc.autogiro.payee",
        "application/vnd.bgc.autogiro.payments.rejected",
        "application/vnd.bgc.autogiro.payments.spec",
        "application/vnd.bgc.autogiro.mandate",
        "application/vnd.bgc.payins.bgmax",
        "application/vnd.nacha.ach",
        "application/vnd.atlar.testbank.mandate+json",
        "application/vnd.atlar.testbank.transaction+json",
        "application/vnd.atlar.connectivity.proprietary",
        "application/vnd.atlar.connectivity.proprietary+json",
        "application/vnd.atlar.connectivity.proprietary+xml",
        "application/vnd.atlar.connectivity.proprietary+csv",
        "application/vnd.atlar.connectivity.v2.investment-statement+json",
        "application/vnd.atlar.connectivity.v2.accounting-statement+json",
        "application/vnd.atlar.connectivity.v2.fx-rate-statement+json",
        "application/vnd.atlar.connectivity.v2.benchmark-rate-statement+json",
        "application/vnd.atlar.connectivity.v2.statement+json",
        "application/vnd.atlar.connectivity.v2.statement+csv",
        "application/vnd.deutsche.wealth-online+csv",
        "application/vnd.m2.m006.m001+xml",
        "application/vnd.m2.m006.m005+xml",
        "application/vnd.ebics.htd.v30+xml",
        "application/vnd.ebics.hac.v25+xml",
        "application/vnd.ebics.hac.v30+xml",
        "application/vnd.jpm.daily-feed+zip",
        "application/vnd.jpm.morgan-money.balance-report+csv",
        "application/vnd.jpm.morgan-money.transaction-report+csv",
        "application/vnd.jpm.soci.holdings+csv",
        "application/vnd.jpm.soci.transactions+csv",
        "application/vnd.nordea.investments.abasec.pos+csv",
        "application/vnd.nordea.investments.abasec.tra+csv",
        "application/vnd.ms-excel",
        "application/x-ofx",
        "application/json",
        "application/zip",
        "application/pdf",
        "text/plain",
        "text/csv",
        "application/vnd.edi.820",
        "application/vnd.edi.824",
        "application/vnd.edi.997"
      ]
    },
    "CreatedTimestamp": {
      "type": "string",
      "format": "date-time",
      "description": "Time at which the resource was created.",
      "readOnly": true
    },
    "ETag": {
      "type": "string",
      "description": "[ETag](https://en.wikipedia.org/wiki/HTTP_ETag) based on the\nresource version. This can be passed along in `If-Match` HTTP\nheader when updating a resource to perform a conditional\nupdate.",
      "pattern": "^version:\\d{1,4}$",
      "readOnly": true
    },
    "Metadata": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": "string"
      },
      "description": "Metadata is a `string-string` key-value container that\ncan be used to store information known at the time of resource\ncreation. This can be retrieved later on, for instance when a\npayment or expected transaction is reconciled with the booked\ntransaction on the bank statement.\n\nMetadata can have at most 20 entries. Keys may have a\nmaximum length of 64 chars and values a maximum length of 512\nchars.\n\nBy default, this field is optional. It is possible to make it\nrequired in the Atlar Dashboard by visiting the [Metadata keys\npage](https://app.atlar.com/metadata-keys). Requirement rules\ncan be specified per API resource. Both the Dashboard and the\nAPI will then enforce these rules and give validation errors\nwhen the required fields are not set.",
      "maxProperties": 20,
      "x-omitempty": true
    },
    "OrganizationID": {
      "type": "string",
      "description": "Unique resource identifier for an Organization."
    },
    "ReportType": {
      "type": "string",
      "description": "The type of the report.",
      "enum": [
        "STATEMENT",
        "INVESTMENT",
        "ACCOUNTING",
        "FX_RATES",
        "PAYMENT_STATUS",
        "BENCHMARK_RATES",
        "ACCOUNTS",
        "OTHER"
      ]
    },
    "ResourceID": {
      "type": "string",
      "description": "Unique resource identifier.",
      "minLength": 32,
      "maxLength": 64
    },
    "ResourceVersion": {
      "type": "integer",
      "description": "Resource version. Starts at value `1` when the resource is\ncreated and increases by one for each successive update.",
      "minimum": 1,
      "readOnly": true
    },
    "StatementType": {
      "type": "string",
      "enum": [
        "BOOKED",
        "PENDING"
      ]
    },
    "UpdatedTimestamp": {
      "type": "string",
      "format": "date-time",
      "description": "Time at which the resource was last updated.",
      "readOnly": true
    }
  }
}