ZooTools is now SMASHSENDRead update

Campaigns API

The Campaigns API allows you to create and manage marketing campaigns in your SMASHSEND account. You can list campaigns, retrieve campaign details, create new campaigns, and update existing ones.

Endpoints

GET/v1/campaigns

Lists all campaigns for the authenticated workspace.

Authentication

Requires a valid API key with api_user scope.

Request

curl https://api.smashsend.com/v1/campaigns \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "campaigns": [
    {
      "id": "camp_123456789",
      "name": "Spring Promotion",
      "status": "active",
      "createdAt": "2023-03-01T10:00:00Z",
      "scheduledAt": "2023-03-15T08:00:00Z"
    },
    {
      "id": "camp_987654321",
      "name": "Summer Sale",
      "status": "draft",
      "createdAt": "2023-04-10T14:30:00Z",
      "scheduledAt": null
    }
  ]
}

GET/v1/campaigns/{campaignId}

Retrieves details of a specific campaign.

Authentication

Requires a valid API key with user scope.

Path Parameters

campaignId - The ID of the campaign to retrieve

Request

curl https://api.smashsend.com/v1/campaigns/camp_123456789 \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "campaign": {
    "id": "camp_123456789",
    "name": "Spring Promotion",
    "status": "active",
    "createdAt": "2023-03-01T10:00:00Z",
    "scheduledAt": "2023-03-15T08:00:00Z",
    "content": {
      "subject": "Spring Sale is Here!",
      "body": "Check out our latest spring promotions with discounts up to 50%!"
    },
    "analytics": {
      "sent": 1250,
      "opened": 680,
      "clicked": 312
    }
  }
}

GET/v1/campaigns/{campaignId}/public

Retrieves public details of a specific campaign. This endpoint is designed for public-facing integrations.

Authentication

Requires a valid API key with nextjs_api scope.

Path Parameters

campaignId - The ID of the campaign to retrieve

Request

curl https://api.smashsend.com/v1/campaigns/camp_123456789/public \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "campaign": {
    "id": "camp_123456789",
    "name": "Spring Promotion",
    "status": "active"
  },
  "workspace": {
    "id": "wks_987654321",
    "name": "Example Company"
  }
}

POST/v1/campaigns

Creates a new campaign.

Authentication

Requires a valid API key with api_user scope.

Request Body

{
    "name": "Summer Sale",
    "content": {
      "subject": "Summer Sale is Here!",
      "body": "Check out our latest summer promotions with discounts up to 50%!"
    }
  }

Request

curl -X POST https://api.smashsend.com/v1/campaigns \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Summer Sale",
    "content": {
      "subject": "Summer Sale is Here!",
      "body": "Check out our latest summer promotions with discounts up to 50%!"
    }
  }'

Response

{
  "campaign": {
    "id": "camp_987654321",
    "name": "Summer Sale",
    "status": "draft",
    "createdAt": "2023-04-16T15:45:00Z",
    "scheduledAt": null,
    "content": {
      "subject": "Summer Sale is Here!",
      "body": "Check out our latest summer promotions with discounts up to 50%!"
    }
  }
}

POST/v1/campaigns/{campaignId}/schedule

Schedules a campaign for delivery.

Authentication

Requires a valid API key with user scope.

Path Parameters

campaignId - The ID of the campaign to schedule

Request Body

{
  "scheduledAt": "2023-05-01T10:00:00Z"
}

Request

curl -X POST https://api.smashsend.com/v1/campaigns/camp_987654321/schedule \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "scheduledAt": "2023-05-01T10:00:00Z"
  }'

Response

{
  "campaign": {
    "id": "camp_987654321",
    "name": "Summer Sale",
    "status": "scheduled",
    "createdAt": "2023-04-16T15:45:00Z",
    "scheduledAt": "2023-05-01T10:00:00Z"
  }
}