LeadSail
Campaigns

List campaigns

Returns all campaigns for the authenticated tenant. Supports pagination and filtering.

GET
/api/v1/campaigns

Authorization

ApiKeyAuth
X-API-Key<token>

API key generated from your Vayaflow dashboard Settings page

In: header

Query Parameters

page?string

Page number

limit?string

Items per page

active?string

Filter by active status

Value in"true" | "false"
clientId?string

Filter by client ID

offerId?string

Filter by offer ID

includeArchived?string

Include archived campaigns

Value in"true" | "false"
search?string

Search by name, campaignId, clientName, or offerName

Response Body

application/json

application/json

package mainimport (  "fmt"  "net/http"  "io/ioutil")func main() {  url := "https://api.leadsail.app/api/v1/campaigns"  req, _ := http.NewRequest("GET", url, nil)    res, _ := http.DefaultClient.Do(req)  defer res.Body.Close()  body, _ := ioutil.ReadAll(res.Body)  fmt.Println(res)  fmt.Println(string(body))}
{
  "success": true,
  "data": {
    "campaigns": [
      {
        "campaignId": "string",
        "name": "string",
        "active": true,
        "clientId": "string",
        "clientName": "string",
        "clientAbbrev": "string",
        "offerId": "string",
        "offerName": "string",
        "offerAbbrev": "string",
        "managerId": "string",
        "webhooks": {
          "url": "string",
          "events": {
            "property1": true,
            "property2": true
          },
          "headers": {
            "property1": "string",
            "property2": "string"
          },
          "retryAttempts": 0,
          "timeoutSeconds": 0,
          "enabled": true,
          "inheritFromTenant": true
        },
        "documents": [
          {
            "documentId": "string",
            "documentTemplateId": "string",
            "type": "string",
            "name": "string",
            "provider": "docuseal",
            "templateId": "string",
            "conditions": {
              "logicalOperator": "AND",
              "subRules": [
                {
                  "logicalOperator": "AND",
                  "conditions": [
                    {
                      "field": "string",
                      "operator": "equals",
                      "value": [
                        null
                      ],
                      "valueSetId": "string"
                    }
                  ]
                }
              ],
              "isActive": true,
              "name": "string"
            },
            "fieldMappingOverrides": [
              {
                "id": "string",
                "providerFieldName": "string",
                "providerFieldId": "string",
                "providerFieldLabel": "string",
                "providerFieldRequired": true,
                "providerFieldType": "string",
                "autoFill": true,
                "fallbackTemplate": "string",
                "sourceType": "field_library",
                "sourceValue": "string",
                "sourceLabel": "string"
              }
            ],
            "metadataOverrides": {
              "property1": "string",
              "property2": "string"
            },
            "isActive": true,
            "required": true,
            "autoSend": true,
            "expiresInDays": 0,
            "order": 0
          }
        ],
        "firstSubmissionAction": {
          "enabled": true,
          "action": "voice_ai",
          "webhook": {
            "url": "http://example.com",
            "method": "POST",
            "headers": {
              "property1": "string",
              "property2": "string"
            },
            "retries": 3,
            "timeoutSeconds": 30
          },
          "humanReview": {
            "reason": "string",
            "priority": "high"
          },
          "workflow": {
            "workflowDefinitionId": "string"
          }
        },
        "disqualificationConditionals": [
          {
            "logicalOperator": "AND",
            "subRules": [
              {
                "logicalOperator": "AND",
                "conditions": [
                  {
                    "field": "string",
                    "operator": "equals",
                    "value": [
                      null
                    ],
                    "valueSetId": "string"
                  }
                ]
              }
            ],
            "isActive": true,
            "name": "string"
          }
        ],
        "routingRules": [
          {
            "routeName": "string",
            "active": true,
            "priority": 0,
            "logicalOperator": "AND",
            "subRules": [
              {
                "logicalOperator": "AND",
                "conditions": [
                  {
                    "field": "string",
                    "operator": "equals",
                    "value": [
                      null
                    ],
                    "valueSetId": "string"
                  }
                ]
              }
            ],
            "routeTo": {
              "campaignId": "string",
              "clientName": "string",
              "offerName": "string"
            }
          }
        ],
        "fallbackCampaigns": [
          "string"
        ],
        "deliveryLimits": [
          {
            "active": true,
            "cap": 0,
            "type": "daily",
            "action": "queue",
            "startDate": "string",
            "endDate": "string",
            "routeToCampaignId": "string"
          }
        ],
        "deliverySchedule": {
          "timezone": "string",
          "action": "queue",
          "specificDays": [
            {
              "active": true,
              "day": "Monday",
              "startTime": "string",
              "endTime": "string"
            }
          ],
          "routeToCampaignId": "string"
        },
        "revenueMilestones": [
          {
            "leadStatus": "delivered",
            "amount": 0,
            "currency": "USD",
            "validFrom": "string",
            "validTo": "string",
            "conditions": {
              "logicalOperator": "AND",
              "subRules": [
                {
                  "logicalOperator": "AND",
                  "conditions": [
                    {
                      "field": "string",
                      "operator": "equals",
                      "value": [
                        null
                      ],
                      "valueSetId": "string"
                    }
                  ]
                }
              ],
              "isActive": true,
              "name": "string"
            },
            "notes": "string",
            "active": true
          }
        ],
        "campaignAiAgents": {
          "voice": {
            "agentId": "string",
            "promptTemplateId": "string",
            "agentVariablesConfigId": "string"
          },
          "voiceTest": {
            "agentId": "string",
            "promptTemplateId": "string",
            "agentVariablesConfigId": "string"
          },
          "sms": {
            "agentId": "string",
            "promptTemplateId": "string",
            "agentVariablesConfigId": "string"
          },
          "smsTest": {
            "agentId": "string",
            "promptTemplateId": "string",
            "agentVariablesConfigId": "string"
          }
        },
        "phoneNumberId": "string",
        "questionnaireId": "string",
        "deliveryEndpointId": "string",
        "autoDialerConfigId": "string",
        "postCallPipelineId": "string",
        "pixelRules": [
          {
            "id": "string",
            "name": "string",
            "active": true,
            "triggerPoint": "lead_qualified",
            "pixelId": "string",
            "platform": "facebook",
            "eventName": "string",
            "actionSource": "website",
            "conditions": {
              "logicalOperator": "AND",
              "subRules": [
                {
                  "logicalOperator": "AND",
                  "conditions": [
                    {
                      "field": "string",
                      "operator": "equals",
                      "value": [
                        null
                      ],
                      "valueSetId": "string"
                    }
                  ]
                }
              ],
              "isActive": true,
              "name": "string"
            },
            "eventValueOverride": 0,
            "currency": "string",
            "fireOnce": true
          }
        ],
        "settings": {
          "aiQualificationEnabled": true,
          "autoRoutingEnabled": true,
          "dedupeEnabled": true,
          "dedupeWindow": 0,
          "dedupeFields": [
            "string"
          ],
          "integrationOverrides": {
            "voice": "elevenlabs",
            "sms": "vonage",
            "llm": "openai"
          }
        },
        "notes": "string",
        "tags": [
          "string"
        ],
        "externalId": "string",
        "createdAt": "string",
        "updatedAt": "string",
        "archivedAt": "string",
        "lastLeadReceivedAt": "string"
      }
    ],
    "pagination": {
      "total": 0,
      "page": 0,
      "limit": 0
    }
  }
}
{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Authentication required"
  }
}