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

# Marketing Campaigns

> Returns a list of marketing campaigns



## OpenAPI

````yaml GET /api/v1/campaigns
openapi: 3.0.1
info:
  title: Engagement Agents Marketing Campaign API
  description: >-
    This is the API for the Engagement Agents Marketing Campaigns. It allows you
    to read data about upcoming and active campaigns. You can use this API to
    display the data on your website or in your app.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://services.engagementagents.com
    description: Production server
security:
  - bearerAuth: []
paths:
  /api/v1/campaigns:
    get:
      description: Returns a list of marketing campaigns
      parameters:
        - name: imageSize
          in: query
          required: true
          description: >-
            The image size in WxH format that will determine which image to use
            in each of the returned campaigns
          schema:
            type: string
        - name: limit
          in: query
          description: The maximum number of results to return
          schema:
            type: integer
            format: int32
            default: 50
        - name: page
          in: query
          description: The page number to return given the limit
          schema:
            type: integer
            format: int32
            default: 1
        - name: sortKey
          in: query
          description: The key to sort the results by
          schema:
            type: string
            format: date
            default: startDate
            enum:
              - startDate
              - endDate
              - publishByDate
              - brand
        - name: sortOrder
          in: query
          description: The order to sort the results by
          schema:
            type: string
            default: asc
            enum:
              - asc
              - desc
        - name: search
          in: query
          description: >-
            A search term to filter the results by. Fields that will not be
            included in search; imageUrl. All other fields will be included in
            the search. For searching dates, use the format YYYY-MM-DD
          schema:
            type: string
        - name: type
          in: query
          description: >-
            An array of types to filter the results by. If not provided, all
            types will be returned.
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
              enum:
                - Sales
                - Events
                - New Arrivals
                - Loyalty
            default: null
      responses:
        '200':
          description: A list of marketing campaigns for your given location
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    description: Indicates if the request was successful
                  message:
                    type: string
                    description: A message describing the result of the request
                  statusCode:
                    type: integer
                    description: The status code of the response
                  languages:
                    description: >-
                      An array of languages that the campaigns are available in.
                      Note, some languages may not have translations
                    type: array
                    items:
                      type: string
                  types:
                    description: >-
                      An array of campaign types that are in the returned
                      results. Note, these may only include a subset of the
                      types available or that were requested in the query
                    type: array
                    items:
                      type: string
                  pagination:
                    $ref: '#/components/schemas/Pagination'
                    description: Information about the pagination of the results returned
                  data:
                    description: The list of marketing campaigns
                    type: array
                    items:
                      $ref: '#/components/schemas/MarketingCampaign'
              examples:
                Success:
                  summary: Successful Response
                  value:
                    ok: true
                    message: Campaigns retrieved successfully
                    statusCode: 200
                    languages:
                      - en
                      - fr
                    types:
                      - Sales
                      - Events
                    pagination:
                      totalItems: 150
                      totalPages: 3
                      currentPage: 2
                      pageSize: 50
                      next: /api/v1/campaigns?limit=50&page=3
                      prev: /api/v1/campaigns?limit=50&page=1
                    data:
                      - headline:
                          en: Make Special Moments Shine Bright
                          fr: Faites scintiller les moments spéciaux
                        description:
                          en: >-
                            Wrap up a special set to make their season
                            unforgettable. Shop now and save 20% on our
                            thoughtfully styled gift sets.
                          fr: >-
                            Emballez un ensemble spécial pour rendre leur saison
                            des fêtes inoubliable. Magasinez maintenant et
                            obtenez un rabais de 20% sur nos ensembles-cadeaux
                            soigneusement agencés.
                        type: Sales
                        startDate: '2022-12-08'
                        endDate: '2022-12-15'
                        publishByDate: '2022-12-08'
                        campaignNumber: '62'
                        brand: Pandora
                        brandId: 1853b8a4-63a7-4fb9-a973-3a27bdd5e1b4
                        storeIds:
                          - 84b5de1a-9005-4239-8f27-b8a9fe7c32ef
                          - fec6959e-3607-4614-8695-3ad7e745ca20
                        slug: pandora-62-make-special-moments-shine-bright
                        imageUrls:
                          en: >-
                            https://data-engagementagents-dev.s3.ca-central-1.amazonaws.com/Bwu8h8ZoLMfFispdncSaTla2Xvkn.png
                          fr: >-
                            https://data-engagementagents-dev.s3.ca-central-1.amazonaws.com/om8h5frznPNk15SY3HE6loRtz7Bn.png
                        updatedAt: '2022-12-19'
                      - headline:
                          en: 40% OFF YOUR ENTIRE PURCHASE
                        description:
                          en: >-
                            • 40% off your entire purchase • Accessories 50% off
                            • Visit your nearest Levi's Store for more great
                            deals!
                        type: Loyalty
                        startDate: '2023-11-20'
                        endDate: '2023-11-22  '
                        publishByDate: '2023-11-20'
                        campaignNumber: '423'
                        brand: Levi's US
                        brandId: 5b9b828e-7884-4328-bac0-57903c39bb93
                        storeIds:
                          - 2d382f8a-b342-4d79-b89c-d9aa1974657d
                        slug: levis-us-423-40-off-your-entire-purchase
                        imageUrl:
                          en: >-
                            https://data-engagementagents-dev.s3.ca-central-1.amazonaws.com/3UhbkfpYKe9RjNvjdyRh1qWZt3O6.png
                        updatedAt: '2023-11-23'
        '400':
          description: User error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                InvalidParameter:
                  summary: Invalid Parameter
                  value:
                    ok: false
                    message: Bad Request
                    statusCode: 400
                    errors:
                      - >-
                        Invalid parameter: 'sortKey' must be one of 'startDate',
                        'endDate', 'publishByDate', 'brand'.
                      - >-
                        Invalid parameter: 'imageSize' must be in the format
                        'HxW'.
                      - >-
                        Invalid parameter: 'imageSize' must be an image size
                        associated with your Mall.
                    data: null
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Unauthorized:
                  summary: Unauthorized
                  value:
                    ok: false
                    message: Unauthorized Request
                    statusCode: 401
                    errors:
                      - >-
                        You are making an unauthorized request. Please provide a
                        valid authorization token. If you do not have one,
                        please contact the support@engagementagents.com.
                    data: null
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                InternalServerError:
                  summary: Too Many Requests
                  value:
                    ok: false
                    message: Too Many Requests
                    statusCode: 429
                    errors:
                      - >-
                        You have exceeded the rate limit for this endpoint. We
                        allow a maximum of 100 requests per minute. Please try
                        again later or contact support@engagementagents.com.
                    data: null
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                InternalServerError:
                  summary: Internal Server Error
                  value:
                    ok: false
                    message: Internal Server Error
                    statusCode: 500
                    errors:
                      - >-
                        An internal server error occurred. Please contact
                        support@engagementagents.com for assistance.
                    data: null
components:
  schemas:
    Pagination:
      type: object
      properties:
        totalItems:
          type: integer
          description: The total number of items
        totalPages:
          type: integer
          description: The total number of pages
        currentPage:
          type: integer
          description: The current page number
        pageSize:
          type: integer
          description: The number of items per page
        next:
          type: string
          nullable: true
          description: URL to the next page of results, if available
        prev:
          type: string
          nullable: true
          description: URL to the previous page of results, if available
    MarketingCampaign:
      required:
        - headline
        - description
        - startDate
        - endDate
        - type
        - publishByDate
        - campaignNumber
        - brand
        - brandId
        - storeIds
        - slug
        - updatedAt
      type: object
      properties:
        headline:
          description: Name of the campaign
          type: object
          properties:
            '[languageCode]':
              description: >-
                The key is the language code. The value is the headline in that
                language
              type: string
        description:
          description: Long description of the campaign
          type: object
          properties:
            '[languageCode]':
              description: >-
                The key is the language code. The value is the description in
                that language
              type: string
        type:
          description: The type of the campaign
          type: string
        startDate:
          description: The start date of the campaign
          type: string
          format: date
        endDate:
          description: The end date of the campaign
          type: string
          format: date
        publishByDate:
          description: The date the campaign will be published (go live) by
          type: string
          format: date
        campaignNumber:
          description: >-
            A brand-assigned identifier. Different brands can have the same
            campaign number, but each brand will have only one unique campaign
            per number
          type: string
        brand:
          description: The brand the campaign is being published for
          type: string
        brandId:
          description: The unique identifier for the brand
          type: string
        storeIds:
          description: >-
            The unique identifiers for the stores the campaign is being
            published for
          type: array
          items:
            type: string
        slug:
          description: >-
            The slug for the campaign. Will always return en version if present
            otherwise the primary language will be returned
          type: string
        imageUrl:
          description: The URL to the image for the campaign
          nullable: true
          type: object
          properties:
            '[languageCode]':
              description: >-
                The key is the language code. The value is the URL to the image
                in that language
              type: string
        updatedAt:
          description: The date the campaign was last updated
          type: string
          format: date
    Error:
      required:
        - success
        - message
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````