> For the complete documentation index, see [llms.txt](https://push-help.sare.pl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://push-help.sare.pl/api/create-campaign-to-particular-tags.md).

# Creating campaign to particular tags

To create campaign to subscribers with particular tags, submit a **POST** request to:

```
https://push-api.sare.pl/v1/campaigns/<YOUR_WEBSITE_UID>/tags
```

| Body parameters | Description                          |
| --------------- | ------------------------------------ |
| **tags**        | **Array of tag(s) (required)**       |
| **title**       | **Title of message (required)**      |
| **body**        | **Body of message (required)**       |
| **link**        | **Link of message (required)**       |
| **ttl**         | **Notification lifetime (required)** |
| icon            | Url to icon (optional)               |
| image           | Url to image (optional)              |

#### PHP example

```php
$url = "https://push-api.sare.pl/v1/campaigns/<YOUR_WEBSITE_UID>/tags";
$payload = [
    "tags" => [
        "name", 
        "firstName", 
        "otherTag"
    ],
    "title" => "Title of message",
    "body" => "Body of message",
    "link" => "https://sendflow.pl",
    "ttl" => 604800,
    "icon" => "https://your-cdn.pl/icon.png",
    "image" => "https://your-cdn.pl/image.png"
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Basic <YOUR_API_KEY>',
    'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
$result = curl_exec($ch);
```

#### Bash example

```bash
curl --include \
     --request POST \
     --header "Content-Type: application/json; charset=utf-8" \
     --header "Authorization: Basic <YOUR_API_KEY>" \
     --data-binary "{\"tags\":[\"name\",\"firstName\",\"otherTag\"],\"title\":\"Title of message\",\"body\":\"Body of message\",\"link\":\"https:\\/\\/sendflow.pl\",\"ttl\":604800}" \
     https://push-api.sare.pl/v1/campaigns/<YOUR_WEBSITE_UID>/tags
```

#### Response example

```javascript
{
  "result": true
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://push-help.sare.pl/api/create-campaign-to-particular-tags.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.
