7 endpoints · base URL https://flexysure.intrepidprojects.co.ke/api/v1
Issue, fetch, check and cancel DMVIC motor insurance certificates. Issuance follows the paid-stage rule: a policy is certified once it is active (first instalment paid in full); on an instalment plan the cover period is split into stages and stage n is issued once instalment n is paid and stage n−1 exists. Every issue runs DMVIC's double-insurance check first. Responses keep Insurance Cloud's {success, message} shape; failures are problem documents that also carry success: false and message. In the demo every call goes to the bundled DMVIC simulator.
Issues the next eligible certificate stage for each listed vehicle on the policy. start_date and expiring must fall inside the policy cover; the certificate period itself follows the paid stage. Repeating the call for an issued stage returns the existing certificate. email and phone are accepted for Insurance Cloud compatibility.
Scope
certificate
Authentication
Bearer token
Rate limit
60 requests per minute per token (per-client override)
Idempotency
Required: send an Idempotency-Key; a retry with the same key replays the first response.
Headers
Header
Meaning
Authorization
Bearer <access_token> (scope certificate)
Idempotency-Key
Required. A unique value (a UUID) per write. Replays within 24 hours return the stored response with Idempotent-Replayed: true; the same key with a different body is rejected (idempotency_key_reused).
Body fields
Field
Type
Required
Description
risknote
string
Yes
Risk note number (policy number also accepted).
Example: RN/2026/000123
certificate_not_issued (policy not active, stage not paid, double insurance, DMVIC refusal; data holds the attempt) or validation_failed (vehicle not on the risk note, dates outside cover)
Errors are problem documents; the common codes (401, 403 insufficient_scope, 422, 429) apply to every endpoint.
Insurance Cloud's agent issuance: identifies the agent by X-Agent-Code and X-Agent-Key, checks the policy is theirs and issues the next eligible stage (CertificateStages). The headers are required here.
Scope
certificate
Authentication
Bearer token
Rate limit
60 requests per minute per token (per-client override)
Idempotency
Required: send an Idempotency-Key; a retry with the same key replays the first response.
Agent headers
Accepts X-Agent-Code and X-Agent-Key: the call runs as that agent and sees only the agent's own records.
Headers
Header
Meaning
Authorization
Bearer <access_token> (scope certificate)
X-Agent-Code
Required. The agent's code (see GET /sales-people).
X-Agent-Key
Required. The agent's key.
Idempotency-Key
Required. A unique value (a UUID) per write. Replays within 24 hours return the stored response with Idempotent-Replayed: true; the same key with a different body is rejected (idempotency_key_reused).
Body fields
Field
Type
Required
Description
policy_id
string
Yes
Policy id, uuid, policy number or risk note number.
Example: 5d0c8a1e-…
The certificate as a PDF file (application/pdf, attachment). Flexysure's rendering is marked SAMPLE; DMVIC's own PDF is the certificate of record. Only issued certificates download.
Scope
certificate
Authentication
Bearer token
Rate limit
60 requests per minute per token (per-client override)
Asks DMVIC whether the vehicle already has cover overlapping the period. clear: true means none; otherwise data lists the overlapping certificates. Read-only.
Scope
certificate
Authentication
Bearer token
Rate limit
60 requests per minute per token (per-client override)
Blank certificate stock DMVIC holds for an underwriter, by certificate class. insurer is the DMVIC member company id (dmvic_member_id from GET /insurers).
Scope
certificate
Authentication
Bearer token
Rate limit
60 requests per minute per token (per-client override)
Cancels the certificate with DMVIC. DMVIC only allows this within its cancellation window (24 hours after issue); after that the certificate stays issued and the reason comes back as dmvic_rejected. Cancelling an already cancelled certificate succeeds.
Scope
certificate
Authentication
Bearer token
Rate limit
60 requests per minute per token (per-client override)
Idempotency
Required: send an Idempotency-Key; a retry with the same key replays the first response.
Headers
Header
Meaning
Authorization
Bearer <access_token> (scope certificate)
Idempotency-Key
Required. A unique value (a UUID) per write. Replays within 24 hours return the stored response with Idempotent-Replayed: true; the same key with a different body is rejected (idempotency_key_reused).