> ## 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 Campaigns

> Returns all campaigns from the system that the user has access to

## Get all Campaigns

Returns paginated campaigns (coupons and offers). Requires scope `campaigns:read`.

Offers are listed here — there is no separate `/affiliate/offers` endpoint. Use `types=Offer` to filter offers.

### HTTP Request

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

### Query Parameters

| Parameter           | Type      | Description                                                 |
| ------------------- | --------- | ----------------------------------------------------------- |
| `page`              | integer   | Page number (default 1)                                     |
| `limit`             | integer   | Items per page (default 10, max 20)                         |
| `types`             | string    | Comma-separated: `PersonalCoupon`, `GenericCoupon`, `Offer` |
| `offerType`         | string    | For offers: `Spreadsheet` or `Url`                          |
| `organizationId`    | string    | Filter by brand UUID                                        |
| `organizationIds`   | string    | Comma-separated brand UUIDs                                 |
| `name`              | string    | Search by name                                              |
| `isHighlight`       | boolean   | Highlight filter                                            |
| `categories`        | string    | Comma-separated categories                                  |
| `status`            | string    | `onTime`, `expired`, `scheduled` (comma-separated)          |
| `startAt` / `endAt` | date-time | Period filter                                               |

### Response

```json theme={null}
{
  "data": [],
  "meta": {
    "total": 0,
    "page": 1,
    "limit": 10,
    "totalPages": 0
  }
}
```

### Example — list offers

```bash theme={null}
curl -X GET "https://api-beta.lomadee.com.br/affiliate/campaigns?types=Offer&page=1&limit=10" \
  -H "x-api-key: your-api-key"
```


## OpenAPI

````yaml GET /affiliate/campaigns
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/campaigns:
    get:
      description: Returns all campaigns from the system that the user has access to
      parameters:
        - name: page
          in: query
          description: Page number for pagination
          schema:
            type: integer
            format: int32
        - name: limit
          in: query
          description: 'Maximum number of results per page (default: 10, max: 20)'
          schema:
            type: integer
            format: int32
            default: 10
            maximum: 20
        - name: types
          in: query
          description: Campaign types to filter
          schema:
            type: array
            items:
              type: string
              enum:
                - PersonalCoupon
                - GenericCoupon
                - Offer
        - name: offerType
          in: query
          description: >-
            Type of offer to filter. If not provided, all offers will be
            returned. 

             `Spreadsheet`: Spreadsheet offer type. In this case, links will not be generated automatically. You need to use the `POST /affiliate/shortener/url` endpoint to generate links by passing the campaign `id` as a parameter through featureId. 

             `Url`: Link offer type. In this case, links will be generated automatically.
          schema:
            type: array
            items:
              type: string
              enum:
                - Spreadsheet
                - Url
        - name: organizationId
          in: query
          description: Brand identifier to filter campaigns
          schema:
            type: string
        - name: organizationIds
          in: query
          description: List of brand identifiers to filter campaigns
          schema:
            type: array
            items:
              type: string
        - name: name
          in: query
          description: Campaign name to search for
          schema:
            type: string
        - name: isHighlight
          in: query
          description: Filter campaigns by highlight status
          schema:
            type: boolean
        - name: categories
          in: query
          description: List of categories to filter campaigns
          schema:
            type: array
            items:
              type: string
        - name: status
          in: query
          description: >-
            Filter campaigns by status. Accepts multiple values separated by
            comma. 

             `onTime`: Active campaign within period. 

             `expired`: Campaign expired (period.endAt has passed). 

             `scheduled`: Campaign scheduled (period.startAt has not arrived yet). 

             Example: `status=onTime,expired`
          schema:
            type: array
            items:
              type: string
              enum:
                - onTime
                - expired
                - scheduled
        - name: period
          in: query
          description: Campaign period filter
          schema:
            type: object
            properties:
              startAt:
                type: string
                format: date
                description: Campaign start date
              endAt:
                type: string
                format: date
                description: Campaign end date
        - name: startAt
          in: query
          description: Campaign start date (ISO 8601). Must be used together with endAt.
          schema:
            type: string
            format: date-time
        - name: endAt
          in: query
          description: Campaign end date (ISO 8601). Must be used together with startAt.
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: Campaign response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AffiliateCampaign'
          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'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    AffiliateCampaign:
      required: []
      type: object
      properties:
        data:
          type: object
          properties:
            id:
              description: The id of the campaign
              type: string
            name:
              description: The name of the campaign
              type: string
            period:
              description: >-
                The period of the campaign. If this field is null, the campaign
                is a permanent campaign.
              type: object
              properties:
                startAt:
                  type: string
                  description: The start date of the campaign
                endAt:
                  type: string
                  description: The end date of the campaign
            type:
              description: >-
                The type of the campaign. Possible values: `PersonalCoupon`,
                `GenericCoupon`, `Offer`
              type: string
            offerType:
              description: >-
                Type of offer (when type is Offer). Possible values:
                `Spreadsheet`, `Url`
              type: string
              enum:
                - Spreadsheet
                - Url
            categories:
              description: The categories of the campaign
              type: array
              items:
                type: string
            description:
              description: The description of the campaign
              type: string
            code:
              description: The coupon code of the campaign
              type: string
            url:
              description: The URL of the campaign
              type: string
            organizationId:
              description: The id of the brand that the campaign belongs to
              type: string
            isHighlight:
              description: If this campaign is a highlight campaign
              type: boolean
            status:
              description: >-
                The status of the campaign, calculated automatically based on
                the period. Possible values: `onTime` (active campaign within
                period), `expired` (campaign expired - period.endAt has passed),
                `scheduled` (campaign scheduled - period.startAt has not arrived
                yet)
              type: string
              enum:
                - onTime
                - expired
                - scheduled
            createdAt:
              description: The date and time the campaign was created
              type: string
            channels:
              $ref: '#/components/schemas/Channels'
            mediaKit:
              $ref: '#/components/schemas/MediaKit'
        meta:
          $ref: '#/components/schemas/Meta'
    Channels:
      description: >-
        List of all your channels. Each channel generates a URL with its
        specific parameters. If a channel has any brand restrictions, the link
        will not be generated and the message field will be filled with the
        restriction type.
      type: array
      items:
        type: object
        properties:
          id:
            type: string
            description: Channel identifier
          name:
            type: string
            description: Channel name
          availableChannel:
            type: object
            properties:
              id:
                type: string
                description: Available channel identifier
              name:
                type: string
                description: Available channel name
          shortUrls:
            type: array
            items:
              type: string
              description: Shortened URLs for the channel
          message:
            type: string
            description: >-
              If the channel has any brand restrictions, the link will not be
              generated and this field will contain the restriction type.
              Possible values: 

               `This channel is not allowed by the organization.` 
               
               `Organization approval is required to generate links.`
    MediaKit:
      type: object
      nullable: true
      properties:
        banners:
          type: array
          items:
            type: string
          nullable: true
          description: Array of banner URLs available for marketing
        emailMarketing:
          nullable: true
          description: Email marketing materials (when available)
      description: >-
        Marketing materials available for affiliates. Returns null when not
        available.
    Meta:
      type: object
      properties:
        total:
          type: integer
        page:
          type: integer
        limit:
          type: integer
        totalPages:
          type: integer
  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

````