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

# Get all Channels

> Returns all affiliate channels owned by the authenticated user (max 20 per request). Does not filter by network or organization. Excludes WhiteLabel channels.

## Get all Channels

Lista todos os canais do afiliado autenticado. O `affiliateId` é derivado da API key — não é enviado na URL.

Cada canal representa um meio de divulgação do afiliado (ex.: Blog, Push) e é usado na geração de links via shortener.

### Comportamento

* Retorna canais onde `user_id` corresponde ao afiliado da chave
* Exclui canais de WhiteLabel (`white_label_id` nulo)
* **Não** filtra por rede ou organização — todos os canais do afiliado elegíveis são retornados
* Retorno limitado a no máximo **20** canais por request

### HTTP Request

```http theme={null}
GET https://api-beta.lomadee.com.br/affiliate/channels
```

### Headers

| Header      | Valor                                        |
| ----------- | -------------------------------------------- |
| `x-api-key` | Chave de afiliado com escopo `channels:read` |

### Example Request

```bash theme={null}
curl -X GET "https://api-beta.lomadee.com.br/affiliate/channels" \
  -H "x-api-key: your-api-key"
```

### Response Format

<ResponseField name="data" type="array">
  Lista de canais do afiliado
</ResponseField>

<ResponseField name="count" type="integer">
  Quantidade de canais retornados
</ResponseField>

### Channel Object

<ResponseField name="id" type="string">
  Identificador único do canal
</ResponseField>

<ResponseField name="name" type="string">
  Nome do tipo de canal (ex.: Blog, PushNotification)
</ResponseField>

<ResponseField name="active" type="boolean">
  Se o canal está ativo
</ResponseField>

<ResponseField name="createdAt" type="string">
  Data de criação (ISO 8601)
</ResponseField>

### Example Response

```json theme={null}
{
  "data": [
    {
      "id": "b328b5ff-af33-405a-994b-70192267419c",
      "name": "Blog",
      "active": true,
      "createdAt": "2025-01-15T10:30:00.000Z"
    }
  ],
  "count": 1
}
```

### Error Responses

| Status | Descrição                                       |
| ------ | ----------------------------------------------- |
| `401`  | API key ausente, inválida ou tipo incorreto     |
| `403`  | Escopo `channels:read` ausente na chave         |
| `404`  | Afiliado não encontrado                         |
| `429`  | Rate limit excedido (60 req/60s por chave + IP) |


## OpenAPI

````yaml GET /affiliate/channels
openapi: 3.1.0
info:
  title: Lomadee Public API
  description: >-
    REST API for affiliate brands, channels, campaigns, orders, products, and
    link shortener. Authenticate with x-api-key. Rate limit: 60 req/60s per key
    and IP.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.lomadee.com.br/
    description: Production — target URL for all integrations
  - url: https://api-beta.lomadee.com.br/
    description: Beta (legacy) — available during transition; will be retired soon
security:
  - x-api-key: []
paths:
  /affiliate/channels:
    get:
      description: >-
        Returns all affiliate channels owned by the authenticated user (max 20
        per request). Does not filter by network or organization. Excludes
        WhiteLabel channels.
      responses:
        '200':
          description: Channel list response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AffiliateChannelList'
          headers:
            X-RateLimit-Limit:
              description: Max requests per window
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Remaining requests in window
              schema:
                type: integer
            X-RateLimit-Reset:
              description: Unix timestamp when window resets
              schema:
                type: integer
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Affiliate not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    AffiliateChannelList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/AffiliateChannelItem'
        count:
          type: integer
          description: Number of channels returned
    Error:
      required:
        - message
        - error
        - statusCode
      type: object
      properties:
        message:
          type: string
          description: Human-readable error message
        error:
          type: string
          description: Error type/category
        statusCode:
          type: integer
          format: int32
          description: HTTP status code
    AffiliateChannelItem:
      type: object
      properties:
        id:
          type: string
          description: Channel identifier
        name:
          type: string
          description: Available channel type name
        active:
          type: boolean
          description: Whether the channel is active
        createdAt:
          type: string
          format: date-time
          description: Channel creation date
  responses:
    Unauthorized:
      description: API key missing or invalid
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              message:
                type: string
              code:
                type: string
    Forbidden:
      description: Valid key without required scope
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              message:
                type: string
              code:
                type: string
    TooManyRequests:
      description: Rate limit exceeded (60 req/60s per key + IP)
      headers:
        X-RateLimit-Limit:
          description: Max requests per window
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: Remaining requests in window
          schema:
            type: integer
        X-RateLimit-Reset:
          description: Unix timestamp when window resets
          schema:
            type: integer
        Retry-After:
          description: Seconds until retry
          schema:
            type: integer
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              message:
                type: string
              code:
                type: string
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key

````