> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bridgelinepf.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Introspect the calling API key

> Returns the agency, the key's default broker (the broker every request acts as unless a write names another with broker_email in its body), scopes and mode. Requires no scope; use it to verify a key.

Use it to confirm a new key works, and to see which agency it belongs to, which broker it acts as by default, its type and scopes, and its mode. See [authentication](/authentication).

<RequestExample>
  ```bash cURL theme={null}
  curl https://portal.bridgelinepf.com/api/v1/whoami \
    -H "Authorization: Bearer $BRIDGELINE_API_KEY"
  ```

  ```javascript Node theme={null}
  const res = await fetch('https://portal.bridgelinepf.com/api/v1/whoami', {
    headers: {
      Authorization: `Bearer ${process.env.BRIDGELINE_API_KEY}`,
    },
  })
  const data = await res.json()
  ```

  ```python Python theme={null}
  import os
  import requests

  res = requests.get(
      "https://portal.bridgelinepf.com/api/v1/whoami",
      headers={
          "Authorization": f"Bearer {os.environ['BRIDGELINE_API_KEY']}",
      },
      timeout=30,
  )
  data = res.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "object": "whoami",
    "livemode": true,
    "brokerage": {"name": "Lone Star Risk Partners"},
    "acting_broker": {"email": "maria@lonestarrisk.example", "name": "Maria Delgado"},
    "api_key": {
      "type": "agency",
      "scopes": ["quotes:read", "quotes:write"]
    },
    "api_version": "2026-09-23"
  }
  ```

  ```json 403 theme={null}
  {
    "error": {
      "type": "permission",
      "code": "API_ACCESS_NOT_ENABLED",
      "message": "API access is not enabled for this agency. Contact Bridgeline.",
      "doc_url": "https://docs.bridgelinepf.com/errors#API_ACCESS_NOT_ENABLED",
      "request_id": "req_8fJ2kQ9xLm4TzW7nB3cY5pDv"
    }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml GET /v1/whoami
openapi: 3.1.0
info:
  title: Bridgeline Public API
  version: '2026-09-23'
  description: >-
    Premium finance quotes and applications for agencies. Authenticate with an
    API key from Agency Portal → API Keys. Scopes: `quotes:read` (Read quotes),
    `quotes:write` (Create quotes), `applications:read` (Read applications),
    `applications:write` (Create and edit applications and policies),
    `agreements:write` (Send and void agreements, attest down payments),
    `loans:read` (Read agreements, loans and payouts), `webhooks:manage` (Manage
    webhook endpoints).
servers:
  - url: https://portal.bridgelinepf.com/api
    description: Production (base URL not final, see D2)
security:
  - bearerAuth: []
paths:
  /v1/whoami:
    get:
      tags:
        - Meta
      summary: Introspect the calling API key
      description: >-
        Returns the agency, the key's default broker (the broker every request
        acts as unless a write names another with broker_email in its body),
        scopes and mode. Requires no scope; use it to verify a key.
      operationId: getWhoami
      parameters:
        - name: Bridgeline-Version
          in: header
          required: false
          description: >-
            API version (a date). Defaults to 2026-09-23; echoed on every
            response.
          schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
      responses:
        '200':
          description: The principal summary.
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    const: whoami
                  livemode:
                    type: boolean
                    description: false for bl_test_ keys.
                  brokerage:
                    type: object
                    properties:
                      name:
                        type: string
                    required:
                      - name
                  acting_broker:
                    type: object
                    properties:
                      email:
                        type: string
                      name:
                        type:
                          - string
                          - 'null'
                    required:
                      - email
                      - name
                  api_key:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - agency
                          - broker
                      scopes:
                        type: array
                        items:
                          type: string
                    required:
                      - type
                      - scopes
                  api_version:
                    type: string
                    description: The resolved Bridgeline-Version for this request.
                required:
                  - object
                  - livemode
                  - brokerage
                  - acting_broker
                  - api_key
                  - api_version
                description: Who the calling API key acts as.
        '400':
          description: Malformed request (bad JSON, version or header).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, invalid, revoked or expired API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            API access not enabled for this agency (API_ACCESS_NOT_ENABLED for a
            live key, TEST_MODE_NOT_ENABLED for a test key), missing scope, or
            the acting broker is not active.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limited. See Retry-After.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal error. Safe to retry with the same Idempotency-Key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
            - doc_url
            - request_id
          properties:
            type:
              type: string
              enum:
                - invalid_request
                - authentication
                - permission
                - not_found
                - conflict
                - rate_limit
                - api_error
            code:
              type: string
              description: >-
                Stable, machine-readable error code. Branch on this, never on
                `message`.
              examples:
                - INVALID_REQUEST
                - INVALID_JSON
                - INVALID_API_VERSION
                - INVALID_PAGINATION
                - IDEMPOTENCY_KEY_REQUIRED
                - IDEMPOTENCY_KEY_INVALID
                - VALIDATION_FAILED
                - INVALID_API_KEY
                - KEY_REVOKED
                - KEY_EXPIRED
                - MISSING_SCOPE
                - BROKER_NOT_ACTIVE
                - DEFAULT_BROKER_INACTIVE
                - ACTING_BROKER_NOT_ALLOWED
                - API_ACCESS_NOT_ENABLED
                - TEST_MODE_NOT_ENABLED
                - TEST_MODE_ONLY
                - NOT_FOUND
                - METHOD_NOT_ALLOWED
                - IDEMPOTENCY_KEY_REUSED
                - IDEMPOTENCY_REQUEST_IN_PROGRESS
                - QUOTE_EXPIRED
                - QUOTE_ALREADY_INTERESTED
                - RATE_LIMITED
                - INTERNAL
                - IDEMPOTENCY_RECORD_LOST
                - SERVICE_UNAVAILABLE
            message:
              type: string
            param:
              type: string
            details:
              type: array
              items:
                type: object
                required:
                  - code
                  - message
                properties:
                  code:
                    type: string
                  message:
                    type: string
                  param:
                    type: string
            doc_url:
              type: string
              format: uri
            request_id:
              type: string
              pattern: ^req_
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: bl_live_… or bl_test_… API key.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.