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

# Verificar a API key

> Confirma que a API key é válida e pertence a um partner ativo

Use-o para verificar a integração antes de consultar dados: se responder `pong`, a key tem o scope `partners:read` e pertence a um partner ativo.

Ele não consulta subempresas nem conta dados, então é a forma mais barata de validar uma key nova ou rotacionada.

| Resposta | Significado |
| - | - |
| `200` com `pong` | A key é válida e o partner está ativo. |
| `401` | A key está ausente ou é inválida. |
| `403` | A key não tem `partners:read`, usa o curinga `*` ou não pertence a um partner ativo. |

```bash cURL theme={null}
curl --request GET \
  --url 'https://gateway.jelou.ai/v1/partner/ping' \
  --header 'x-api-key: <API_KEY>'
```

```json 200 Sucesso theme={null}
{
  "success": true,
  "result": "pong",
  "statusCode": 200
}
```

```json 403 Sem partners:read theme={null}
{
  "success": false,
  "statusCode": 403
}
```


## OpenAPI

````yaml api/partner/openapi.json GET /ping
openapi: 3.1.0
info:
  title: Jelou Partner API
  version: 1.0.0
  description: >-
    Read-only API for partners to monitor the companies subscribed to their
    products. The partner is resolved from the API key, so no route takes a
    partner identifier.
servers:
  - url: https://gateway.jelou.ai/v1/partner
    description: Production
security:
  - apiKey: []
paths:
  /ping:
    get:
      summary: Verify the API key
      description: Confirms that the API key is valid and belongs to an active partner.
      operationId: pingPartner
      responses:
        '200':
          description: The key belongs to an active partner.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - result
                  - statusCode
                properties:
                  success:
                    const: true
                  result:
                    const: pong
                  statusCode:
                    const: 200
        '401':
          description: Missing or invalid API key.
        '403':
          description: >-
            The API key lacks the `partners:read` scope, carries the `*`
            wildcard, or does not belong to an active partner.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - statusCode
                properties:
                  success:
                    const: false
                  statusCode:
                    const: 403
        '404':
          description: >-
            Resource not found. Also returned for a company that is not a
            subscriber of the partner.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - statusCode
                properties:
                  success:
                    const: false
                  statusCode:
                    const: 404
        '429':
          description: 'Rate limit exceeded: 60 requests per minute.'
        '500':
          description: Unexpected error.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - statusCode
                properties:
                  success:
                    const: false
                  statusCode:
                    const: 500
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Organization API key with the `partners:read` scope.

````

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