# Campaigns

Manage campaigns and add contacts to campaigns

## List Campaigns

> Get all campaigns for the organization. Optionally filter by status.

````json
{"openapi":"3.0.3","info":{"title":"Agentalk External API","version":"1.0.0"},"tags":[{"name":"Campaigns","description":"Manage campaigns and add contacts to campaigns"}],"servers":[{"url":"https://api.agentalk.io","description":"Agentalk API"}],"security":[{"OrganizationApiToken":[]}],"components":{"securitySchemes":{"OrganizationApiToken":{"type":"http","scheme":"bearer","bearerFormat":"OrgId.SecretToken","description":"**Organization API Token.**\n\nPaste **only** your token in the field below — the `Bearer ` prefix is added automatically by the docs UI and in every generated code sample. The final header sent is:\n\n```\nAuthorization: Bearer {orgId}.{secretToken}\n```\n\nToken format: `{orgId}.{secretToken}` — example: `15c94c3c-1873-4a09-bfbb-03357c29ea50.abc123xyz`.\n\nJWT tokens are NOT accepted."}},"parameters":{"XOrganizationId":{"name":"X-Organization-ID","in":"header","required":false,"description":"Optional organization scope. Superusers without it see all; regular users default to their current organization.","schema":{"type":"string","format":"uuid"}}}},"paths":{"/api/campaigns":{"get":{"operationId":"campaigns_retrieve","description":"Get all campaigns for the organization. Optionally filter by status.","summary":"List Campaigns","parameters":[{"in":"query","name":"limit","schema":{"type":"integer"},"description":"Number of results to return (default: 50)"},{"in":"query","name":"offset","schema":{"type":"integer"},"description":"Offset for pagination (default: 0)"},{"in":"query","name":"status","schema":{"type":"string"},"description":"Filter by status (active, paused, stopped, completed, draft)"},{"$ref":"#/components/parameters/XOrganizationId"}],"tags":["Campaigns"],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}},"description":"List of campaigns"}}}}}}
````

## Add Contacts to Campaign

> Add one or more contacts to a campaign. Returns summary of added, reset (already in campaign, status reset), and invalid contacts.

````json
{"openapi":"3.0.3","info":{"title":"Agentalk External API","version":"1.0.0"},"tags":[{"name":"Campaigns","description":"Manage campaigns and add contacts to campaigns"}],"servers":[{"url":"https://api.agentalk.io","description":"Agentalk API"}],"security":[{"OrganizationApiToken":[]}],"components":{"securitySchemes":{"OrganizationApiToken":{"type":"http","scheme":"bearer","bearerFormat":"OrgId.SecretToken","description":"**Organization API Token.**\n\nPaste **only** your token in the field below — the `Bearer ` prefix is added automatically by the docs UI and in every generated code sample. The final header sent is:\n\n```\nAuthorization: Bearer {orgId}.{secretToken}\n```\n\nToken format: `{orgId}.{secretToken}` — example: `15c94c3c-1873-4a09-bfbb-03357c29ea50.abc123xyz`.\n\nJWT tokens are NOT accepted."}},"parameters":{"XOrganizationId":{"name":"X-Organization-ID","in":"header","required":false,"description":"Optional organization scope. Superusers without it see all; regular users default to their current organization.","schema":{"type":"string","format":"uuid"}}}},"paths":{"/api/campaigns/{campaign_id}/contacts":{"post":{"operationId":"campaigns_contacts_create","description":"Add one or more contacts to a campaign. Returns summary of added, reset (already in campaign, status reset), and invalid contacts.","summary":"Add Contacts to Campaign","parameters":[{"in":"path","name":"campaign_id","schema":{"type":"string","format":"uuid"},"description":"Campaign ID","required":true},{"$ref":"#/components/parameters/XOrganizationId"}],"tags":["Campaigns"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"contactIds":{"type":"array","items":{"type":"string"},"description":"Array of contact IDs to add"}},"required":["contactIds"]}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}},"description":"Summary of operation"}}}}}}
````

## Start Campaign

> Start (activate) a campaign. Optionally schedule it for a future time.

````json
{"openapi":"3.0.3","info":{"title":"Agentalk External API","version":"1.0.0"},"tags":[{"name":"Campaigns","description":"Manage campaigns and add contacts to campaigns"}],"servers":[{"url":"https://api.agentalk.io","description":"Agentalk API"}],"security":[{"OrganizationApiToken":[]}],"components":{"securitySchemes":{"OrganizationApiToken":{"type":"http","scheme":"bearer","bearerFormat":"OrgId.SecretToken","description":"**Organization API Token.**\n\nPaste **only** your token in the field below — the `Bearer ` prefix is added automatically by the docs UI and in every generated code sample. The final header sent is:\n\n```\nAuthorization: Bearer {orgId}.{secretToken}\n```\n\nToken format: `{orgId}.{secretToken}` — example: `15c94c3c-1873-4a09-bfbb-03357c29ea50.abc123xyz`.\n\nJWT tokens are NOT accepted."}},"parameters":{"XOrganizationId":{"name":"X-Organization-ID","in":"header","required":false,"description":"Optional organization scope. Superusers without it see all; regular users default to their current organization.","schema":{"type":"string","format":"uuid"}}}},"paths":{"/api/campaigns/{campaign_id}/start":{"post":{"operationId":"campaigns_start_create","description":"Start (activate) a campaign. Optionally schedule it for a future time.","summary":"Start Campaign","parameters":[{"in":"path","name":"campaign_id","schema":{"type":"string","format":"uuid"},"description":"Campaign ID","required":true},{"$ref":"#/components/parameters/XOrganizationId"}],"tags":["Campaigns"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"startAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp to schedule start (optional)"}}}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}},"description":"Campaign started successfully"}}}}}}
````


---

# 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://docs.agentalk.io/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.
