openapi: 3.2.0 info: title: FirstPromoter Referral Links API version: '1.0' description: API documentation for FirstPromoter affiliate referral links management servers: - url: https://api.firstpromoter.com/api/v2/affiliate security: - BearerAuth: [] tags: - name: Referral Links 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' tags: - Referral Links 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' tags: - Referral Links /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' tags: - Referral Links 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' tags: - Referral Links 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 - 'null' name: type: string url: type: string is_default: type: - boolean - 'null' source: type: string enum: - campaign - promoter sub_id: type: - string - 'null' campaign: type: object properties: id: type: integer name: type: string color: type: - string - 'null' 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