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

# List Campaign Templates

> Lists all campaign templates available in the project.

> 📘 Campaign Templates – Documentation
>
>Read the [Campaign Templates documentation](/build/campaign-templates) to learn more about this feature.



## OpenAPI

````yaml /openapi/templates.json get /v1/templates/campaigns
openapi: 3.0.1
info:
  title: Voucherify API - Templates
  version: v2018-08-01
  description: >-
    Voucherify promotion engine REST API. Please see
    https://docs.voucherify.io/docs for more details.
  contact:
    name: Voucherify Team
    url: https://www.voucherify.io/contact-support
    email: support@voucherify.io
  termsOfService: https://www.voucherify.io/legal/subscription-agreement
  license:
    name: MIT
    url: https://github.com/voucherifyio/voucherify-js-sdk/blob/main/LICENSE
servers:
  - url: https://{cluster}.voucherify.io
    description: Base URL
    variables:
      cluster:
        default: api
        enum:
          - api
          - us1.api
          - as1.api
          - download
          - us1.download
          - as1.download
security: []
paths:
  /v1/templates/campaigns:
    get:
      tags:
        - Templates
      summary: List Campaign Templates
      description: >-
        Lists all campaign templates available in the project.


        > 📘 Campaign Templates – Documentation

        >

        >Read the [Campaign Templates documentation](/build/campaign-templates)
        to learn more about this feature.
      operationId: list-campaign-templates
      parameters:
        - $ref: '#/components/parameters/limit'
        - schema:
            $ref: '#/components/schemas/ParameterString'
          in: query
          name: starting_after_id
          description: >-
            A cursor for pagination. It retrieves the campaign templates created
            after a template with the given ID.
        - schema:
            $ref: '#/components/schemas/ParameterTemplatesList'
          in: query
          name: order
          description: >-
            Sorts the results using one of the filtering options, where the dash
            - preceding a sorting option means sorting in a descending order.
        - schema:
            $ref: '#/components/schemas/ParameterBoolean'
          in: query
          name: include_total
          description: >-
            If set to `true`, the response returns the number of all campaign
            templates, regardless of the applied filters or limits. Set to
            `false` by default.
        - name: filters
          in: query
          schema:
            $ref: '#/components/schemas/ParameterFiltersListTemplates'
          description: Filters for listing templates.
          style: deepObject
          explode: true
      responses:
        '200':
          description: >-
            Returns a dictionary of campaign template objects. The templates are
            returned by creation date by default. The most recent objects appear
            last unless specified otherwise with the `order` parameter.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplatesCampaignsListResponseBody'
              examples:
                Example:
                  value:
                    object: list
                    data_ref: campaign_templates
                    campaign_templates:
                      - id: camp_tpl_hFK6hpVc9WKsWaBv4mz7uZn8
                        name: DISCOUNT-CAMPAIGN-TEMPLATE
                        description: New discount for Q4
                        campaign_type: DISCOUNT_COUPONS
                        created_at: '2024-06-21T13:03:09.431Z'
                        object: campaign_template
                      - id: camp_tpl_cR8va5Ga2nAi4Nxoi1I1qR8S
                        name: GIFT-CAMPAIGN-TEMPLATE
                        campaign_type: GIFT_VOUCHERS
                        created_at: '2024-07-05T14:26:31.600Z'
                        updated_at: '2024-07-05T14:27:02.905Z'
                        object: campaign_template
                    total: 14
                    has_more: true
      security:
        - X-App-Id: []
          X-App-Token: []
        - X-Voucherify-OAuth:
            - api
            - templates
components:
  parameters:
    limit:
      name: limit
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/ParameterLimit'
      description: >-
        Limits the number of objects to be returned. The limit can range between
        1 and 100 items. If no limit is set, it returns 10 items.
  schemas:
    ParameterString:
      type: string
    ParameterTemplatesList:
      type: string
      enum:
        - id
        - '-id'
    ParameterBoolean:
      type: boolean
    ParameterFiltersListTemplates:
      type: object
      properties:
        junction:
          $ref: '#/components/schemas/Junction'
        id:
          type: object
          description: Unique template ID.
          properties:
            conditions:
              $ref: '#/components/schemas/FilterConditionsString'
        name:
          type: object
          description: Unique user-defined template name.
          properties:
            conditions:
              $ref: '#/components/schemas/FilterConditionsString'
        campaign_type:
          type: object
          description: Campaign template campaign type.
          properties:
            conditions:
              type: object
              description: >-
                Data filters used to narrow down the data records to be returned
                in the result.
              properties:
                $in:
                  type: array
                  description: >-
                    Array of resource values that should be included in the
                    results (multiple values).
                  items:
                    type: string
                    enum:
                      - DISCOUNT_COUPONS
                      - GIFT_VOUCHERS
                $not_in:
                  type: array
                  description: >-
                    Array of resource values that should be included in the
                    results (multiple values).
                  items:
                    type: string
                    enum:
                      - DISCOUNT_COUPONS
                      - GIFT_VOUCHERS
                $is:
                  type: string
                  description: Value is exactly this value (single value).
                  enum:
                    - DISCOUNT_COUPONS
                    - GIFT_VOUCHERS
                $is_not:
                  type: string
                  description: Results omit this value (single value).
                  enum:
                    - DISCOUNT_COUPONS
                    - GIFT_VOUCHERS
                $has_value:
                  type: string
                  description: >-
                    Value is NOT null. The value for this parameter is an empty
                    string.
                $is_unknown:
                  type: string
                  description: >-
                    Value is null. The value for this parameter is an empty
                    string.
                $starts_with:
                  type: string
                  description: Value starts with the specified string.
                $ends_with:
                  type: string
                  description: Value ends with the specified string.
    TemplatesCampaignsListResponseBody:
      type: object
      title: Templates Campaign Template List Response Body
      description: Response body schema for **GET** `/v1/templates/campaign`.
      properties:
        object:
          type: string
          description: >-
            The type of the object represented by JSON. This object stores
            information about campaign templates.
          enum:
            - list
        data_ref:
          type: string
          description: >-
            Identifies the name of the JSON property that contains the array of
            campaign templates.
          enum:
            - data
        data:
          type: array
          description: Dictionary that contains an array of campaign templates.
          items:
            $ref: '#/components/schemas/CampaignTemplate'
        total:
          type: integer
          description: >-
            Total number of templates, regardless of the applied query
            parameters. Displayed only if the `include_total` query paremeter is
            set to `true`.
        has_more:
          type: boolean
          description: >-
            As query results are always limited (by the limit parameter), the
            `has_more` flag indicates if there are more records for given filter
            parameters. This lets you know if you can run another request to get
            more records returned in the results.
        more_starting_after:
          type: string
          description: >-
            Returns an ID that can be used to return another page of results.
            Use the template ID in the `starting_after_id` query parameter to
            display another page of the results starting after the template with
            that ID.
      required:
        - object
        - data_ref
        - campaign_template
        - has_more
    ParameterLimit:
      type: integer
      maximum: 100
      minimum: 1
    Junction:
      title: Junction
      description: >-
        Logical Operator Between Filters. Filter by conditions set on the
        `junction` parameter indicating how the `conditions` should be accounted
        for in the query. An `AND` is an all-inclusive logical operator, meaning
        the `AND` operator displays a record if **ALL** the conditions separated
        by AND are TRUE, while  an `OR` operator displays a record if **ANY** of
        the conditions separated by OR is TRUE.
      enum:
        - and
        - or
      type: string
    FilterConditionsString:
      title: Filter by conditions
      type: object
      description: >-
        Data filters used to narrow down the data records to be returned in the
        result.
      properties:
        $in:
          type: array
          description: >-
            Array of resource values that should be included in the results
            (multiple values).
          items:
            type: string
        $not_in:
          type: array
          description: >-
            Array of resource values that should be included in the results
            (multiple values).
          items:
            type: string
        $is:
          type: string
          description: Value is exactly this value (single value).
        $is_not:
          type: string
          description: Results omit this value (single value).
        $has_value:
          type: string
          description: Value is NOT null. The value for this parameter is an empty string.
        $is_unknown:
          type: string
          description: Value is null. The value for this parameter is an empty string.
        $starts_with:
          type: string
          description: Value starts with the specified string.
        $ends_with:
          type: string
          description: Value ends with the specified string.
        $contains:
          type: string
          description: Value includes the specified string.
        $not_contain:
          type: string
          description: Value does NOT include the specified string.
    CampaignTemplate:
      allOf:
        - $ref: '#/components/schemas/CampaignTemplateBase'
        - type: object
          properties:
            updated_at:
              type: string
              format: date-time
              description: >-
                Timestamp representing the date and time when the campaign
                template was last updated. The value is shown in the ISO 8601
                format.
              example: '2024-07-17T06:25:21.500Z'
    CampaignTemplateBase:
      type: object
      title: Campaign Template Base
      description: Stores details about a campaign template.
      properties:
        id:
          type: string
          description: >-
            Unique identifier of the campaign template. It is assigned by
            Voucherify.
          example: camp_tpl_eR9NsNJ5gqJRN2TG3fqCvbVl
        name:
          type: string
          description: User-defined name of the campaign template.
        description:
          type: string
          description: User-defined description of the campaign template.
        campaign_type:
          type: string
          description: >-
            Type of the campaign used to create the campaign template. Templates
            created from a promotion tier are converted to `DISCOUNT_COUPONS`.
          enum:
            - DISCOUNT_COUPONS
            - GIFT_VOUCHERS
        created_at:
          type: string
          format: date-time
          description: >-
            Timestamp representing the date and time when the campaign template
            was created. The value is shown in the ISO 8601 format.
          example: '2024-07-16T09:05:53.175Z'
        object:
          type: string
          description: The type of the object represented by JSON.
          enum:
            - campaign_template
      required:
        - id
        - name
        - campaign_type
        - created_at
        - object
  securitySchemes:
    X-App-Id:
      type: apiKey
      name: X-App-Id
      in: header
    X-App-Token:
      type: apiKey
      name: X-App-Token
      in: header
    X-Voucherify-OAuth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://api.voucherify.io/v1/oauth/token
          scopes:
            api: Gives access to whole server-side API.
            vouchers: >-
              Gives access to all endpoints and methods starting with
              `v1/vouchers`.
            client_api: Gives access to whole client-side API.
            client_vouchers: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/vouchers`.
            promotions: >-
              Gives access to all endpoints and methods starting with
              `/v1/promotions`.
            client_promotions: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/promotions`
            campaigns: >-
              Gives access to all endpoints and methods starting with
              `v1/campaigns`.
            client_publish: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/publish`.
            exports: >-
              Gives access to all endpoints and methods starting with
              `/v1/exports`.
            publications: >-
              Gives access to all endpoints and methods starting with
              `/v1/publications`.
            client_validate: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/validate`.
            validations: >-
              Gives access to all endpoints and methods starting with
              `/v1/validations`.
            client_validations: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/validations`.
            qualifications: >-
              Gives access to all endpoints and methods starting with
              `/v1/qualifications`.
            client_qualifications: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/qualifications`.
            client_redeem: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/redeem
            redemptions: >-
              Gives access to all endpoints and methods starting with
              `/v1/redemptions`.
            client_redemptions: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/redemptions`
            customers: >-
              Gives access to all endpoints and methods starting with
              `/v1/customers`.
            client_customers: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/customers`.
            orders: >-
              Gives access to all endpoints and methods starting with
              `/v1/orders`.
            products: >-
              Gives access to all endpoints and methods starting with
              `/v1/products`.
            skus: >-
              Gives access to all endpoints and methods starting with
              `/v1/SKUs`.
            validation-rules: >-
              Gives access to all endpoints and methods starting with
              `/v1/validation-rules`.
            validation-rules-assignments: >-
              Gives access to all endpoints and methods starting with
              `/v1/validation-rules-assignments
            segments: >-
              Gives access to all endpoints and methods starting with
              `/v1/segments`.
            events: >-
              Gives access to all endpoints and methods starting with
              `/v1/events`.
            client_events: >-
              Gives access to all endpoints and methods starting with
              `client/v1/events`.
            rewards: >-
              Gives access to all endpoints and methods starting with
              `/v1/rewards`.
            assets: >-
              Gives access to all endpoints and methods starting with
              `/v1/assets`.
            task-results: >-
              Gives access to all endpoints and methods starting with
              `/v1/task-results`.
            loyalties: >-
              Gives access to all endpoints and methods starting with
              `/v1/loyalties`.
            client_consents: >-
              Gives access to all endpoints and methods starting with
              `client/v1/consents`.
            consents: >-
              Gives access to all endpoints and methods starting with
              `/v1/consents`.
            async-actions: >-
              Gives access to all endpoints and methods starting with
              `/v1/async-actions`.
            product-collections: >-
              Gives access to all endpoints and methods starting with
              `/v1/product-collections`.
            categories: >-
              Gives access to all endpoints and methods starting with
              `/v1/categories`.
            metadata-schemas: >-
              Gives access to all endpoints and methods starting with
              `/v1/metadata-schemas`.
            locations: >-
              Gives access to all endpoints and methods starting with
              `/v1/locations`.
            referrals: >-
              Gives access to all endpoints and methods starting with
              `/v1/referrals`.
            trash-bin: >-
              Gives access to all endpoints and methods starting with
              `/v1/trash-bin`.
            templates: >-
              Gives access to all endpoints and methods starting with
              `/v1/templates`.

````