List archived policies

You can retrieve a list of archived policies by filtering on the policies themselves or by filtering for archived policies within jobs.

List all archived policies

You can retrieve a list of all policies that have been archived by filtering on the archived property. The following example returns the id, policyNumber, and archived properties of all policies where archived is true.

Command

GET /policy/v1/policies?fields=id,policyNumber,archived&filter=archived:eq:true

Response

{
   "data": [
        {
            "attributes": {
                "archived": true,
                "id": "pc:10",
                "policyNumber": "1012345678"
            }
        },
        {
            "attributes": {
                "archived": true,
                "id": "pc:12",
                "policyNumber": "2712345678"
            }
        }
     …
    }
}

Policies that are not archived could have an archived value of false or the value could be null. Therefore, to find all jobs with policies that are not archived, filter for policies where archived is not true (rather than filtering for false):

GET /policy/v1/policies?fields=id,policyNumber,archived&filter=archived:ne:true
Note:

It’s possible that a policy could be returned that doesn’t seem to match the filter criteria. For example, you could filter for policies where archived is set to true and see a policy in the return data that does not have that property set to true. This can happen when an older term on the policy is archived, but the most recent term is not. The query will return the policy because at least one of the terms on the policy is archived, but it will not show the archived property as true because by default it’s showing data for only the most recent term. See “Retrieve an archived policy” later in this topic for information on using the asOfDate parameter to track policies by policy term.

List archived policies by job

You can retrieve a list of jobs associated with archived policies by filtering on the archived property. The following example returns the id, policyNumber, and archived properties of all jobs where archived is true.

Command

GET /job/v1/jobs?fields=id,policyNumber,archived&filter=archived:eq:true

Response

{
    "data": [
        {
            "attributes": {
                "archived": true,
                "id": "pc:101",
                "policyNumber": "1012345678"
            }
        },
        {
            "attributes": {
                "archived": true,
                "id": "pc:105",
                "policyNumber": "2712345678"
            }
        },
        {
            "attributes": {
                "archived": true,
                "id": "pc:320",
                "policyNumber": "2712345678"
            }
        },
     ...
    }
}

Policies that are not archived could have an archived value of false or the property could be null. Therefore, to find all jobs with policies that are not archived, filter for policies where archived is not true (rather than filtering for false):

GET /job/v1/jobs?fields=id,policyNumber&filter=archived:ne:true