Policies
Reading policies, their documents, and cancelling them.
/policiesList policies
The policies this business has sold, newest first. Each row carries the last policy document read from the insurer; read the policy itself for a live view.
Requires API key authentication. The API key issued to the business, sent as `<keyId>:<secret>`, for example `sk_test_0123456789abcdef0123456789abcdef:<secret>`. The key id prefix selects the environment: `sk_test_` keys read and write test data, `sk_live_` keys production data.
Responses
One page of policy records.
{
"items": [],
"pagination": null
}/api/v1/policiesCode samples
curl -X GET '/api/v1/policies'/policies/{providerId}/{policyId}Read one policy
Reads the policy from the insurer, not from the stored row, so the state is current. A policy another business owns is a 404 and the insurer is never called.
Requires API key authentication. The API key issued to the business, sent as `<keyId>:<secret>`, for example `sk_test_0123456789abcdef0123456789abcdef:<secret>`. The key id prefix selects the environment: `sk_test_` keys read and write test data, `sk_live_` keys production data.
Responses
The policy as the insurer holds it.
{
"policy": null
}/api/v1/policies/{providerId}/{policyId}Code samples
curl -X GET '/api/v1/policies/{providerId}/{policyId}'/policies/{providerId}/{policyId}/documentsList a policy's documents
Lists the documents the insurer holds for this policy, so a documentId can be discovered rather than guessed. Read the bytes of one with GET /policies/{providerId}/{policyId}/documents/{documentId}. A policy another business owns is a 404 and the insurer is never called.
Requires API key authentication. The API key issued to the business, sent as `<keyId>:<secret>`, for example `sk_test_0123456789abcdef0123456789abcdef:<secret>`. The key id prefix selects the environment: `sk_test_` keys read and write test data, `sk_live_` keys production data.
Responses
Every document this insurer lists for the policy. An insurer that lists none answers an empty array.
{
"items": []
}/api/v1/policies/{providerId}/{policyId}/documentsCode samples
curl -X GET '/api/v1/policies/{providerId}/{policyId}/documents'/policies/{providerId}/{policyId}/documents/{documentId}Download a policy document
Answers the decoded bytes, not JSON. Content-Type is the insurer's media type when it is a well-formed type and application/octet-stream otherwise; Content-Disposition is always attachment with a sanitised filename, falling back to the document id. A document larger than the ceiling this API will hold in memory is refused with 502 rather than streamed: DOCUMENT_TOO_LARGE when the insurer inlines the bytes, DOCUMENT_REDIRECT_REFUSED when a signed-redirect download overruns the ceiling or its URL fails the redirect policy.
Requires API key authentication. The API key issued to the business, sent as `<keyId>:<secret>`, for example `sk_test_0123456789abcdef0123456789abcdef:<secret>`. The key id prefix selects the environment: `sk_test_` keys read and write test data, `sk_live_` keys production data.
Parameters
documentIdpathstringrequireddefault: The document id carried on the policy.Responses
The document bytes.
null/api/v1/policies/{providerId}/{policyId}/documents/{documentId}Path parameters
documentId*Code samples
curl -X GET '/api/v1/policies/{providerId}/{policyId}/documents/{documentId}'/policies/{providerId}/{policyId}/cancelCancel a policy
Answers 200 whether the insurer cancelled outright or took the request under review: read outcome to tell them apart. A policy the insurer will not cancel is 409 POLICY_NOT_CANCELLABLE.
Requires API key authentication. The API key issued to the business, sent as `<keyId>:<secret>`, for example `sk_test_0123456789abcdef0123456789abcdef:<secret>`. The key id prefix selects the environment: `sk_test_` keys read and write test data, `sk_live_` keys production data.
Request body
application/json{
"reason": "",
"note": "",
"requestedEffectiveDate": ""
}Responses
The cancellation, whether it completed, is pending, or was replayed.
{
"outcome": "",
"cancellation": null
}/api/v1/policies/{providerId}/{policyId}/cancelRequest body
Code samples
curl -X POST '/api/v1/policies/{providerId}/{policyId}/cancel' \
-H 'Content-Type: application/json' \
--data-raw '{
"reason": "",
"note": "",
"requestedEffectiveDate": ""
}'