Getting StartedAPI Reference
Getting StartedAPI Reference
Help Center
Login
  1. Campaigns
  • Campaigns
    • Get All Campaigns
      GET
    • Get Campaign By ID
      GET
    • Create campaign
      POST
    • Update campaign
      PUT
    • Delete campaign
      DELETE
  • Affiliates
    • List affiliates
      GET
    • Get Affiliate By ID
      GET
    • Create Affiliate
      POST
    • Update Affiliate
      PUT
    • Delete Affiliate
      DELETE
  • Affiliate Links
    • Get Affiliate Link By Affiliate ID
      GET
    • Create Affiliate Link
      POST
    • Delete Affiliate Link
      DELETE
  • Comissions
    • Get All Commissions
      GET
    • Get Commission By ID
      GET
    • Create Commision
      POST
    • Update Commision
      PUT
    • Delete Commision
      DELETE
  • Referred Users
    • Get All Referred Users
      GET
    • Get Referred User by Email
      GET
    • Create Referred User
      POST
    • Update Referred User
      PUT
    • Delete Referred User
      DELETE
Getting StartedAPI Reference
Getting StartedAPI Reference
Help Center
Login
  1. Campaigns

Create campaign

POST
/campaigns
Last modified:2025-12-29 10:13:24
Creates a new affiliate marketing campaign with customizable commission structures, approval workflows, and affiliate portal settings.
This endpoint allows you to set up comprehensive campaign parameters including commission rates, payout terms, and affiliate experience customization.

Request

Header Params

Body Params application/json

Example
{
  "campaignName": "Summer 2025 Promotion",
  "workspaceId": "5bb8cbe6-67dc-4b07-853e-7ca5454f8512",
  "commissionType": "percentage",
  "amount": 15.5,
  "minimumPayoutAmount": 50.00,
  "url": "https://example.com",
  "requiresApprovalToJoin": false,
  "collectAdditionalInfo": true,
  "hideCustomerEmail": true,
  "payoutTerm": 30,
  "affiliatePortalWelcomeMessage": "Welcome to our affiliate program!",
  "affiliateDashboardText": "Track your referrals and earnings here.",
  "stripeCouponId": "",
  "allowedUrlParameters": [
    "ref",
    "via",
    "aff"
  ],
  "isDefault": false
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/campaigns' \
--header 'x-auth-referralstack: rs_live_e6761c15744c9be53be18802278fd3da751d03ce' \
--header 'Content-Type: application/json' \
--data-raw '{
  "campaignName": "Summer 2025 Promotion",
  "workspaceId": "5bb8cbe6-67dc-4b07-853e-7ca5454f8512",
  "commissionType": "percentage",
  "amount": 15.5,
  "minimumPayoutAmount": 50.00,
  "url": "https://example.com",
  "requiresApprovalToJoin": false,
  "collectAdditionalInfo": true,
  "hideCustomerEmail": true,
  "payoutTerm": 30,
  "affiliatePortalWelcomeMessage": "Welcome to our affiliate program!",
  "affiliateDashboardText": "Track your referrals and earnings here.",
  "stripeCouponId": "",
  "allowedUrlParameters": [
    "ref",
    "via",
    "aff"
  ],
  "isDefault": false
}'

Responses

🟢201Success
application/json
Body

Example
{
    "status": 201,
    "message": "Campaign created successfully",
    "data": {
        "id": "3979878d-3ee6-49e1-8104-5ade64277dca",
        "campaignName": "Summer 2025 Promotion",
        "commissionType": "percentage",
        "amount": 15.5,
        "minimumPayoutAmount": 50,
        "payoutId": "51b0230d-dc47-4f86-9a83-8cb1a4c3c66d",
        "workspaceId": "5bb8cbe6-67dc-4b07-853e-7ca5454f8512",
        "requiresApprovalToJoin": false,
        "collectAdditionalInfo": true,
        "hideCustomerEmail": true,
        "payoutTerm": 30,
        "url": "https://example.com",
        "affiliatePortalWelcomeMessage": "Welcome to our affiliate program!",
        "affiliateDashboardText": "Track your referrals and earnings here.",
        "stripeCouponId": "",
        "allowedUrlParameters": [
            "ref",
            "via",
            "aff"
        ],
        "isDefault": false,
        "createdAt": "2025-12-29T04:40:04.929Z",
        "updatedAt": "2025-12-29T04:40:04.929Z"
    }
}
🟠401Unauthorized (Missing API Key)
🟠403Forbidden (Wrong WorkspaceId)
Modified at 2025-12-29 10:13:24
Previous
Get Campaign By ID
Next
Update campaign
Built with