Sessions
Overview
The Sessions API lets you embed InsureTrek license applications directly into your platform. Instead of building complex application forms yourself, you create a session via API and redirect your user to InsureTrek. We handle the hard parts — SSN collection, ~150 dynamic background questions, state-specific disclosures, and payment — then redirect the user back to your app when they're done.
How It Works
- Sync profile data — Pre-fill what you already know (name, NPN, address, etc.) so your user doesn't have to re-enter it.
- Create a session — Call the API with the license type, states, and payment preference. You get back a URL.
- Redirect your user — Send them to the InsureTrek application URL. They complete SSN entry, background questions, disclosures, and payment in our secure environment.
- Receive webhooks — Get notified when the application is submitted, approved, denied, or needs action.
Pre-filling Profile Data
Sync your user's profile ahead of time so the application is pre-filled when they arrive.
curl -X PATCH https://api.insuretrek.com/v1/users/usr_abc123/licensing-profile \
-H "Authorization: Bearer your-access-token" \
-H "Content-Type: application/json" \
-d '{
"npn": "12345678",
"firstName": "Jane",
"lastName": "Smith",
"email": "jane@example.com",
"phone": "555-123-4567",
"dateOfBirth": "1990-01-15",
"residentialAddress": {
"street": "123 Main St",
"city": "Austin",
"state": "TX",
"zip": "78701"
}
}'
Sensitive data like SSN and background question answers are never transmitted through your systems — they're always collected directly by InsureTrek.
Creating a Session
curl -X POST https://api.insuretrek.com/v1/applications/sessions \
-H "Authorization: Bearer your-access-token" \
-H "Content-Type: application/json" \
-d '{
"userId": "usr_abc123",
"applicationType": "new",
"licenseType": "life_health",
"states": ["TX", "CA"],
"paymentMethod": "user_pays",
"returnUrl": "https://yourapp.com/callback",
"webhookUrl": "https://yourapp.com/webhooks"
}'
Response:
{
"sessionId": "sess_xyz",
"applicationId": "app_abc",
"applicationUrl": "https://apply.insuretrek.com/s/xyz",
"estimatedFees": { "total": 155.00 },
"prefilled": { "npn": true, "ssn": false, "backgroundQuestions": false }
}
Redirect your user to applicationUrl. When they finish, they're sent back to your returnUrl with a status parameter (e.g., ?status=submitted).
Checking Application Status
curl https://api.insuretrek.com/v1/applications/app_abc \
-H "Authorization: Bearer your-access-token"
Returns status per state: pending_review, approved, denied, or requires_action.
Webhooks
Subscribe to events instead of polling. InsureTrek sends POST requests to your webhookUrl as the application progresses.
| Event | Description |
|---|---|
application.session_started | User opened the application URL |
application.progress_updated | User completed a step |
application.submitted | Application submitted to the state |
application.status_changed | State approved, denied, or updated the application |
application.requires_action | User action needed — includes an actionUrl to send them back |
Payment Options
| Method | Description |
|---|---|
user_pays | User pays state + processing fees during the application (default) |
partner_billing | Partner invoiced monthly. User skips the payment step. |