# Campaigns

## List campaigns

> Lists all campaigns for the authenticated user's space with optional filtering by status and folder. Supports pagination.

```json
{"openapi":"3.1.1","info":{"title":"Emailchaser API","version":"1.0"},"servers":[{"url":"https://api.emailchaser.com/r"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"models.ListCampaignsResponse":{"type":"object","properties":{"campaigns":{"type":"array","items":{"$ref":"#/components/schemas/models.CampaignListItem"}},"hasMore":{"type":"boolean"},"limit":{"type":"integer"},"page":{"type":"integer"},"total":{"type":"integer"}}},"models.CampaignListItem":{"type":"object","properties":{"createdAt":{"type":"string"},"emoji":{"type":"string"},"flow":{"type":"string"},"id":{"type":"integer"},"name":{"type":"string"},"stats":{"$ref":"#/components/schemas/models.CampaignStats"},"status":{"type":"string"},"updatedAt":{"type":"string"}}},"models.CampaignStats":{"type":"object","properties":{"bouncedLeadsCount":{"type":"integer"},"contactedLeadsCount":{"type":"integer"},"emailsSentCount":{"type":"integer"},"leadsRespondedPositivelyCount":{"type":"integer"},"repliedLeadsCount":{"type":"integer"},"senderEmailsConnected":{"type":"integer"},"senderEmailsDisconnected":{"type":"integer"},"senderEmailsTotal":{"type":"integer"}}},"models.ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorUnauthorized":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/campaigns":{"get":{"description":"Lists all campaigns for the authenticated user's space with optional filtering by status and folder. Supports pagination.","tags":["Campaigns"],"summary":"List campaigns","parameters":[{"schema":{"type":"string"},"description":"Bearer <API_KEY>","name":"Authorization","in":"header","required":true},{"schema":{"type":"integer"},"description":"Page number (default: 1)","name":"page","in":"query"},{"schema":{"type":"string","enum":["not_started","running","completed","paused","draft"]},"description":"Filter by status","name":"status","in":"query"},{"schema":{"type":"integer"},"description":"Filter by folder ID","name":"folderId","in":"query"}],"responses":{"200":{"description":"List of campaigns","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ListCampaignsResponse"}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorUnauthorized"}}}},"500":{"description":"Failed to retrieve campaigns","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}}}}}}}
```

## Get a campaign by ID

> Retrieves detailed information about a specific campaign including settings, schedule, statistics, and email counts.

```json
{"openapi":"3.1.1","info":{"title":"Emailchaser API","version":"1.0"},"servers":[{"url":"https://api.emailchaser.com/r"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"models.GetCampaignResponse":{"type":"object","properties":{"createdAt":{"type":"string"},"emails":{"$ref":"#/components/schemas/models.CampaignEmailCounts"},"emoji":{"type":"string"},"flow":{"type":"string"},"id":{"type":"integer"},"launchAt":{"type":"string"},"name":{"type":"string"},"schedule":{"$ref":"#/components/schemas/models.CampaignSchedule"},"sendAt":{"type":"string"},"settings":{"$ref":"#/components/schemas/models.CampaignSettings"},"stats":{"$ref":"#/components/schemas/models.CampaignStats"},"status":{"type":"string"},"timezone":{"type":"string"},"updatedAt":{"type":"string"}}},"models.CampaignEmailCounts":{"type":"object","properties":{"blocked":{"type":"integer"},"bounced":{"type":"integer"},"canceled":{"type":"integer"},"catchAll":{"type":"integer"},"deferred":{"type":"integer"},"delivered":{"type":"integer"},"draft":{"type":"integer"},"dropped":{"type":"integer"},"errorOnSent":{"type":"integer"},"followUp":{"type":"integer"},"followUpCanceled":{"type":"integer"},"followUpDraft":{"type":"integer"},"invalid":{"type":"integer"},"pending":{"type":"integer"},"replied":{"type":"integer"},"scheduled":{"type":"integer"},"sent":{"type":"integer"},"spamReport":{"type":"integer"},"total":{"type":"integer"},"waitingForReschedule":{"type":"integer"}}},"models.CampaignSchedule":{"type":"object","properties":{"cronSchedule":{"type":"string"},"daysSchedule":{"type":"array","items":{"type":"string"}},"endSchedule":{"type":"string"},"everySchedule":{"type":"integer"},"startSchedule":{"type":"string"}}},"models.CampaignSettings":{"type":"object","properties":{"allowNonBusinessEmails":{"type":"boolean"},"ignoreOutOfOfficeReplies":{"type":"boolean"},"isEnabledCatchallValidated":{"type":"boolean"},"isEnabledEmailVerifier":{"type":"boolean"},"isEnabledIgnoreHardBouncedLeads":{"type":"boolean"},"isEnabledIgnoreLeadsWhoAlreadyResponded":{"type":"boolean"},"isEnabledLlm":{"type":"boolean"},"isEnabledSkipLeadIfAlreadyExists":{"type":"boolean"},"isEnabledStopFollowUpsForSameCompany":{"type":"boolean"},"isEnabledStopFollowUpsOnReply":{"type":"boolean"},"maximumSendingLimitPerSenderEmail":{"type":"integer"},"maximumSendingLimitPerSenderEmailVariation":{"type":"integer"}}},"models.CampaignStats":{"type":"object","properties":{"bouncedLeadsCount":{"type":"integer"},"contactedLeadsCount":{"type":"integer"},"emailsSentCount":{"type":"integer"},"leadsRespondedPositivelyCount":{"type":"integer"},"repliedLeadsCount":{"type":"integer"},"senderEmailsConnected":{"type":"integer"},"senderEmailsDisconnected":{"type":"integer"},"senderEmailsTotal":{"type":"integer"}}},"models.ErrorInvalidCampaignID":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorUnauthorized":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorCampaignNotFound":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/campaigns/{id}":{"get":{"description":"Retrieves detailed information about a specific campaign including settings, schedule, statistics, and email counts.","tags":["Campaigns"],"summary":"Get a campaign by ID","parameters":[{"schema":{"type":"string"},"description":"Bearer <API_KEY>","name":"Authorization","in":"header","required":true},{"schema":{"type":"integer"},"description":"Campaign ID","name":"id","in":"path","required":true}],"responses":{"200":{"description":"Campaign details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.GetCampaignResponse"}}}},"400":{"description":"Invalid campaign ID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorInvalidCampaignID"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorUnauthorized"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorCampaignNotFound"}}}},"500":{"description":"Failed to retrieve campaign","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}}}}}}}
```

## Update a campaign by ID

> Updates campaign properties such as name, emoji, timezone, and various settings. Only provided fields will be updated.

```json
{"openapi":"3.1.1","info":{"title":"Emailchaser API","version":"1.0"},"servers":[{"url":"https://api.emailchaser.com/r"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"models.UpdateCampaignResponse":{"type":"object","properties":{"campaign":{"type":"object","properties":{"emoji":{"type":"string"},"id":{"type":"integer"},"name":{"type":"string"}}},"message":{"type":"string"}}},"models.ErrorInvalidCampaignID":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorUnauthorized":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorCampaignNotFound":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorFailedToUpdateCampaign":{"type":"object","properties":{"error":{"type":"string"}}},"models.UpdateCampaignRequest":{"type":"object","properties":{"allowNonBusinessEmails":{"type":"boolean"},"emoji":{"type":"string","maxLength":10,"minLength":1},"ignoreOutOfOfficeReplies":{"type":"boolean"},"isEnabledCatchallValidated":{"type":"boolean"},"isEnabledEmailVerifier":{"type":"boolean"},"isEnabledIgnoreHardBouncedLeads":{"type":"boolean"},"isEnabledIgnoreLeadsWhoAlreadyResponded":{"type":"boolean"},"isEnabledLlm":{"description":"Settings - all optional boolean flags","type":"boolean"},"isEnabledSkipLeadIfAlreadyExists":{"type":"boolean"},"isEnabledStopFollowUpsForSameCompany":{"type":"boolean"},"isEnabledStopFollowUpsOnReply":{"type":"boolean"},"maximumSendingLimitPerSenderEmail":{"type":"integer","maximum":10000,"minimum":1},"maximumSendingLimitPerSenderEmailVariation":{"type":"integer","maximum":100,"minimum":0},"name":{"type":"string","maxLength":255,"minLength":1},"timezone":{"type":"string"}}}}},"paths":{"/campaigns/{id}":{"put":{"description":"Updates campaign properties such as name, emoji, timezone, and various settings. Only provided fields will be updated.","tags":["Campaigns"],"summary":"Update a campaign by ID","parameters":[{"schema":{"type":"string"},"description":"Bearer <API_KEY>","name":"Authorization","in":"header","required":true},{"schema":{"type":"integer"},"description":"Campaign ID","name":"id","in":"path","required":true}],"responses":{"200":{"description":"Campaign updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.UpdateCampaignResponse"}}}},"400":{"description":"Invalid campaign ID or request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorInvalidCampaignID"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorUnauthorized"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorCampaignNotFound"}}}},"500":{"description":"Failed to update campaign","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorFailedToUpdateCampaign"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.UpdateCampaignRequest"}}},"description":"Campaign fields to update","required":true}}}}}
```

## Delete a campaign

> Deletes a campaign and all associated data including emails, sequences, and scheduled tasks.

```json
{"openapi":"3.1.1","info":{"title":"Emailchaser API","version":"1.0"},"servers":[{"url":"https://api.emailchaser.com/r"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"models.DeleteCampaignResponse":{"type":"object","properties":{"id":{"type":"integer"},"message":{"type":"string"}}},"models.ErrorInvalidCampaignID":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorUnauthorized":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorCampaignNotFound":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorFailedToDeleteCampaign":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/campaigns/{id}":{"delete":{"description":"Deletes a campaign and all associated data including emails, sequences, and scheduled tasks.","tags":["Campaigns"],"summary":"Delete a campaign","parameters":[{"schema":{"type":"string"},"description":"Bearer <API_KEY>","name":"Authorization","in":"header","required":true},{"schema":{"type":"integer"},"description":"Campaign ID","name":"id","in":"path","required":true}],"responses":{"200":{"description":"Campaign deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.DeleteCampaignResponse"}}}},"400":{"description":"Invalid campaign ID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorInvalidCampaignID"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorUnauthorized"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorCampaignNotFound"}}}},"500":{"description":"Failed to delete campaign","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorFailedToDeleteCampaign"}}}}}}}}}
```

## Launch or resume a campaign

> Launches a new campaign or resumes a paused campaign. Validates campaign configuration before launching.

```json
{"openapi":"3.1.1","info":{"title":"Emailchaser API","version":"1.0"},"servers":[{"url":"https://api.emailchaser.com/r"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"models.LaunchCampaignResponse":{"type":"object","properties":{"campaign":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"status":{"type":"string"}}},"message":{"type":"string"}}},"models.ErrorCampaignValidation":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorUnauthorized":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorCampaignNotFound":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorFailedToLaunchCampaign":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/campaigns/{id}/launch":{"post":{"description":"Launches a new campaign or resumes a paused campaign. Validates campaign configuration before launching.","tags":["Campaigns"],"summary":"Launch or resume a campaign","parameters":[{"schema":{"type":"string"},"description":"Bearer <API_KEY>","name":"Authorization","in":"header","required":true},{"schema":{"type":"integer"},"description":"Campaign ID","name":"id","in":"path","required":true}],"responses":{"200":{"description":"Campaign launched/resumed successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.LaunchCampaignResponse"}}}},"400":{"description":"Campaign validation failed (missing configuration)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorCampaignValidation"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorUnauthorized"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorCampaignNotFound"}}}},"409":{"description":"Campaign is currently processing leads","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}},"500":{"description":"Failed to launch/resume campaign","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorFailedToLaunchCampaign"}}}}}}}}}
```

## Pause a campaign

> Pauses a running campaign and cancels all scheduled emails.

```json
{"openapi":"3.1.1","info":{"title":"Emailchaser API","version":"1.0"},"servers":[{"url":"https://api.emailchaser.com/r"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"models.PauseCampaignResponse":{"type":"object","properties":{"campaign":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"status":{"type":"string"}}},"message":{"type":"string"}}},"models.ErrorInvalidCampaignID":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorUnauthorized":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorCampaignNotFound":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorFailedToPauseCampaign":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/campaigns/{id}/pause":{"post":{"description":"Pauses a running campaign and cancels all scheduled emails.","tags":["Campaigns"],"summary":"Pause a campaign","parameters":[{"schema":{"type":"string"},"description":"Bearer <API_KEY>","name":"Authorization","in":"header","required":true},{"schema":{"type":"integer"},"description":"Campaign ID","name":"id","in":"path","required":true}],"responses":{"200":{"description":"Campaign paused successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.PauseCampaignResponse"}}}},"400":{"description":"Invalid campaign ID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorInvalidCampaignID"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorUnauthorized"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorCampaignNotFound"}}}},"500":{"description":"Failed to pause campaign","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorFailedToPauseCampaign"}}}}}}}}}
```

## Update campaign schedule

> Updates the sending schedule for a campaign including timezone, days, time windows, and frequency.

```json
{"openapi":"3.1.1","info":{"title":"Emailchaser API","version":"1.0"},"servers":[{"url":"https://api.emailchaser.com/r"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"models.UpdateCampaignScheduleResponse":{"type":"object","properties":{"campaign":{"type":"object","properties":{"daysSchedule":{"type":"array","items":{"type":"string"}},"endSchedule":{"type":"string"},"everySchedule":{"type":"integer"},"id":{"type":"integer"},"name":{"type":"string"},"startSchedule":{"type":"string"},"timezone":{"type":"string"}}},"message":{"type":"string"}}},"models.ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorUnauthorized":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorCampaignNotFound":{"type":"object","properties":{"error":{"type":"string"}}},"models.UpdateCampaignScheduleRequest":{"type":"object","required":["timezone"],"properties":{"daysSchedule":{"description":"For multiple leads scheduled campaigns (flow 3) and API campaigns","type":"array","items":{"type":"string"}},"endSchedule":{"type":"string"},"everySchedule":{"type":"integer","minimum":1},"sendAt":{"description":"For single lead scheduled campaigns (flow 2)","type":"string"},"startSchedule":{"type":"string"},"timezone":{"description":"Common field for all flows","type":"string"}}}}},"paths":{"/campaigns/{id}/schedule":{"put":{"description":"Updates the sending schedule for a campaign including timezone, days, time windows, and frequency.","tags":["Campaigns"],"summary":"Update campaign schedule","parameters":[{"schema":{"type":"string"},"description":"Bearer <API_KEY>","name":"Authorization","in":"header","required":true},{"schema":{"type":"integer"},"description":"Campaign ID","name":"id","in":"path","required":true}],"responses":{"200":{"description":"Campaign schedule updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.UpdateCampaignScheduleResponse"}}}},"400":{"description":"Invalid request body or schedule configuration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorUnauthorized"}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorCampaignNotFound"}}}},"500":{"description":"Failed to update campaign schedule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.UpdateCampaignScheduleRequest"}}},"description":"Schedule configuration","required":true}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://run.emailchaser.com/api-reference/campaigns.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
