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

# Validate the authenticated user's stored upstream gateway key

> Contacts the provisioner at most once per minute. A confirmed invalid credential is cleared and reported as invalid; replacement requires a subsequent ensure call. A missing credential is reported without contacting the provisioner.



## OpenAPI

````yaml /openapi/next.yaml post /gateway/key/validate
openapi: 3.1.0
info:
  title: Blue — Service Contract
  version: 0.1.0
  description: >
    The client-side contract the `blue` CLI expects from the provisioned
    service. The reference `control-api` implements it; any BYO service that
    honors these shapes can be swapped in. Gateway-mode inference JWT issuance
    is OPTIONAL — governance-only deployments need only `GET
    /governance-config`. CLI callers use OAuth 2.0 access tokens issued through
    RFC 8628 device authorization; dashboard callers use an HTTP-only Better
    Auth session cookie.
servers:
  - url: https://harness.example.com
    description: Replace with the Control API URL for your deployment.
security:
  - oauthDevice: []
tags:
  - name: System
    description: Service health and authenticated identity.
  - name: Configuration
    description: Personalized governance policy and client reconciliation state.
  - name: Gateway
    description: Per-user managed inference-gateway credential lifecycle.
  - name: Sessions
    description: Raw-session upload, metadata, and download lifecycle.
  - name: Administration
    description: Organization-administrator policy and client operations.
  - name: User management
    description: >-
      Organization user lifecycle, session revocation, and invitation
      operations.
  - name: Identity provisioning
    description: SCIM 2.0 user and group provisioning for an external identity provider.
paths:
  /gateway/key/validate:
    post:
      tags:
        - Gateway
      summary: Validate the authenticated user's stored upstream gateway key
      description: >-
        Contacts the provisioner at most once per minute. A confirmed invalid
        credential is cleared and reported as invalid; replacement requires a
        subsequent ensure call. A missing credential is reported without
        contacting the provisioner.
      operationId: validateGatewayKey
      responses:
        '200':
          description: Current managed gateway-key status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayKeyResponse'
        '403':
          description: >-
            The provisioner reports that no gateway account exists for the
            authenticated user
components:
  schemas:
    GatewayKeyResponse:
      type: object
      required:
        - enabled
        - email
        - status
      properties:
        enabled:
          type: boolean
        email:
          type: string
          format: email
        status:
          type: string
          enum:
            - ready
            - missing
            - invalid
            - recovering
            - error
        alias:
          type:
            - string
            - 'null'
        external_id:
          type:
            - string
            - 'null'
          description: Opaque gateway identifier, never the credential value.
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
        last_reconciled_at:
          type:
            - string
            - 'null'
          format: date-time
        error:
          type:
            - string
            - 'null'
        invalidated_at:
          type:
            - string
            - 'null'
          format: date-time
        invalidation_reason:
          type:
            - string
            - 'null'
        next_retry_at:
          type:
            - string
            - 'null'
          format: date-time
  securitySchemes:
    oauthDevice:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        OAuth 2.0 access token obtained through RFC 8628 at
        /api/auth/device/code and /api/auth/oauth2/token. The API enforces
        governance:read, session:write, and client-status:write as appropriate.

````