---
title: "Create a new web push campaign"
method: POST
path: "/push/tasks"
tags: ["Campaigns"]
---

# Create a new web push campaign

`POST /push/tasks`

## Request

- Base URL: `https://api.sendpulse.com`
- URL: `https://api.sendpulse.com/push/tasks`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (client credentials, token URL `https://api.sendpulse.com/oauth/access_token`)

## Request body

- object
  - `title` string, required
  - `website_id` integer, required
  - `body` string, required
  - `ttl` integer, required
  - `link` string
  - `filter_lang` string
  - `filter_browser` string
  - `filter_region` string: JSON string of country codes, e.g. ['UK']
  - `filter_url` string: JSON string for URL filtering
  - `filter_subscription_date_from` string
  - `filter_subscription_date_to` string
  - `filter` object: Segmentation by custom variables
  - `stretch_time` integer
  - `send_date` string, date-time
  - `buttons` string: JSON string for buttons
  - `image` string: JSON string with name and Base64 data
  - `icon` string: JSON string with name and Base64 data

## Response `200`

Campaign created

- object
  - `result` boolean
  - `id` integer

## Other responses

- `401`: Unauthorized
- `403`: Forbidden

---

[API](https://skmtc.dev/sendpulse/apis/sendpulse-web-push-api.md) · [All operations](https://skmtc.dev/sendpulse/apis/sendpulse-web-push-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sendpulse/apis/sendpulse-web-push-api/revisions/c58bb3a81231?raw)
