FirstPromoter Affiliate Referral Links API

FirstPromoter Affiliate Referral Links API - 4 operation(s) on the promoter-facing (api/v2/affiliate) surface, from FirstPromoter's own published OpenAPI definition (3.0.1) indexed in https://docs.firstpromoter.com/llms.txt.

OpenAPI Specification

firstpromoter-v2-affiliate-referral-links-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: FirstPromoter API
  version: '1.0'
  description: API documentation for FirstPromoter affiliate referral links management
servers:
- url: https://api.firstpromoter.com/api/v2/affiliate
security:
- BearerAuth: []
paths:
  /referral_links:
    get:
      summary: Get current promoter referral links
      operationId: getReferralLinks
      parameters:
      - $ref: '#/components/parameters/AccountId'
      - name: promoter_campaign_id
        in: query
        description: If provided, it returns only the links related to the given campaign
        required: false
        schema:
          type: integer
      responses:
        '200':
          description: List of referral links
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ReferralLink'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      noindex: true
      summary: Creates a referral link
      operationId: createReferralLink
      parameters:
      - $ref: '#/components/parameters/AccountId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                promoter_campaign_id:
                  type: integer
                  description: Promoter campaign of the link
                sub_id:
                  type: string
                  description: Sub id
                name:
                  type: string
                  description: Name
                url:
                  type: string
                  description: Url
              required:
              - promoter_campaign_id
      responses:
        '200':
          description: Created referral link
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReferralLink'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /referral_links/{id}:
    put:
      noindex: true
      summary: Updates a referral link
      operationId: updateReferralLink
      parameters:
      - $ref: '#/components/parameters/AccountId'
      - name: id
        in: path
        description: ID of the referral link to update
        required: true
        schema:
          type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                sub_id:
                  type: string
                  description: Sub id
                name:
                  type: string
                  description: Name
      responses:
        '200':
          description: Updated referral link
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReferralLink'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      noindex: true
      summary: Destroys a referral link
      operationId: deleteReferralLink
      parameters:
      - $ref: '#/components/parameters/AccountId'
      - name: id
        in: path
        description: The id of the referral_link to be destroyed
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: Referral link deleted successfully
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
          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
        example: acc_123456
  schemas:
    ReferralLink:
      type: object
      properties:
        id:
          type: integer
          nullable: true
        name:
          type: string
        url:
          type: string
        is_default:
          type: boolean
          nullable: true
        source:
          type: string
          enum:
          - campaign
          - promoter
        sub_id:
          type: string
          nullable: true
        campaign:
          type: object
          properties:
            id:
              type: integer
            name:
              type: string
            color:
              type: string
              nullable: true
    Error:
      type: object
      properties:
        message:
          type: string
        code:
          type: string
      required:
      - message
      - code
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Access token passed as a Bearer token in the Authorization header