# Creating a Mechanic webhook

Webhooks are the nearly ubiquitous carriers of information to and from services across the internet - services like IFTTT, Zapier, Stripe, PayPal, JotForm, and countless more. You can use webhooks to send information from these services into Mechanic, where you can then perform any [logic](/core/tasks/code.md) and [actions](/core/actions.md) you need.

{% hint style="info" %}
This is a tutorial for getting started quickly. To learn more about webhooks themselves, see [Mechanic webhooks](/platform/webhooks.md).
{% endhint %}

When Mechanic receives data via a webhook, it fires off an event with the user topic of your choice. (For example, if you've set up an IFTTT webhook that sends you tweets, you might choose the Mechanic topic `user/ifttt/tweet`.) To make use of these events, create one or more tasks that subscribe to this topic. That's it!

Let's review a detailed example.

### 1. Create a Mechanic webhook.

Start by opening Mechanic from the **Apps** section of Shopify. Once in Mechanic, open **Settings**, then choose **Mechanic webhooks** from the sidebar.

<figure><img src="/files/YXG0A1KurEoydLKYJ1i2" alt="The Mechanic webhooks section in Settings, where a new webhook can be created"><figcaption></figcaption></figure>

Webhooks should be named after the service that will be sending you data, with an event topic that makes sense, using the format `user/subject/verb`.

For this example, we'll simply call ours "Example", with an event topic of "user/webhook/test".

Click the submit button to save the webhook, and use the copy button to copy the resulting webhook URL.

The URL will look something like this:

```
https://webhooks.mechanic.dev/00000000-0000-0000-0000-000000000000
```

{% hint style="info" %}
Older webhook URLs resemble `https://usemechanic.com/webhook/00...00`. This URL structure still works, but we recommend migrating to `https://webhooks.mechanic.dev/00...00` instead, for enhanced reliability.
{% endhint %}

### 2. Create a task that subscribes to your webhook event.

Back on the Mechanic homepage, click the "Add task" link.

![](/files/b3kJ8MCLCPa3Kvmgyyle)

Then, click the "Start a blank task" button.

![](/files/k7L2RpF53Fs0fH50h052)

Keeping things simple for this example, we'll title the task "Webhook test", with a subscription to "user/webhook/test" (to match the webhook configuration), and a simple [Echo action](/core/actions/echo.md) in the task code.

![](/files/uWbBa6j2V3Ko2sHIB85W)

Lastly, save the task.

### 3. Test your webhook.

Open <https://reqbin.com/>, and construct a request to our webhook. Here, we'll select "POST", paste in the webhook URL, and fill in a simple piece of content. (Webhooks support plain text, form-encoded content, *and* JSON; for this example, we'll use JSON.)

![](/files/lAaqLoPIIwDkUmhtlvbA)

Click the "Send" button, and you'll see a 204 response returned within ReqBin.

Over in Mechanic, watch for the new event on the "Events" page (or in the "Recent events" section of the Mechanic homepage):

![](/files/zecxwutOfoV5e3Wv9dvF)

Click on that event to see the results of our task and its echo action.

![](/files/XDV0egj6zcz2WQjrgy3K)

### 4. Connect your webhook URL to another service.

This last part is up to you! Provide the webhook URL, generated by Mechanic, to whatever service you'd like to use. When provided with this URL, the service will start sending your data over to Mechanic for processing.

That's it! :) Adjust to taste.


---

# 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://learn.mechanic.dev/resources/tutorials/creating-a-mechanic-webhook.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.
