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

# Update promoter campaign

> With this endpoint you can update a promoter campaign. 
 <Tip>**HTTP Request** <br/>`PUT https://api.firstpromoter.com/api/v2/company/promoter_campaigns/{id}`</Tip>



## OpenAPI

````yaml openapi-v2-promoter-campaigns put /promoter_campaigns/{id}
openapi: 3.0.1
info:
  title: FirstPromoter Promoter Campaigns API
  version: '1.0'
  description: API for managing promoter campaigns
servers:
  - url: https://api.firstpromoter.com/api/v2/company
security:
  - BearerAuth: []
paths:
  /promoter_campaigns/{id}:
    put:
      tags:
        - Promoter Campaigns
      summary: Update promoter campaign
      description: |-
        With this endpoint you can update a promoter campaign. 
         <Tip>**HTTP Request** <br/>`PUT https://api.firstpromoter.com/api/v2/company/promoter_campaigns/{id}`</Tip>
      operationId: updatePromoterCampaign
      parameters:
        - $ref: '#/components/parameters/AccountId'
        - in: path
          name: id
          required: true
          schema:
            type: integer
          description: >-
            Promoter campaign ID. This ID is not the promoter’s ID or the
            campaign’s ID. It’s the linking record that defines the promoter’s
            participation in that campaign. You can find this id in each object
            in the promoter_campaigns array when you get the details of the
            promoter.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ref_token:
                  type: string
                state:
                  type: string
                  enum:
                    - pending
                    - accepted
                    - rejected
                    - blocked
                    - inactive
                coupon:
                  type: string
                display_coupon:
                  type: string
                direct_url:
                  type: string
                rewards_for_promoters:
                  type: array
                  items:
                    $ref: '#/components/schemas/RewardConfig'
                rewards_for_referrals:
                  type: array
                  items:
                    $ref: '#/components/schemas/RewardConfig'
                promoter_rewards_customized:
                  type: boolean
                referral_rewards_customized:
                  type: boolean
      responses:
        '200':
          description: Updated promoter campaign
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromoterCampaign'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    AccountId:
      name: Account-ID
      in: header
      required: true
      description: Account identifier that specifies which account is making the request
      schema:
        type: string
  schemas:
    RewardConfig:
      type: object
      required:
        - apply_on
        - product_ids
        - reward_id
      properties:
        apply_on:
          type: string
          enum:
            - monthly
            - yearly
            - one_time
            - all
            - specific
        product_ids:
          type: array
          items:
            type: integer
        reward_id:
          type: integer
    PromoterCampaign:
      type: object
      properties:
        id:
          type: integer
        campaign_id:
          type: integer
        promoter_id:
          type: integer
        created_at:
          type: string
          format: date-time
        promoter:
          $ref: '#/components/schemas/Promoter'
        campaign:
          $ref: '#/components/schemas/Campaign'
        state:
          type: string
          enum:
            - pending
            - accepted
            - rejected
            - blocked
            - inactive
        stats:
          type: object
          properties:
            clicks_count:
              type: integer
            referrals_count:
              type: integer
            sales_count:
              type: integer
            customers_count:
              type: integer
            revenue_amount:
              type: number
        coupon:
          type: string
        display_coupon:
          type: string
        ref_token:
          type: string
        ref_link:
          type: string
        is_customized:
          type: boolean
        direct_url:
          type: string
        referral_rewards_customized:
          type: boolean
        promoter_rewards_customized:
          type: boolean
        rewards_for_promoters:
          type: array
          items:
            $ref: '#/components/schemas/Reward'
        rewards_for_referrals:
          type: array
          items:
            $ref: '#/components/schemas/Reward'
        promo_codes:
          type: array
          items:
            type: string
    Error:
      type: object
      properties:
        message:
          type: string
        code:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
      required:
        - message
        - code
    Promoter:
      type: object
      properties:
        id:
          type: integer
        email:
          type: string
        name:
          type: string
    Campaign:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        color:
          type: string
    Reward:
      type: object
      properties:
        apply_on:
          type: string
        product_ids:
          type: array
          items:
            type: integer
        reward_id:
          type: integer
        reward:
          type: object
          properties:
            name:
              type: string
            promoter_reward_type:
              type: string
            hide_reward:
              type: boolean
            tier_level:
              type: integer
            coupon:
              type: string
        products:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
              name:
                type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key passed as a Bearer token in the Authorization header. You can
        find your API Key on Your FirstPromoter Dashboard. Navigate to Settings
        → Integrations section → Manage API Keys

````