Policies

Reading policies, their documents, and cancelling them.

GET/policies

List 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.

lock

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
}
boltTry it
env
GET/api/v1/policies

Code samples

curl -X GET '/api/v1/policies'
GET/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.

lock

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
}
boltTry it
env
GET/api/v1/policies/{providerId}/{policyId}

Code samples

curl -X GET '/api/v1/policies/{providerId}/{policyId}'
GET/policies/{providerId}/{policyId}/documents

List 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.

lock

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": []
}
boltTry it
env
GET/api/v1/policies/{providerId}/{policyId}/documents

Code samples

curl -X GET '/api/v1/policies/{providerId}/{policyId}/documents'
GET/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.

lock

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
boltTry it
env
GET/api/v1/policies/{providerId}/{policyId}/documents/{documentId}

Path parameters

documentId*

Code samples

curl -X GET '/api/v1/policies/{providerId}/{policyId}/documents/{documentId}'
POST/policies/{providerId}/{policyId}/cancel

Cancel 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.

lock

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
}
boltTry it
env
POST/api/v1/policies/{providerId}/{policyId}/cancel

Request body

Code samples

curl -X POST '/api/v1/policies/{providerId}/{policyId}/cancel' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "reason": "",
  "note": "",
  "requestedEffectiveDate": ""
}'