get:
  operationId: getActiveCampaigns
  tags:
    - Certification Campaigns
  summary: List Campaigns
  description: >-
    Gets campaigns and returns them in a list. Can provide increased level of detail for each campaign if provided
    the correct query.
  security:
    - oauth2: [idn:campaign-list:read]
  parameters:
    - in: query
      name: detail
      schema:
        type: string
        enum: [SLIM, FULL]
      required: false
      description: >-
        Determines whether slim, or increased level of detail is provided for each campaign in the returned list.
        Slim is the default behavior.
      example: FULL
    - $ref: '../parameters/limit.yaml'
    - $ref: '../parameters/offset.yaml'
    - $ref: '../parameters/count.yaml'
    - in: query
      name: filters
      schema:
        type: string
      required: false
      description: >-
        Filter results using the standard syntax described in [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters#filtering-results)


        Filtering is supported for the following fields and operators:


        **id**: *eq, in*


        **name**: *eq, sw*


        **status**: *eq, in*
      example: name eq "Manager Campaign"
    - in: query
      name: sorters
      schema:
        type: string
        format: comma-separated
      required: false
      description: >-
        Sort results using the standard syntax described in [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters#sorting-results)


        Sorting is supported for the following fields: **name**, **created**
      example: name
  responses:
    '200':
      description: A list of campaign objects.
      content:
        application/json:
          schema:
            type: array
            items:
              oneOf:
                - $ref: '../schemas/SlimCampaign.yaml'
                - $ref: '../schemas/Campaign.yaml'

          examples:
            Slim Campaign:
              $ref: '../schemas/campaign/examples/SlimCampaigns.yaml'
            Full Campaign:
              $ref: '../schemas/campaign/examples/FullCampaigns.yaml'
    '400':
      $ref: '../responses/400.yaml'
    '401':
      $ref: '../responses/401.yaml'
    '403':
      $ref: '../responses/403.yaml'
    '429':
      $ref: '../responses/429.yaml'
    '500':
      $ref: '../responses/500.yaml'
post:
  operationId: createCampaign
  tags:
    - Certification Campaigns
  summary: Create a campaign
  description: Creates a new Certification Campaign with the information provided in the request body.
  security:
    - oauth2: [idn:campaign:create]
  requestBody:
    required: true
    content:
      application/json:
        schema:
          $ref: '../schemas/Campaign.yaml'
        examples:
          Manager:
            $ref: '../schemas/campaign/examples/CreateCampaignManager.yaml'
          Search:
            $ref: '../schemas/campaign/examples/CreateCampaignSearch.yaml'
          Source Owner:
            $ref: '../schemas/campaign/examples/CreateCampaignSourceOwner.yaml'
          Role Composition:
            $ref: '../schemas/campaign/examples/CreateCampaignRoleComposition.yaml'
  responses:
    '200':
      description: Indicates that the campaign requested was successfully created and returns its representation.
      content:
        application/json:
          schema:
            $ref: '../schemas/Campaign.yaml'
          examples:
            Manager:
              $ref: '../schemas/campaign/examples/FullCampaignManager.yaml'
            Search:
              $ref: '../schemas/campaign/examples/FullCampaignSearch.yaml'
            Source Owner:
              $ref: '../schemas/campaign/examples/FullCampaignSourceOwner.yaml'
            Role Composition:
              $ref: '../schemas/campaign/examples/FullCampaignRoleComposition.yaml'
    '400':
      $ref: '../responses/400.yaml'
    '401':
      $ref: '../responses/401.yaml'
    '403':
      $ref: '../responses/403.yaml'
    '429':
      $ref: '../responses/429.yaml'
    '500':
      $ref: '../responses/500.yaml'
