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

# Health / auth check

> Confirma que a API key é válida e retorna organização e scopes.
Consome o bucket de rate limit **read**.




## OpenAPI

````yaml /openapi.yaml get /api/public/v1/ping
openapi: 3.1.0
info:
  title: aidesk Public API
  version: 1.0.0
  summary: API pública para envio de mensagens, consulta de status e webhooks
  description: >
    Base oficial: `https://api.aideskbr.com`


    Autenticação com API key (`ak_live_...`). A organização é resolvida pela key
    —

    não envie `organization_id` nestas rotas.
  contact:
    name: aidesk
    url: https://developers.aideskbr.com
servers:
  - url: https://api.aideskbr.com
    description: Produção
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: Health
    description: Verificação de autenticação e escopos
  - name: Messages
    description: Envio e consulta de mensagens
  - name: Webhooks
    description: Endpoints para receber eventos de delivery
paths:
  /api/public/v1/ping:
    get:
      tags:
        - Health
      summary: Health / auth check
      description: |
        Confirma que a API key é válida e retorna organização e scopes.
        Consome o bucket de rate limit **read**.
      operationId: ping
      responses:
        '200':
          description: Key válida
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PingResponse'
              example:
                ok: true
                organization_id: 8ad612a7-2a83-48da-90fc-f40b8f540f37
                organization_name: Live Well
                api_key_id: ff6cc3ed-5b44-4190-a8bd-7e4933548a32
                api_key_prefix: ak_live_GpctdVg2
                scopes:
                  - messages:send
                  - messages:read
                  - contacts:read
                  - contacts:write
                  - templates:read
                  - webhooks:manage
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  headers:
    X-RateLimit-Limit:
      description: Limite do bucket na janela atual
      schema:
        type: integer
    X-RateLimit-Remaining:
      description: Restante no bucket
      schema:
        type: integer
    X-RateLimit-Reset:
      description: Unix timestamp do reset
      schema:
        type: integer
    Retry-After:
      description: Segundos para retry (em 429)
      schema:
        type: integer
  schemas:
    PingResponse:
      type: object
      required:
        - ok
        - organization_id
        - organization_name
        - api_key_id
        - api_key_prefix
        - scopes
      properties:
        ok:
          type: boolean
        organization_id:
          type: string
          format: uuid
        organization_name:
          type: string
        api_key_id:
          type: string
          format: uuid
        api_key_prefix:
          type: string
        scopes:
          type: array
          items:
            type: string
    ErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              examples:
                - api_key_required
                - rate_limited
                - idempotency_key_reused
            message:
              type: string
  responses:
    Unauthorized:
      description: API key ausente, inválida, revogada ou expirada
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            missing:
              value:
                error:
                  code: api_key_required
                  message: API key ausente
    RateLimited:
      description: Rate limit excedido
      headers:
        Retry-After:
          $ref: '#/components/headers/Retry-After'
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              code: rate_limited
              message: Rate limit exceeded
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: ak_live
      description: 'Authorization: Bearer ak_live_<secret>'
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: 'Alternativa ao Bearer — X-Api-Key: ak_live_<secret>'

````