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

# Listar Recompensas

> Lista as recompensas disponíveis para resgate

# Listar Recompensas

Retorna as recompensas (prêmios) disponíveis para resgate pelos clientes da empresa.

## Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.indiqai.com/api/v1/public/rewards" \
    -H "X-API-Key: indiqai_sua_chave_aqui"
  ```

  ```typescript JavaScript theme={null}
  const response = await fetch('https://api.indiqai.com/api/v1/public/rewards', {
    headers: { 'X-API-Key': 'indiqai_sua_chave_aqui' }
  });

  const data = await response.json();
  ```

  ```python Python theme={null}
  import httpx

  response = httpx.get(
      'https://api.indiqai.com/api/v1/public/rewards',
      headers={'X-API-Key': 'indiqai_sua_chave_aqui'}
  )

  data = response.json()
  ```
</CodeGroup>

## Response

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "rewards": [
      {
        "uid": "rwd_001",
        "name": "Pizza Margherita Grátis",
        "description": "Uma pizza margherita média de cortesia",
        "points_cost": 500,
        "image_url": "https://storage.indiqai.com/rewards/pizza.jpg",
        "available": true,
        "stock": 10,
        "category": "Alimentação"
      },
      {
        "uid": "rwd_002",
        "name": "10% de Desconto",
        "description": "Desconto de 10% em qualquer pedido",
        "points_cost": 200,
        "image_url": null,
        "available": true,
        "stock": null,
        "category": "Desconto"
      }
    ],
    "total": 2
  }
  ```

  ```json 401 Unauthorized theme={null}
  {
    "detail": "API Key inválida ou não fornecida"
  }
  ```
</ResponseExample>

## Campos da Resposta

<ResponseField name="rewards" type="array">
  Lista de recompensas disponíveis
</ResponseField>

<ResponseField name="rewards[].uid" type="string">
  ID único da recompensa
</ResponseField>

<ResponseField name="rewards[].name" type="string">
  Nome da recompensa
</ResponseField>

<ResponseField name="rewards[].description" type="string">
  Descrição da recompensa (pode ser null)
</ResponseField>

<ResponseField name="rewards[].points_cost" type="integer">
  Custo em pontos para resgate
</ResponseField>

<ResponseField name="rewards[].image_url" type="string">
  URL da imagem (pode ser null)
</ResponseField>

<ResponseField name="rewards[].available" type="boolean">
  Se a recompensa está disponível para resgate
</ResponseField>

<ResponseField name="rewards[].stock" type="integer">
  Quantidade disponível em estoque (null = ilimitado)
</ResponseField>

<ResponseField name="rewards[].category" type="string">
  Categoria da recompensa (pode ser null)
</ResponseField>

<ResponseField name="total" type="integer">
  Total de recompensas
</ResponseField>


## OpenAPI

````yaml GET /api/v1/public/rewards
openapi: 3.1.0
info:
  contact:
    email: support@indiqai.com
    name: IndiqAI Support
    url: https://indiqai.com/
  description: Especificação OpenAPI da API Pública IndiqAI.
  license:
    name: Proprietary
    url: https://indiqai.com/license
  title: IndiqAI API Pública
  version: 1.5.0
servers:
  - description: Produção
    url: https://api.indiqai.com
security: []
paths:
  /api/v1/public/rewards:
    get:
      tags:
        - API Pública
      summary: Listar recompensas
      description: Lista recompensas ativas disponíveis na empresa.
      operationId: list_rewards_api_v1_public_rewards_get
      parameters:
        - description: Chave de API
          in: header
          name: X-API-Key
          required: true
          schema:
            description: Chave de API
            title: X-Api-Key
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/PublicRewardResponse'
                title: Response List Rewards Api V1 Public Rewards Get
                type: array
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    PublicRewardResponse:
      description: Dados de uma recompensa.
      properties:
        active:
          default: true
          title: Active
          type: boolean
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        id:
          title: Id
          type: string
        image_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Image Url
        points_cost:
          anyOf:
            - type: integer
            - type: 'null'
          title: Points Cost
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
      required:
        - id
      title: PublicRewardResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object

````