{
  "info": {
    "title": "Consumer Check Monitor API",
    "contact": {
      "url": "https://www.enento.com",
      "name": "Enento Group",
      "email": "integration@uc.se"
    },
    "version": "V1",
    "description": "With our Consumer Check Monitor API you can monitor changes directly from SPAR.\n\nThe service helps you to always have correct customer data if they e.g. move, change name, decease, have protected identity etc.\n\n# Authentication \n\nGet access_token for machine user to apply as authorization header in API requests\n\n```\nAuthorization: Bearer <access_token>\n```\n\n## access_token for Production\n```\ncurl --location 'https://login.niam.enento.com/am/oauth2/customers/access_token' \\\n--header 'Content-Type: application/x-www-form-urlencoded' \\\n--data-urlencode 'grant_type=password' \\\n--data-urlencode 'client_id=m2m_authentication_client' \\\n--data-urlencode 'username=<YOUR_PROD_CLIENT_ID>' \\\n--data-urlencode 'password=<YOUR_PROD_CLIENT_SECRET>'\n```\n## access_token for Test\n```\ncurl --location 'https://preprod.niam.enento.com/am/oauth2/customers/access_token' \\\n--header 'Content-Type: application/x-www-form-urlencoded' \\\n--data-urlencode 'grant_type=password' \\\n--data-urlencode 'client_id=m2m_authentication_client' \\\n--data-urlencode 'username=<YOUR_TEST_CLIENT_ID>' \\\n--data-urlencode 'password=<YOUR_TEST_CLIENT_SECRET>'\n```"
  },
  "paths": {
    "/persons": {
      "get": {
        "tags": [
          "Person get"
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonsCollection"
                },
                "examples": {
                  "#consumerCheck:first": {
                    "value": {
                      "href": "https://example.com/persons?filter.dataOwner.customerId.eq=SE55612345678&filter.dataOwner.sparId.eq=513549-27355-8563c56a-5ef4-4429-bd8a-96165355f49f&filter.lastModifiedAt.gte=2022-11-30T12:00:00.000Z",
                      "next": {
                        "href": "https://example.com/persons?filter.dataOwner.customerId.eq=SE55612345678&filter.dataOwner.sparId.eq=513549-27355-8563c56a-5ef4-4429-bd8a-96165355f49f&filter.lastModifiedAt.gte=2022-12-01T12:00:00.000Z"
                      },
                      "items": [
                        {
                          "name": {
                            "lastName": "string",
                            "firstNames": [
                              "string"
                            ],
                            "middleName": "string",
                            "preferredFirstName": "string"
                          },
                          "gender": "MALE",
                          "history": {
                            "names": [
                              {
                                "dateTo": "2022-01-01",
                                "dateFrom": "2020-01-01",
                                "lastName": "string",
                                "firstNames": [
                                  "string"
                                ],
                                "middleName": "string",
                                "preferredFirstName": "string"
                              }
                            ],
                            "changes": [
                              {
                                "fields": [
                                  "name.firstnames",
                                  "addresses.civilRegistrastionAddress.swedishAddress.postCode"
                                ],
                                "timestamp": "2023-11-24T10:00:00Z"
                              },
                              {
                                "fields": [
                                  "addresses.civilRegistrastionAddress.swedishAddress.addressLines"
                                ],
                                "timestamp": "2023-11-11T10:00:00Z"
                              }
                            ],
                            "addresses": {
                              "contactAddresses": {
                                "swedishAddresses": [
                                  {
                                    "careOf": "string",
                                    "dateTo": "2022-01-01",
                                    "dateFrom": "2019-01-01",
                                    "postCode": "54748",
                                    "postTown": "string",
                                    "addressLines": [
                                      "string"
                                    ]
                                  }
                                ],
                                "internationalAddresses": [
                                  {
                                    "dateTo": "2022-01-01",
                                    "country": "string",
                                    "dateFrom": "2019-01-01",
                                    "addressLines": [
                                      "string"
                                    ]
                                  }
                                ]
                              },
                              "foreignAddresses": {
                                "internationalAddresses": [
                                  {
                                    "dateTo": "2021-01-01",
                                    "country": "string",
                                    "dateFrom": "2019-01-01",
                                    "addressLines": [
                                      "string"
                                    ]
                                  }
                                ]
                              },
                              "specialPostAddresses": {
                                "swedishAddresses": [
                                  {
                                    "careOf": "string",
                                    "dateTo": "2022-01-01",
                                    "dateFrom": "2020-01-01",
                                    "postCode": "54748",
                                    "postTown": "string",
                                    "addressLines": [
                                      "string"
                                    ]
                                  }
                                ],
                                "internationalAddresses": [
                                  {
                                    "dateTo": "2019-12-31",
                                    "country": "string",
                                    "dateFrom": "2019-01-01",
                                    "addressLines": [
                                      "string"
                                    ]
                                  }
                                ]
                              },
                              "civilRegistrationAddresses": {
                                "swedishAddresses": [
                                  {
                                    "careOf": "string",
                                    "dateTo": "2022-01-01",
                                    "dateFrom": "2019-01-01",
                                    "postCode": "54748",
                                    "postTown": "string",
                                    "addressLines": [
                                      "string"
                                    ]
                                  }
                                ]
                              }
                            },
                            "relations": [
                              {
                                "name": {
                                  "lastName": "string",
                                  "firstNames": [
                                    "string"
                                  ],
                                  "middleName": "string",
                                  "preferredFirstName": "string"
                                },
                                "dateTo": "2019-01-01",
                                "legalId": "string",
                                "dateFrom": "2000-01-01",
                                "birthDate": "1980-06-16",
                                "relationType": "SPOUSE_REGISTERED_PARTNER",
                                "deregistration": {
                                  "deceasedDate": "string",
                                  "foundDeadDate": "string",
                                  "deregisteredDate": "string",
                                  "causeOfDeregistration": "DECEASED"
                                }
                              }
                            ],
                            "civilRegistrations": [
                              {
                                "county": "string",
                                "dateTo": "2019-01-01",
                                "dateFrom": "1970-01-01",
                                "district": "string",
                                "residency": "REGISTERED_ON_ADDRESS",
                                "countyCode": "78",
                                "districtCode": "504263",
                                "municipality": "string",
                                "municipalityCode": "92",
                                "registrationDate": "2022-06-16"
                              }
                            ],
                            "immunityNumberDetails": [
                              {
                                "causeOfHibernation": "REPLACED",
                                "declaredHibernatedDate": "2023-01-01"
                              }
                            ],
                            "coordinationNumberDetails": [
                              {
                                "dateTo": "2019-01-01",
                                "dateFrom": "2019-01-01",
                                "renewalDate": "string",
                                "assignedDate": "string",
                                "deceasedDate": "string",
                                "identityLevel": "VERIFIED",
                                "identityLevelDate": "2019-01-01",
                                "causeOfHibernation": "DECEASED",
                                "declaredHibernatedDate": "string",
                                "preliminaryHibernationDate": "string"
                              }
                            ]
                          },
                          "identity": {
                            "type": "PERSONAL_IDENTITY_NUMBER",
                            "personId": "199901610123"
                          },
                          "addresses": {
                            "contactAddress": {
                              "swedishAddress": {
                                "careOf": "string",
                                "postCode": "54748",
                                "postTown": "string",
                                "addressLines": [
                                  "string"
                                ]
                              },
                              "internationalAddress": {
                                "country": "string",
                                "addressLines": [
                                  "string"
                                ]
                              }
                            },
                            "foreignAddress": {
                              "internationalAddress": {
                                "country": "string",
                                "addressLines": [
                                  "string"
                                ]
                              }
                            },
                            "specialPostAddress": {
                              "swedishAddress": {
                                "careOf": "string",
                                "postCode": "58542",
                                "postTown": "string",
                                "addressLines": [
                                  "string"
                                ]
                              },
                              "internationalAddress": {
                                "country": "string",
                                "addressLines": [
                                  "string"
                                ]
                              }
                            },
                            "civilRegistrationAddress": {
                              "swedishAddress": {
                                "careOf": "string",
                                "postCode": "21944",
                                "postTown": "string",
                                "addressLines": [
                                  "string"
                                ]
                              }
                            }
                          },
                          "birthDate": "2022-06-16",
                          "relations": [
                            {
                              "name": {
                                "lastName": "string",
                                "firstNames": [
                                  "string"
                                ],
                                "middleName": "string",
                                "preferredFirstName": "string"
                              },
                              "legalId": "string",
                              "birthDate": "2022-06-16",
                              "relationType": "SPOUSE_REGISTERED_PARTNER",
                              "deregistration": {
                                "deceasedDate": "string",
                                "foundDeadDate": "string",
                                "deregisteredDate": "string",
                                "causeOfDeregistration": "DECEASED"
                              }
                            }
                          ],
                          "deregistration": {
                            "deceasedDate": "string",
                            "foundDeadDate": "string",
                            "deregisteredDate": "",
                            "causeOfDeregistration": "DECEASED"
                          },
                          "civilRegistration": {
                            "county": "string",
                            "district": "string",
                            "residency": "REGISTERED_ON_ADDRESS",
                            "countyCode": "78",
                            "districtCode": "504263",
                            "municipality": "string",
                            "municipalityCode": "92",
                            "registrationDate": "2022-06-16"
                          },
                          "lastUpdatedInSPAR": "2022-06-16",
                          "protectedIdentity": true,
                          "personIdReferences": [
                            {
                              "personId": "string",
                              "referenceType": "FROM"
                            }
                          ],
                          "immunityNumberDetails": {
                            "causeOfHibernation": "REPLACED",
                            "declaredHibernatedDate": "2023-01-01"
                          },
                          "protectedIdentityDate": "2022-06-16",
                          "coordinationNumberDetails": {
                            "renewalDate": "string",
                            "assignedDate": "string",
                            "deceasedDate": "string",
                            "identityLevel": "VERIFIED",
                            "identityLevelDate": "2019-01-01",
                            "causeOfHibernation": "DECEASED",
                            "declaredHibernatedDate": "string",
                            "preliminaryHibernationDate": "string"
                          }
                        }
                      ],
                      "limit": "500",
                      "offset": "1"
                    }
                  }
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "cost-org",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "The customer/organisation which is responsible for costs of this API call."
          },
          {
            "in": "query",
            "name": "filter.dataOwner.sparId.eq",
            "schema": {
              "type": "string",
              "pattern": "^\\d{6}-\\d+-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            },
            "required": true,
            "description": "Spar ID of the customer requesting SPAR data."
          },
          {
            "in": "query",
            "name": "filter.lastModifiedAt.gte",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "YYYY-MM-ddThh:mm:ssZ"
            },
            "required": false,
            "description": "From when to get data."
          },
          {
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "required": false,
            "description": "Number of records to skip."
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "required": false,
            "description": "limit of number of records to receive."
          }
        ],
        "operationId": "getPerson"
      }
    },
    "/persons-monitored": {
      "put": {
        "tags": [
          "Manage"
        ],
        "summary": "Send list of personal ids for persons you want to monitor",
        "responses": {
          "200": {
            "description": "OK\n\nAll items have been successfully saved"
          },
          "207": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rejectedItems": {
                      "type": "array",
                      "items": {
                        "allOf": [
                          {
                            "$ref": "#/components/schemas/personMonitored"
                          }
                        ]
                      }
                    }
                  }
                }
              }
            },
            "description": "MULTI_STATUS\n\nThe list of items contained bad input data. See body for a complete list of items that failed.\nSee error field for the reason.\n\nItems that are not present in the response have been successfully saved."
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/cost-org"
          }
        ],
        "description": "Send list of personal ids for persons you want to monitor.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/dataOwner"
                  },
                  {
                    "$ref": "#/components/schemas/personsMonitoredCollection"
                  }
                ],
                "example": {
                  "items": [
                    {
                      "personId": "191212121212"
                    },
                    {
                      "personId": "201212121212"
                    }
                  ],
                  "dataOwner": {
                    "sparId": "542087-21595185239741982719857-2FaB41ce-F7BD-3fD2-e113-38c6f6A00a46"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Manage"
        ],
        "summary": "Send list of personal ids for the persons you do not want to monitor anymore",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/cost-org"
          }
        ],
        "description": "Send list of personal ids for the persons you do not want to monitor anymore.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/dataOwner"
                  },
                  {
                    "$ref": "#/components/schemas/personsMonitoredCollection"
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/persons-monitored/getCollection": {
      "post": {
        "tags": [
          "Manage"
        ],
        "summary": "Returns a list of person id(s) that is already being monitored",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/personsMonitoredCollection"
                    }
                  ]
                }
              }
            },
            "description": "OK"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/cost-org"
          }
        ],
        "description": "Returns a list of person id(s) that is already being monitored.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/filter"
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/persons-monitored/batch-jobs/trigger": {
      "post": {
        "tags": [
          "Batch-jobs"
        ],
        "summary": "Triggers the jobs for the specified sparId",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "description": "Triggers the jobs for the specified sparId.\n\nOnly available in test environment.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/filterDataOwner"
                  }
                ]
              }
            }
          }
        }
      }
    }
  },
  "openapi": "3.0.3",
  "servers": [
    {
      "url": "https://se.api.enento.com/se",
      "description": "Production environment"
    },
    {
      "url": "https://se-at.api-test.enento.com/se",
      "description": "Test environment"
    }
  ],
  "security": [
    {
      "bearerToken": []
    }
  ],
  "components": {
    "schemas": {
      "Name": {
        "type": "object",
        "properties": {
          "lastName": {
            "type": "string",
            "description": "Last name"
          },
          "firstNames": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "A list of all first names."
          },
          "middleName": {
            "type": "string",
            "description": "The name between first and last name. Can for example be the maiden name"
          },
          "preferredFirstName": {
            "type": "string",
            "description": "The first name to use when addressing or referring to the person."
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "A message describing the error"
          },
          "parameter": {
            "type": "string",
            "description": "The parameters that the error concerns"
          },
          "violations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Violation"
            },
            "description": "A list of violations"
          },
          "rejectedValue": {
            "type": "string",
            "description": "The value that got rejected"
          }
        }
      },
      "Person": {
        "type": "object",
        "required": [
          "identity",
          "protectedIdentity"
        ],
        "properties": {
          "name": {
            "$ref": "#/components/schemas/Name"
          },
          "gender": {
            "enum": [
              "MALE",
              "FEMALE"
            ],
            "type": "string"
          },
          "changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Changes"
            }
          },
          "history": {
            "$ref": "#/components/schemas/History"
          },
          "identity": {
            "$ref": "#/components/schemas/Identity"
          },
          "addresses": {
            "$ref": "#/components/schemas/Addresses"
          },
          "birthDate": {
            "type": "string",
            "format": "date",
            "description": "The date the person was born. Can be missing if the birth date is unknown."
          },
          "relations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Relation"
            }
          },
          "deregistration": {
            "$ref": "#/components/schemas/Deregistration"
          },
          "civilRegistration": {
            "$ref": "#/components/schemas/CivilRegistration"
          },
          "lastUpdatedInSPAR": {
            "type": "string",
            "format": "date",
            "description": "The date information about the person was changed in SPAR."
          },
          "protectedIdentity": {
            "type": "boolean",
            "description": "Indicates whether a person have a protected identity.\n\nPersonal information for people with protected identity is only handed out to organisations with special permission to view this information."
          },
          "personIdReferences": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PersonIdReference"
            }
          },
          "immunityNumberDetails": {
            "$ref": "#/components/schemas/ImmunityNumberDetails"
          },
          "protectedIdentityDate": {
            "type": "string",
            "format": "date",
            "description": "The date this persons identity was protected."
          },
          "coordinationNumberDetails": {
            "$ref": "#/components/schemas/CoordinationNumberDetails"
          }
        }
      },
      "filter": {
        "type": "object",
        "properties": {
          "filter": {
            "allOf": [
              {
                "$ref": "#/components/schemas/filterDataOwner"
              },
              {
                "$ref": "#/components/schemas/filterMonitoredPerson"
              }
            ]
          }
        }
      },
      "Changes": {
        "type": "object",
        "properties": {
          "fields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "A list of all changes in a particular time."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "The time stamp when the changes occured to the person."
          }
        }
      },
      "History": {
        "type": "object",
        "properties": {
          "names": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoricalName"
            }
          },
          "addresses": {
            "$ref": "#/components/schemas/HistoricalAddresses"
          },
          "relations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoricalRelation"
            }
          },
          "deregistrations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoricalDeregistration"
            }
          },
          "civilRegistrations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoricalCivilRegistration"
            }
          },
          "immunityNumberDetails": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoricalImmunityNumberDetails"
            }
          },
          "coordinationNumberDetails": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoricalCoordinationNumberDetails"
            }
          }
        },
        "description": "Contains historical data about the person if it exists in SPAR."
      },
      "Identity": {
        "type": "object",
        "required": [
          "personId",
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "description": "Specifies the type for person Id.\n\nPossible values: [PERSONAL_IDENTITY_NUMBER, COORDINATION_NUMBER, IMMUNITY_NUMBER]\n\nMore values might be added in the future."
          },
          "personId": {
            "type": "string",
            "description": "Swedish personal id. Can be a personal identity number, a coordination number or an immunity number"
          }
        }
      },
      "Relation": {
        "type": "object",
        "required": [
          "relationType"
        ],
        "properties": {
          "name": {
            "$ref": "#/components/schemas/Name"
          },
          "personId": {
            "type": "string",
            "description": "Swedish personal id. Can be a personal identity number, a coordination number or an immunity number"
          },
          "birthDate": {
            "type": "string",
            "format": "date",
            "description": "The date the person was born. Can be missing if the birth date is unknown."
          },
          "relationType": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RelationType"
              }
            ]
          },
          "deregistration": {
            "$ref": "#/components/schemas/Deregistration"
          }
        },
        "description": "To receive this information additional permissions issued by SPAR is required"
      },
      "Addresses": {
        "type": "object",
        "properties": {
          "contactAddress": {
            "$ref": "#/components/schemas/ContactAddress"
          },
          "foreignAddress": {
            "$ref": "#/components/schemas/ForeignAddress"
          },
          "specialPostAddress": {
            "$ref": "#/components/schemas/SpecialPostAddress"
          },
          "civilRegistrationAddress": {
            "$ref": "#/components/schemas/CivilRegistrationAddress"
          }
        },
        "description": "Contains one or several addresses."
      },
      "DateRange": {
        "properties": {
          "dateTo": {
            "type": "string",
            "format": "date",
            "description": "Date when this information expired"
          },
          "dateFrom": {
            "type": "string",
            "format": "date",
            "description": "Date when this information was valid from"
          }
        }
      },
      "Residency": {
        "enum": [
          "REGISTERED_ON_ADDRESS",
          "REGISTERED_IN_MUNICIPALITY",
          "WITHOUT_KNOWN_RESIDENCY"
        ],
        "type": "string",
        "description": "Specifies where the person is registered",
        "discriminator": {
          "propertyName": "residency"
        }
      },
      "Violation": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "description": "The constraint that was violated"
          },
          "keyword": {
            "type": "string",
            "description": "Name of the violation"
          }
        }
      },
      "dataOwner": {
        "type": "object",
        "properties": {
          "dataOwner": {
            "required": [
              "sparId"
            ],
            "properties": {
              "sparId": {
                "type": "string",
                "pattern": "^\\d{6}-\\d+-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
                "description": "Spar ID of the customer requesting SPAR data."
              }
            }
          }
        }
      },
      "RelationType": {
        "enum": [
          "SPOUSE_REGISTERED_PARTNER",
          "LEGAL_GUARDIAN"
        ],
        "type": "string",
        "description": "Specifies the relationship between the persons",
        "discriminator": {
          "propertyName": "relationType"
        }
      },
      "IdentityLevel": {
        "enum": [
          "VERIFIED",
          "PROBABLE",
          "UNCERTAIN",
          "NOT_APPLICABLE"
        ],
        "type": "string",
        "description": "Identity Level.\n\nFor persons with a coordination number, the identity may be proven, probable or uncertain. Information to be provided and also proved by the person includes name, date of birth, place of birth and contact address.\n"
      },
      "ContactAddress": {
        "type": "object",
        "properties": {
          "swedishAddress": {
            "$ref": "#/components/schemas/SwedishAddress"
          },
          "internationalAddress": {
            "$ref": "#/components/schemas/InternationalAddress"
          }
        },
        "description": "The contact address for people with coordination numbers."
      },
      "Deregistration": {
        "type": "object",
        "properties": {
          "deceasedDate": {
            "type": "string",
            "example": [
              "2019-01-01",
              ",2019-00-00",
              "0000-00-00",
              "200101",
              "2001",
              "0"
            ],
            "description": "The date the person deceased. Only used when cause of deregistration is 'DECEASED'.\n\nNote: The date can be in an incomplete format"
          },
          "foundDeadDate": {
            "type": "string",
            "example": [
              "2019-01-01",
              ",2019-00-00",
              "0000-00-00",
              "200101",
              "2001",
              "0"
            ],
            "description": "The date the person was found dead. Used when deceasedDate is missing.\n\nNote: The date can be in an incomplete format"
          },
          "deregisteredDate": {
            "type": "string",
            "example": [
              "2019-01-01",
              ",2019-00-00",
              "0000-00-00",
              "200101",
              "2001",
              "0"
            ],
            "description": "The date of deregistration for this person.\n\nNote: The date can be in an incomplete format"
          },
          "causeOfDeregistration": {
            "type": "string",
            "description": "The cause of deregistration.\n\nPossible values are: [DECEASED, PREVIOUS_LEGAL_ID, EMIGRATED, ANNULMENT_OF_COORDINATION_NUMBER, MISSING, TECHNICAL_DEREGISTRATION, FAKE_IDENTITY, OTHER]\n\nMore values might be added in the future."
          }
        }
      },
      "ForeignAddress": {
        "type": "object",
        "properties": {
          "internationalAddress": {
            "$ref": "#/components/schemas/InternationalAddress"
          }
        },
        "description": "Last known address for civil registered people that have emigrated."
      },
      "HistoricalName": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/DateRange"
          },
          {
            "$ref": "#/components/schemas/Name"
          }
        ]
      },
      "SwedishAddress": {
        "type": "object",
        "properties": {
          "careOf": {
            "type": "string",
            "description": "C/O name"
          },
          "postCode": {
            "type": "string",
            "pattern": "[1-9]\\d{4}",
            "description": "Post code"
          },
          "postTown": {
            "type": "string",
            "description": "Post town"
          },
          "addressLines": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The physical address, street or corresponding data. Is empty if data is missing in SPAR."
          }
        },
        "description": "Details of an address in Sweden"
      },
      "filterDataOwner": {
        "type": "object",
        "required": [
          "dataOwner.sparId"
        ],
        "properties": {
          "dataOwner.sparId": {
            "type": "object",
            "properties": {
              "eq": {
                "type": "string",
                "pattern": "^\\d{6}-\\d+-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
              }
            },
            "description": "Spar ID of the customer requesting SPAR data."
          }
        }
      },
      "personMonitored": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "example": "NOT_FOUND",
            "readOnly": true,
            "description": "This field contains either details about the type of error when a PUT to /persons-monitored is performed.\n\nOr details from SPAR when performing a POST to /persons-monitored/getCollection after the list of monitored persons have been processed by SPAR.\n\nPossible values from SPAR:\nNOT_FOUND: Person is not found in SPAR.\nDEREGISTERED: Person is deregistered from SPAR."
          },
          "personId": {
            "type": "string",
            "example": "200010121234",
            "maxLength": 12,
            "minLength": 12
          },
          "collectInitialData": {
            "type": "boolean",
            "description": "Forces a fetch of person data in the next run"
          }
        }
      },
      "ApiErrorResponse": {
        "type": "object",
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Error"
            },
            "description": "A list of errors"
          }
        }
      },
      "CivilRegistration": {
        "type": "object",
        "properties": {
          "county": {
            "type": "string",
            "description": "The county name"
          },
          "district": {
            "type": "string",
            "description": "The district name"
          },
          "residency": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Residency"
              }
            ]
          },
          "countyCode": {
            "type": "string",
            "pattern": "[0-9]{2}",
            "description": "County code"
          },
          "districtCode": {
            "type": "string",
            "pattern": "[1-9][0-9]{5}",
            "description": "District code"
          },
          "municipality": {
            "type": "string",
            "description": "The municipality name"
          },
          "municipalityCode": {
            "type": "string",
            "pattern": "[0-9]{2}",
            "description": "Municipality code"
          },
          "registrationDate": {
            "type": "string",
            "format": "date",
            "description": "The date civil registration information was registered in the Swedish Population Register"
          }
        },
        "description": "Civil registration details"
      },
      "PersonIdReference": {
        "type": "object",
        "properties": {
          "personId": {
            "type": "string",
            "description": "Swedish personal id. Can be a personal identity number, a coordination number or an immunity number"
          },
          "referenceType": {
            "enum": [
              "FROM",
              "TO"
            ],
            "type": "string",
            "description": "FROM: Reference to an old personId.\n\nTO: Reference to a new personId.\n\nIf type is missing then no clear chronological order can be determined."
          }
        },
        "description": "References to old and/or new person IDs"
      },
      "PersonsCollection": {
        "type": "object",
        "properties": {
          "href": {
            "type": "string"
          },
          "next": {
            "properties": {
              "href": {
                "type": "string",
                "description": "This will be the url to use to get the next set of data after this one has been processed. If this field is empty, then there is no more data for now"
              }
            }
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Person"
            }
          },
          "limit": {
            "type": "integer",
            "format": "int32"
          },
          "offset": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "CauseOfHibernation": {
        "enum": [
          "DECEASED",
          "TIME_LIMIT",
          "REPLACED",
          "INCORRECTLY_REGISTERED",
          "OTHER"
        ],
        "type": "string",
        "description": "Cause of hibernation.\n\nTIME_LIMIT = The preliminary hibernation date have passed and the coordination number have not been renewed.",
        "discriminator": {
          "propertyName": "causeOfHibernation"
        }
      },
      "HistoricalRelation": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/DateRange"
          },
          {
            "$ref": "#/components/schemas/Relation"
          }
        ]
      },
      "SpecialPostAddress": {
        "type": "object",
        "properties": {
          "swedishAddress": {
            "$ref": "#/components/schemas/SwedishAddress"
          },
          "internationalAddress": {
            "$ref": "#/components/schemas/InternationalAddress"
          }
        },
        "description": "The address which a person have chosen to have their letters delivered to."
      },
      "HistoricalAddresses": {
        "type": "object",
        "properties": {
          "contactAddresses": {
            "$ref": "#/components/schemas/HistoricalContactAddresses"
          },
          "foreignAddresses": {
            "$ref": "#/components/schemas/HistoricalForeignAddresses"
          },
          "specialPostAddresses": {
            "$ref": "#/components/schemas/HistoricalSpecialPostAddresses"
          },
          "civilRegistrationAddresses": {
            "$ref": "#/components/schemas/HistoricalCivilRegistrationAddresses"
          }
        },
        "description": "Contains none or several previous addresses."
      },
      "InternationalAddress": {
        "type": "object",
        "properties": {
          "country": {
            "type": "string",
            "description": "Name of the country in the language SPAR provides it."
          },
          "addressLines": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The physical address, street or corresponding data. Is empty if data is missing in SPAR."
          }
        },
        "description": "Address details"
      },
      "ImmunityNumberDetails": {
        "type": "object",
        "properties": {
          "causeOfHibernation": {
            "$ref": "#/components/schemas/CauseOfHibernation"
          },
          "declaredHibernatedDate": {
            "type": "string",
            "example": "2019-01-01",
            "description": "The date this immunity number was hibernated.\n\nNote: The date can be in an incomplete format\n\nExamples: [\"2019-01-01\", \",2019-00-00\",\"0000-00-00\", \"200101\", \"2001\", \"0\"]"
          }
        }
      },
      "filterMonitoredPerson": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "eq": {
                "type": "string"
              },
              "exists": {
                "type": "boolean"
              }
            },
            "maxProperties": 1
          },
          "personId": {
            "type": "object",
            "properties": {
              "in": {
                "type": "array",
                "items": {
                  "type": "string",
                  "example": "200010121234",
                  "maxLength": 12,
                  "minLength": 12
                }
              }
            }
          },
          "collectInitialData": {
            "type": "object",
            "properties": {
              "eq": {
                "type": "boolean"
              }
            }
          }
        }
      },
      "CivilRegistrationAddress": {
        "type": "object",
        "properties": {
          "swedishAddress": {
            "$ref": "#/components/schemas/SwedishAddress"
          }
        },
        "description": "The address of a person that is registered in the Swedish Population Register. For people that have been deregistered, this is the last known civil registration address"
      },
      "HistoricalDeregistration": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/DateRange"
          },
          {
            "$ref": "#/components/schemas/Deregistration"
          }
        ]
      },
      "HistoricalSwedishAddress": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/DateRange"
          },
          {
            "$ref": "#/components/schemas/SwedishAddress"
          }
        ],
        "description": "Details of an address in Sweden"
      },
      "CoordinationNumberDetails": {
        "type": "object",
        "properties": {
          "renewalDate": {
            "type": "string",
            "example": [
              "2019-01-01",
              ",2019-00-00",
              "0000-00-00",
              "200101",
              "2001",
              "0"
            ],
            "description": "The date this coordination number was renewed.\n\nNote: The date can be in an incomplete format"
          },
          "assignedDate": {
            "type": "string",
            "description": "The date this coordination number was assigned to the person."
          },
          "deceasedDate": {
            "type": "string",
            "example": [
              "2019-01-01",
              ",2019-00-00",
              "0000-00-00",
              "200101",
              "2001",
              "0"
            ],
            "description": "The date the person deceased.\n\nNote: The date can be in an incomplete format"
          },
          "identityLevel": {
            "$ref": "#/components/schemas/IdentityLevel"
          },
          "identityLevelDate": {
            "type": "string",
            "example": [
              "2019-01-01",
              ",2019-00-00",
              "0000-00-00",
              "200101",
              "2001",
              "0"
            ],
            "description": "The date when the identity level was set.\n\nNote: The date can be in an incomplete format"
          },
          "causeOfHibernation": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CauseOfHibernation"
              }
            ]
          },
          "declaredHibernatedDate": {
            "type": "string",
            "example": [
              "2019-01-01",
              ",2019-00-00",
              "0000-00-00",
              "200101",
              "2001",
              "0"
            ],
            "description": "The date this coordination number was hibernated.\n\nNote: The date can be in an incomplete format"
          },
          "preliminaryHibernationDate": {
            "type": "string",
            "example": [
              "2019-01-01",
              ",2019-00-00",
              "0000-00-00",
              "200101",
              "2001",
              "0"
            ],
            "description": "The expected date for hibernation of coordination number.\n\nNote: The date can be in an incomplete format"
          }
        }
      },
      "HistoricalContactAddresses": {
        "type": "object",
        "properties": {
          "swedishAddresses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoricalSwedishAddress"
            }
          },
          "internationalAddresses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoricalInternationalAddress"
            }
          }
        },
        "description": "The contact address for people with coordination numbers."
      },
      "HistoricalForeignAddresses": {
        "type": "object",
        "properties": {
          "internationalAddresses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoricalInternationalAddress"
            }
          }
        },
        "description": "Last known address for civil registered people that have emigrated."
      },
      "personsMonitoredCollection": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/personMonitored"
            }
          }
        }
      },
      "HistoricalCivilRegistration": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/DateRange"
          },
          {
            "$ref": "#/components/schemas/CivilRegistration"
          }
        ]
      },
      "HistoricalInternationalAddress": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/DateRange"
          },
          {
            "$ref": "#/components/schemas/InternationalAddress"
          }
        ],
        "description": "Address details"
      },
      "HistoricalSpecialPostAddresses": {
        "type": "object",
        "properties": {
          "swedishAddresses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoricalSwedishAddress"
            }
          },
          "internationalAddresses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoricalInternationalAddress"
            }
          }
        },
        "description": "The address which a person have chosen to have their letters delivered to."
      },
      "HistoricalImmunityNumberDetails": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/DateRange"
          },
          {
            "$ref": "#/components/schemas/ImmunityNumberDetails"
          }
        ]
      },
      "HistoricalCoordinationNumberDetails": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/DateRange"
          },
          {
            "$ref": "#/components/schemas/CoordinationNumberDetails"
          }
        ]
      },
      "HistoricalCivilRegistrationAddresses": {
        "type": "object",
        "properties": {
          "swedishAddresses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoricalSwedishAddress"
            }
          }
        },
        "description": "The address of a person that is registered in the Swedish Population Register. For people that have been deregistered, this is the last known civil registration address"
      }
    },
    "parameters": {
      "cost-org": {
        "in": "header",
        "name": "cost-org",
        "schema": {
          "type": "string"
        },
        "required": true,
        "description": "The customer/organisation which is responsible for costs of this API call."
      },
      "filter.error.eq": {
        "in": "query",
        "name": "filter.error.eq",
        "schema": {
          "type": "string"
        },
        "required": false,
        "description": "get items where error equals filtered value"
      },
      "filter.error.exists": {
        "in": "query",
        "name": "filter.error.exists",
        "schema": {
          "type": "boolean"
        },
        "required": false,
        "description": "get items that contains error or not"
      },
      "filter.dataOwner.sparId.eq": {
        "in": "query",
        "name": "filter.dataOwner.sparId.eq",
        "schema": {
          "type": "string",
          "pattern": "^\\d{6}-\\d+-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
        },
        "required": true,
        "description": "ID of the customer requesting SPAR data."
      },
      "filter.collectInitialData.eq": {
        "in": "query",
        "name": "filter.collectInitialData.eq",
        "schema": {
          "type": "string"
        },
        "required": false,
        "description": "get items where collectInitialData equals filtered value"
      }
    },
    "securitySchemes": {
      "bearerToken": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "x-enento-claims": "ConsumerCheckMonitor"
}