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

# Kubernetes Readiness

> Kubernetes readiness probe endpoint.

**Port**: 9002 (private)

Performs comprehensive health checks:
- Database connectivity and query execution
- External service availability (accounts service, notification service)

Returns 200 OK when service can handle traffic, 503 Service Unavailable otherwise.




## OpenAPI

````yaml GET /healthz/ready
openapi: 3.1.0
info:
  title: AION Authentication Service API
  description: >
    Authentication and user management service for the AION platform.


    This service provides:

    - JWT and API key validation

    - User profile management

    - API key lifecycle management

    - User invitation and team management


    ## Authentication


    Most endpoints require authentication via one of:

    - **Bearer Token (JWT)**: OAuth2/OIDC tokens from Auth0

    - **API Key**: Service-generated API keys for machine-to-machine
    authentication


    Protected endpoints also require the `x-account-id` header to specify the
    account context.


    ## Error Handling


    All errors follow a consistent format with error codes prefixed by category:

    - `AUTH_*`: Authentication errors

    - `USER_*`: User management errors

    - `ACCT_*`: Account errors

    - `ROLE_*`: Role/permission errors

    - `APIKEY_*`: API key errors

    - `GEN_*`: General errors
  version: 1.0.0
  contact:
    name: AION Intelligence
  license:
    name: Proprietary
servers:
  - url: http://localhost:9001
    description: Local development server (Public API)
  - url: http://localhost:9002
    description: Local development server (Private/Health endpoints - internal only)
  - url: https://api.aion.ai
    description: Production server (Public API)
  - url: https://api-internal.aion.ai
    description: Production server (Private/Health endpoints - internal network only)
security: []
tags:
  - name: Health
    description: >
      Service health and status endpoints.


      **IMPORTANT**: These endpoints are served on a separate private port (9002
      by default).

      They should NOT be exposed publicly and are intended for:

      - Kubernetes health probes (readiness/liveness)

      - Internal monitoring systems

      - Load balancer health checks
  - name: Authentication
    description: Authentication and credential validation
  - name: Webhooks
    description: Webhook endpoints for external services (Auth0)
  - name: User Profile
    description: User profile management
  - name: Users
    description: User management and invitations
  - name: API Keys
    description: API key lifecycle management
paths:
  /healthz/ready:
    get:
      tags:
        - Health
      summary: Readiness check
      description: >
        Kubernetes readiness probe endpoint.


        **Port**: 9002 (private)


        Performs comprehensive health checks:

        - Database connectivity and query execution

        - External service availability (accounts service, notification service)


        Returns 200 OK when service can handle traffic, 503 Service Unavailable
        otherwise.
      operationId: getReadiness
      responses:
        '200':
          description: Service is ready to handle traffic
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReadinessResponse'
              example:
                status: ready
                service: authn-svc
                version: 1.0.0
                timestamp: '2024-01-15T10:30:00Z'
                checks:
                  database:
                    status: healthy
                    latency: 2.5ms
                  accounts_service:
                    status: healthy
                    latency: 1.2ms
                  notification_service:
                    status: healthy
                    latency: 0.8ms
        '503':
          description: Service is not ready
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReadinessResponse'
              example:
                status: not_ready
                service: authn-svc
                version: 1.0.0
                timestamp: '2024-01-15T10:30:00Z'
                checks:
                  database:
                    status: unhealthy
                    latency: 5000ms
                    error: database connection failed
      servers:
        - url: http://localhost:9002
          description: Health server (private port)
components:
  schemas:
    ReadinessResponse:
      type: object
      description: Response from the readiness probe endpoint
      properties:
        status:
          type: string
          enum:
            - ready
            - not_ready
          description: Current readiness status
        service:
          type: string
          example: authn-svc
        version:
          type: string
          example: 1.0.0
        timestamp:
          type: string
          format: date-time
          description: UTC timestamp of the check
        checks:
          type: object
          description: Individual health check results
          additionalProperties:
            $ref: '#/components/schemas/HealthCheckDetail'
    HealthCheckDetail:
      type: object
      description: Details of an individual health check
      properties:
        status:
          type: string
          enum:
            - healthy
            - unhealthy
        latency:
          type: string
          description: Time taken for the check
          example: 2.5ms
        error:
          type: string
          description: Error message if check failed

````