/v1/user

Get a list of users

Get a paginated list of users. We use cursor-based pagination to encode the pagination state. Results are ordered by when the user was created. Default sort order is descending.

pageSize is 25 by default and accepts 1 to 100.

Follow nextPageUrl, or send nextPageCursor back as cursor, until it is null. Each page continues from where the last one ended, so a completed walk returns every user exactly once. Descending order starts at the newest user as of your first request; a user created partway through sorts ahead of your position and appears only in a later walk.

The cursor is opaque. Send it back unchanged and do not store it between walks: one that cannot be decoded is rejected with 400 invalid_request, and the walk has to start again from the first page.

Pass include=subscription to embed each user's plan, access, trial, and subscription history — the same object GET /v1/user/{userId}/subscriptions returns, so you can read every user's access in one page instead of one request per user. It requires the same organization entitlement as that endpoint, and returns feature_not_enabled (400) without it. nextPageUrl carries the parameter, so every page of a walk embeds the same fields.

subscription is null for a user whose access source carries no plan; the per-user endpoint answers no_billing_relationship in that case, which a page of users cannot do without failing everyone else alongside them.

get/v1/users/

Request

  • Base URL
    https://api.counselhealth.com (the document declares no server; this is the origin it was published from)
  • Auth
    HTTP bearer

Query parameters

pageSizeinteger
cursorstring nullable
sort'asc' | 'desc'
include'subscription'
Example:subscription

Embed a related resource on every user in the page. subscription adds the user's plan, access, trial, and subscription history — the same object as GET /v1/user/{userId}/subscriptions.

Response

Default Response

nextPageUrlstring nullable required
nextPageCursorstring nullable required

Example response

{
  "users": [
    {
      "created_at": "2030-01-01T00:00:00Z",
      "dob": "1990-01-01",
      "phone": "+18007006000",
      "addresses": [
        {
          "line1": "123 Main St",
          "line2": "Apt 2",
          "city": "San Francisco",
          "state": "CA",
          "zip": "12345"
        }
      ],
      "race": [
        "White",
        "Asian"
      ],
      "medical_profile": {
        "conditions": [
          "Diabetes"
        ],
        "medications": [
          "Metformin"
        ],
        "medication_allergies": [
          "Tylenol"
        ],
        "surgeries": [
          "Appendectomy"
        ],
        "family_history": [
          "Diabetes"
        ],
        "doctors": {
          "pcp_name": "Dr. Joe Doe",
          "specialist_types": [
            "Cardiologist"
          ]
        },
        "additional_details": {}
      },
      "access_expires_at": "2030-01-01T00:00:00Z",
      "email": "john.doe@example.com",
      "metadata": {
        "plan": "pro",
        "external_id": "1234567890"
      },
      "onboarded_at": "2030-01-01T00:00:00Z",
      "external_id": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
      "subscription": {
        "access": {
          "expires_at": "2030-01-01T00:00:00Z"
        },
        "trial": {
          "ends_at": "2030-01-01T00:00:00Z"
        },
        "subscriptions": [
          {
            "cancel_at": "2030-01-01T00:00:00Z",
            "ended_at": "2030-01-01T00:00:00Z",
            "renews_at": "2030-01-01T00:00:00Z",
            "created_at": "2030-01-01T00:00:00Z"
          }
        ]
      }
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.