> For the complete documentation index, see [llms.txt](https://help.smartico.ai/welcome/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.smartico.ai/welcome/products/crm-automation/activities-of-flows/activity-webhook.md).

# Activity: WebHook

Smartico platform can make HTTP-API callbacks to your platform initiated by any activity in the system.

For example, you can notify your system using an HTTP POST call every time the user gets a Mini-game spin attempt, upgraded in levels, purchased in the store, started, or converted in a specific campaign. Any event happening in the context of the user can be used as a trigger for the API call.

There are 3 main places where you can initiate the API call:

* as part of the campaign journey, you can use a special block called "WebHook"
* as part of the automation rule, you can select the activity "WebHook"
* as part of a mission, you can select the activity "WebHook" as a mission activity or as a task reward

All of them work the same way, but giving you the possibility either to build a simple "if-this-do-api-call" scenario using Automation rules, or trigger API calls as part of the complex marketing flow activity.

{% hint style="warning" %}
Try to use automation rule whenever possible in order to get the best performance and reaction on the event.
{% endhint %}

<div data-with-frame="true"><figure><img src="https://77049817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfS5hl0PiysHtKAKMsQTe%2Fuploads%2FDHeJJF6ngmX4DB7CBPlu%2Fr2-006-shot-1-6ed6ff3f-2cf27c.png?alt=media" alt=""><figcaption><p>A WebHook activity in an automation rule: 1 — WebHook URL; 2 — Method; 3 — Content Type; 4 — Body; 5 — Additional HTTP headers</p></figcaption></figure></div>

As part of the WebHook setup you need to set:

* HTTP URL of your API endpoint
* Method — GET (default), POST, or PUT. POST is recommended for sending JSON payloads.
* Content type — application/json, x-www-form-urlencoded, or No data (empty), depending on your API endpoint requirements.
* Body (for POST and PUT methods) — where you construct the request payload using dynamic tags such as player profile attributes (e.g. {{state.user\_ext\_id}}) or event properties (e.g. {{event.amount}}).
* Additional HTTP headers — optional custom headers formatted as a valid JSON object (for example, `{"Authorization": "Bearer token123"}`). You can also use dynamic tags within header values.

Example of the POST body structured as JSON for the trigger "Mini-game spin issued"

```json
{
	"saw_template_id": "{{event.saw_template_id}}",
	"minigame_spins_count": "{{event.minigame_spins_count}}",
	"smartico_user_id": "{{state.user_id}}",
	"user_ext_id": "{{state.user_ext_id}}",
	"user_ext_id_clean": "{{state.user_ext_id_clean}}",
	"brand": "{{state.core_sm_brand_id}}"
}
```

{% hint style="info" %}
Even though some of the properties in the given example are "numerics", like {{event.minigame\_spins\_count}}, we still suggest passing them as strings in order to keep a valid JSON.

It's highly not recommended to pass string-based properties that potentially could have quotes or special symbols inside, e.g. if your level name is called "My level with " inside",

the middle quote will break the structure of JSON and you will wrongly format POST.
{% endhint %}

For testing purposes, you can use the Smartico Echo service, where you can do test API calls and see how the results are passed via API.

You can send GET or POST requests to the URL like <https://img.smr.vc/echo-send/some-secret-123/>

And you can see the last 100 POST requests using the URL like <https://img.smr.vc/echo-list/some-secret-123/>

For the case of "Mini games attempts" you can see real-life examples of API calls on this echo bucket - <https://img.smr.vc/echo-list/smartico-secret-x423g4/>

### Outgoing connections

In a campaign journey, the Web Hook step can have these outgoing connections:

<div data-with-frame="true"><figure><img src="https://77049817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfS5hl0PiysHtKAKMsQTe%2Fuploads%2FUpOIPaRN44Pd43C9GRaK%2Fa894041688-webhook-825d5d61-270e34.png?alt=media" alt="Outgoing connections"><figcaption><p>Outgoing connections of Web Hook in a flow. The numbers match the table below.</p></figcaption></figure></div>

| # | Connection                                                | When the player goes this way                                                                                                                                                 |
| - | --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1 | **Then**                                                  | Right away, when Smartico starts the step. It does not wait for the result, so it also runs when the step fails later.                                                        |
| 2 | **Executed**                                              | Your endpoint answered with a success code (200–299).                                                                                                                         |
| 3 | **Failed**                                                | The request failed: an error code, a network error or a timeout. **Failed** does not close the step, so **Failed with code...** can fire for the same failure too.            |
| 4 | **Failed with code... (shown as Failed with code "404")** | The request failed and its failure text contains the value you entered, for example an HTTP code such as 400, 404 or 500. Use it for your own error handling or a retry path. |

## Monitoring & Delivery Logs

You can track and troubleshoot webhook deliveries in the Back-Office:

* **CRM > Webhooks log**: View the global log of all outbound webhook requests, filterable by date range, user ID/username, originating product or campaign, and HTTP status (Success or Failed).
* **Campaign / Automation Rule Webhooks Tab**: View execution history specific to a given campaign or automation rule under its dedicated operations tab.
* **HTTP Details**: Click any entry to expand it. It shows the **Request** (URL, method, headers and body) and the **Response**. The HTTP status code is in the **Response code** column.

### Frequently Asked Questions

**Q: Does Smartico automatically retry failed webhook requests?**

A: Outbound webhooks are sent once per triggering event. Smartico does not automatically retry failed HTTP requests in Automation Rules. In Campaign Journeys, you can handle failures by connecting the **Failed** output branch to a **Delay** activity and routing back to the WebHook activity to build a custom retry flow.

**Q: How do I pass authentication tokens (e.g. Bearer or Basic Auth)?**

A: Enter your authentication headers in the **Additional HTTP headers** field as a JSON object, such as `{"Authorization": "Bearer token123"}`. Ensure the value is valid JSON.

**Q: Can I use dynamic player attributes or event properties in the request body and headers?**

A: Yes. Use `{{state.property_name}}` for player profile attributes (e.g. `{{state.user_ext_id}}`, `{{state.user_ext_id_clean}}`) and `{{event.property_name}}` for properties of the triggering event (e.g. `{{event.amount}}`). In the **Body** editor, type `"{{` (a quote, then two braces) to open the tag suggestions; the tag is added inside quotes. In **Additional HTTP headers**, type `{{`.

**Q: What is the request timeout for outgoing webhooks?**

A: Smartico waits for a reply for the time set in the **Webhook request timeout, seconds** label setting (default: 10 seconds; ask your Success manager to change it). A GET request waits at most 6 seconds. If there is no reply in time, the call fails. Ensure your destination endpoint responds promptly.

**Q: Is the WebHook activity used to receive data from external systems?**

A: No. The WebHook activity is strictly for outbound HTTP API calls sent from Smartico to your platform. To push data into Smartico, use the Smartico REST API or Data Warehouse integration.

**Q: Can I send the player's real email address and phone number in a webhook?**

A: Yes, when the **Allow {{state.user\_email}} and {{state.user\_phone}} in the WebHooks** setting in **Label settings** is on; ask your Success manager to change it. Then the `{{state.user_email}}` and `{{state.user_phone}}` tags in the URL, headers and body are replaced with the real email address and phone number. While the setting is off, these tags give encrypted values.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.smartico.ai/welcome/products/crm-automation/activities-of-flows/activity-webhook.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
