GET
/
insurance_policies
cURL
curl --request GET \
  --url http://localhost:8080/insurance_policies
{
  "data": [
    {
      "benefit_id": "<string>",
      "benefit_name": "<string>",
      "created_at": "<string>",
      "dependant_ids": [
        "<string>"
      ],
      "dependants": [
        {
          "first_name": "<string>",
          "id": "<string>",
          "last_name": "<string>"
        }
      ],
      "id": "<string>",
      "last_modified_at": "<string>",
      "plan_code": "<string>",
      "premium_amounts": {
        "annual": {
          "value": 123
        },
        "daily": {
          "value": 123
        },
        "sponsor_contribution": {
          "value": 123
        }
      },
      "primary_member": {
        "first_name": "<string>",
        "id": "012345678901",
        "last_name": "<string>"
      },
      "primary_user_id": "012345678901",
      "questionnaire": {
        "questions": [
          {
            "answer": true,
            "question": "<string>"
          }
        ]
      },
      "end_date": "2027-01-15",
      "external_policy_id": "<string>",
      "metadata": {
        "provider_metadata": {}
      },
      "nominee_details": {
        "dependant_id": "<string>"
      },
      "start_date": "2026-01-15"
    }
  ],
  "limit": 123,
  "offset": 123,
  "total": 123
}

Query Parameters

statuses
string | null
primary_user_id
null | string

A validated 12-digit numeric user identifier.

Every external entry point validates:

  • JSON Deserialize runs [UserId::parse] (outer whitespace trimmed, length and digit-only enforced) via #[serde(try_from = "String")].
  • DB FromSql runs [UserId::parse] on every row read.

Display / Deref<Target = str> / AsRef<str> / Into<String> are derived via derive_more — the inner String is pass-through for every read-only borrow, display, and move-out.

Example:

"012345678901"

benefit_id
string
required
benefit_provider_id
string
required
policy_id
string
required
sort
object

Sort specification for list endpoints. Read the field names as "sort on <column> by <direction>".

time_range
object

A half-open time range, with a mandatory start and an optional end. Designed to be embedded in list/filter query params via #[serde(flatten)].

Deserialize runs [TimeRange::validate] as part of deserialization, so callers never receive a [TimeRange] that violates start_time <= end_time.

limit
integer<int32> | null
offset
integer<int32> | null

Response

List of all insurance policies

data
object[]
required
limit
integer<int32>
required
offset
integer<int32>
required
total
integer<int64>
required