Link Search Menu Expand Document

HEAD/GET /v1/policies/:policy_id/doc-type

Once a quote is bound, you may choose to download the schedule and/or certificate of currency via the API. The documents are also available via partners.poweredbyagile.com. The documents are created using a background job, so they are not immediately available when the quote is bound, so you may find it useful to send a HEAD request to the url first to see if the document is available.

In general, the documents are available within a few seconds of the policy being bound. However, on occasion, the system might have a lot of jobs in the queue (after a bulk quote creation run, for example), and the documents might take a bit longer before they are available.

Path params

policy_id – string, required

The UUID of the policy the required schedule belongs to. The policy id is the value of the id in the response from binding a quote.

HEAD /v1/policies/:policy_id/schedule

Will return a 404 Not Found if the policy schedule is not yet available, and a 204 No Content if the document is ready for download.

HEAD /v1/policies/:policy_id/certificate_of_currency

Will return a 404 Not Found if the policy certificate of currency is not yet available, and a 204 No Content if the document is ready for download.

Note, not all products will generate a Certificate of Currency.

GET /v1/policies/:policy_id/schedule

Will return a 404 Not Found if the policy schedule is not yet available, and a 200 OK if the document is ready for download.

GET /v1/policies/:policy_id/certificate_of_currency

Will return a 404 Not Found if the policy schedule is not yet available, and a 200 OK if the document is ready for download.

Note, not all products will generate a Certificate of Currency.

Notes on url

The url returned by the GET request has an expiration of 30 seconds, so it is not possible to store the url for future use.

Response examples from GET requests


200 OK

{
    "url": "http://api.poweredbyagile.com/rails/active_storage/disk/----long-unique-token-----/Agile-Product-POLNUMBER.pdf?content_type=application%2Fpdf&disposition=attachment%3B+filename%3D%22Agile-Product-POLNUMBER.pdf%22%3B+filename%2A%3DUTF-8%27%27Agile-Product-POLNUMBER.pdf"
}



404 Not Found

{
    "errors": {
        "base": "The PDF file is not yet available for download"
    }
}