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

# Create a campaign



## OpenAPI

````yaml /openapi.json post /campaigns
openapi: 3.1.0
info:
  title: Referralful API
  version: 1.0.0
  description: Rewardful-compatible REST API for affiliate programs built on Stripe.
servers:
  - url: https://api.referralful.com/v1
security:
  - basicAuth: []
paths:
  /campaigns:
    post:
      summary: Create a campaign
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - url
              properties:
                name:
                  type: string
                url:
                  type: string
                reward_type:
                  type: string
                  enum:
                    - percent
                    - amount
                commission_percent:
                  type: number
                commission_amount_cents:
                  type: integer
                days_before_referrals_expire:
                  type: integer
                minimum_payout_cents:
                  type: integer
                max_commission_period_in_months:
                  type: integer
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Campaign'
components:
  schemas:
    Campaign:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
          example: campaign
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        name:
          type: string
        url:
          type: string
        private:
          type: boolean
        reward_type:
          type: string
          enum:
            - percent
            - amount
        commission_percent:
          type: number
          nullable: true
        commission_amount_cents:
          type: integer
          nullable: true
        commission_currency:
          type: string
        minimum_payout_cents:
          type: integer
        days_before_referrals_expire:
          type: integer
        days_before_commissions_are_due:
          type: integer
        max_commissions:
          type: integer
          nullable: true
        max_commission_period_in_months:
          type: integer
          nullable: true
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: Use your API secret as the username, with an empty password.

````