Before you start
You need an API key for a member with access to underwriting submissions, in a workspace that has underwriting turned on. Elsewhere every operation answers403 feature_not_enabled.
- Creating a submission needs create access to underwriting submissions (a workspace administrator, or a member with edit sharing on them), or edit access to the agency account it names.
- Adding files and messages and starting extractions needs edit access to the submission. One you
can read but not edit answers
403 forbidden; one you can’t read answers404, as a missing one does. - Ruling on proposals and setting values needs edit access to the submission and a role of its program. A workspace can keep them to a person signed in to Effective. See Rule on the proposals.
Create a submission
No field is required; send what the broker told you. Every create needs anIdempotency-Key.
Use a new random UUID for each submission: it becomes the submission’s id, and a retry with the
same key and body within 24 hours answers 200 with the same submission instead of making a
second one.
id for every later call. The submission stays on the release of its program it was made
on, releaseVersion: its extraction, facts and pricing all use that release, even after the
program releases a newer one. Name a ready release in releaseVersion to make it on that one;
leave it out for the program’s latest.
A create can be refused:
409 control_number_taken: another submission has thiscontrolNumber. The error names it insubmissionIdwhen you can read it; add to that one instead.422 unknown_program,unknown_agency_accountorunknown_underwriter: aprogramId,agencyAccountIdor one ofunderwriterIdsthat the workspace doesn’t have, or you can’t read.422 unknown_release: areleaseVersionthat is not a ready release of the program.409 idempotency_conflict: the key was used with a different body. A refused request binds nothing, so you can retry its key with a corrected body.
Add the broker’s files
Send up to 20 files, 25 MiB in all, in one multipart request, each as afile part. It needs an
Idempotency-Key: a retry with the same key and files adds nothing more.
documents, the files the store rejected with why, and
extraction: started with its extractionId where the workspace starts an extraction when
documents arrive, or skipped with a reason.
Upload a large file
A file over 25 MiB is two calls and an upload. Ask for an upload URL with the file’s name and exact size:uploadUrl with every header in headers. Don’t send your API key there.
uploadToken:
id, name, folder (the submission’s Broker
submission folder) and source. Confirming the same token again answers the same document.
409 upload_incomplete means the bytes never arrived: PUT them and confirm again.
400 invalid_upload_content means they don’t match sizeBytes or the file’s type: start a new
upload.
Add the broker’s message
Add the broker’s email, or an SMS or chat message, with Add a message to an underwriting submission. For an email, upload its.eml as above, then name the document in raw. Its body becomes an
Email.txt document and each attachment a document of its own:
raw, send the message as text, and its files in documents: files already uploaded to
the submission by artifactId, or short notes inline as { "name": "call-notes.txt", "text": "…" }.
externalId is the channel’s own id, such as the email’s Message-ID, and makes the request safe to
retry: the same externalId and body answer 200 with the message as first added. A different
body under the same externalId is 409 idempotency_conflict. A raw file that doesn’t parse, or
disagrees with from, receivedAt or text, is 422 invalid_message. An attachment the file
store refuses is listed in rejected; the rest are kept.
To see everything the submission holds, list its documents with
GET /insurance/underwriting/submissions/{submissionId}/documents. Each document’s id is an
artifact: read its text with Read a bounded chunk of extracted artifact text.
Start an extraction
Where the workspace starts an extraction when documents arrive, adding files or a message starts one, which reads every document. Start one yourself when it didn’t, or to read the files again. Send{} to read every document, or name some in
documentIds. It needs an Idempotency-Key; use a new one for each start.
202 with the extraction, queued or running:
documentIds while another is running or
queued is 409 extraction_in_progress, with that one’s extractionId.
The run acts as the extraction’s own service identity, whoever starts it: it reads that
submission’s documents and nothing else, and anyone who can read the submission can open the run.
422 extraction_not_configured means your workspace turned extraction off for the program, or
the program’s creator isn’t known or has left the workspace; 422 no_documents means there is
nothing to read, and too_many_documents more than 100.
What the extraction looks for
The submission’s program says what the extraction looks for, in its RSL source: the documents a submission should hold and the role the extraction answers as (aDocuments section), how to
find a value (hint:) and the documents that usually state it (found_on:), what the desk needs
though nothing requires it (needed_for:), how to tell two rows of a list apart (matched_by:),
and what the extraction never answers (derived:, not_written:, or a role above the
extraction’s). rslc checks each one against the program and
writes it into the release’s contract. A release built before programs said this is read for what
its contract asks, with nothing more expected.
What the extraction looks for changes with a new release of the program, never with a setting. The
workspace’s underwriting_extraction setting holds only the switches, per program:
extractOnArrival (start when documents arrive) and the procedure to run (procedureId,
procedureVersion). Saving a setting with a part that isn’t valid is refused,
naming each problem. An extraction keeps what it read with, so a later release leaves it as it
was.
Read the result
Read the extraction until itsstatus is completed, failed or cancelled. While it isn’t
final, the response carries Retry-After; wait that many seconds between reads. To be told
instead, subscribe a webhook endpoint to
underwriting_submission.extraction.completed and underwriting_submission.extraction.failed,
and read the extraction when one arrives.
proposalsare the values read for the program’s inputs. Each names its inputpath, thevalue, andfrom: the document, the place in it and the exact quote.statusisvalid,invalid(with aproblem),conflict, orruledonce an underwriter has decided on it.missinglists inputs nothing was read for, andconflictsthe inputs where documents disagree.factsholds what the program keeps as notes and reads in no rule, such as the named insured or the claims, each keyed by its note’s path and with where it was read.
failure.code invalid_extraction. A submission with no program gets its documents checked
only: with no release, there are no notes to keep as facts.
The submission itself summarizes what to do next. Read it with
Get an underwriting submission:
outstanding lists what is missing, blocking items first, each with who it waits on (broker,
underwriter or system), and next is who acts now. Once values are written, rating says where the
submission stands on its program and what the program computes, such as the premium. Poll the submission when you only need to
know whether it is waiting on you.
To name what a result holds the way the program does, read the contract the extraction was
checked against with
GET /insurance/underwriting/submissions/{submissionId}/extractions/{extractionId}/contract:
the program’s inputs as JSON Schema (questions, with each input’s words), its roles, and its
notes, the paths of the facts. Anyone who can read the submission can read it, with no access to
the program. An extraction read with no program has none (404).
See the run behind an extraction
A person who manages the program can read the procedure run behind an extraction, step by step, with any step’s failure, throughGET /insurance/underwriting/submissions/{submissionId}/extractions/{extractionId}/run. It is for
holders of a highest role of the program guideline’s role chain (see
Hosted logs); anyone else who can
read the submission gets 403 forbidden. The documents’ contents aren’t included.
Rule on the proposals
An underwriter decides on each proposal: accept it, dismiss it, or enter a value of their own. They can do it in Effective, on the submission’s Facts, or your system can do it for them with an API key, through four operations:
Each needs an
Idempotency-Key, edit access to the submission, and a
role of the program that can answer the inputs: a
caller who holds none gets 403 no_program_role. A workspace administrator can act in any of the
program’s roles. This accepts every valid proposal that isn’t in conflict:
accepted and those skipped, each with why. Each value is written to
the submission’s log as the member the key belongs to.
Read the rulings
Your system sees the rulings when it reads an extraction: a ruled proposal hasstatus: "ruled"
and a ruling of accepted, overridden or dismissed, and values and factValues hold what
the submission keeps now. The submission’s outstanding updates to match.
Take in submissions by email
A workspace administrator with edit access to the program can turn on email from Underwriting → Submissions → Email intake addresses. You can also create a program address through the API. Share the address with the brokers who send quote requests for that program.- The first email of a thread makes a submission of the program, with
source: "email"andcreatedBy.type: "system". Its body and attachments become the submission’s documents, as Add the broker’s message describes. - Replies on the thread from the same sender join that submission. A reply from anyone else is held for a person to attach or discard.
- An email with files starts an extraction of every document by itself, unless your workspace
turned extraction on arrival off for the program. A completed upload does the same. Whether
extraction started, or why it was skipped, is on the email in
the address’s email list.
Check
latestExtractionon the submission before you start one; starting another is safe, as Start an extraction explains.
resolution.submissionId), or open it on the desk in Effective. To answer the
broker on the thread, see Reply to brokers by email.