Veterans Affairs Unique User Metrics API

The Unique User Metrics API from Veterans Affairs — 1 operation(s) for unique user metrics.

Operations 1

POST /v1/unique_user_metrics /v1/unique_user_metrics #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/va-unique-user-metrics-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

va-unique-user-metrics-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  version: 1.0.0
  title: VA My Health Unique User Metrics API
  license:
    name: CC0 1.0 Universal
  description: 'The Department of Veterans Affairs My Health APIs. All paths are relative to https://api.va.gov/my_health.

    '
servers:
- url: https://api.va.gov/my_health
security:
- CookieAuth: []
tags:
- name: Unique User Metrics
paths:
  /v1/unique_user_metrics:
    post:
      description: 'Log unique user metrics events for analytics tracking. Accepts multiple events in a single batch operation

        and buffers them for asynchronous processing by a background job.


        This endpoint is used for tracking unique user interactions with MHV Portal features to provide

        opt-out-free analytics that are more accurate than Google Analytics.


        <strong>Asynchronous Processing:</strong> Events are buffered and processed in batches by a background job.

        The response indicates which events were accepted for processing, not whether they are new unique events.

        Duplicate events (same user + event combination) are handled during background processing.


        <strong>Valid Event Names:</strong> Event names must be from the approved registry of valid events.

        See <a href=''https://github.com/department-of-veterans-affairs/vets-api/blob/master/lib/unique_user_events/event_registry.rb''>EventRegistry</a>

        for the complete list. Invalid event names are silently filtered out.

        '
      operationId: log_unique_user_metrics
      requestBody:
        content:
          application/json:
            schema:
              $ref: ./schemas/UniqueUserMetricsRequest.yml
        description: "Array of event names to log for the authenticated user.\n\n<strong>NOTES:</strong>\n<ul>\n  <li>Events are buffered for asynchronous batch processing</li>\n  <li>Event names must be from the approved registry - see <a href='https://github.com/department-of-veterans-affairs/vets-api/blob/master/lib/unique_user_events/event_registry.rb'>EventRegistry</a></li>\n  <li>Invalid event names are silently filtered out</li>\n  <li>Maximum 50 characters per event name</li>\n  <li>At least one event name must be provided</li>\n</ul>\n"
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: ./schemas/UniqueUserMetricsResponse.yml
              example:
                buffered_events: []
          description: OK - No events were buffered (feature disabled or all events were invalid)
        '202':
          content:
            application/json:
              schema:
                $ref: ./schemas/UniqueUserMetricsResponse.yml
              example:
                buffered_events:
                - mhv_landing_page_accessed
                - secure_messaging_accessed
                - prescriptions_accessed
          description: Accepted - Events were accepted and buffered for asynchronous processing
        '400':
          content:
            application/json:
              schema:
                $ref: ./schemas/Errors.yml
          description: Bad Request - Invalid request parameters (missing event_names, not an array, or empty array)
        '401':
          content:
            application/json:
              schema:
                $ref: ./schemas/Errors.yml
          description: Unauthorized
      summary: /v1/unique_user_metrics
      tags:
      - Unique User Metrics
components:
  securitySchemes:
    CookieAuth:
      type: apiKey
      name: api_session
      in: cookie
      description: An authenticated session is established using the Sessions Controller to initiate federated authentication with an external credential provider, after which an API session token is established in the api_session cookie.