> For the complete documentation index, see [llms.txt](https://docs.couchdrop.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.couchdrop.io/managed-file-transfer/webhooks/inbound-webhooks.md).

# Inbound Webhooks

Inbound https webhooks are a flexible and easy way to ingest data from any system that can use HTTPS.

## Introduction

Inbound Webhooks in Couchdrop let applications and systems upload data directly into your storage over HTTPS.

Each Inbound Webhook provides an HTTPS endpoint that accepts `POST` requests and saves the uploaded content to the folder you configure. This is useful for applications, scripts, and automated systems that need to deliver files or data without using SFTP or another file transfer client.

Inbound Webhooks can receive binary files, JSON, or raw request bodies. You can also configure a bearer token to authenticate incoming requests.

## How to create an Inbound Webhook

{% hint style="warning" %}

#### Before you start

To create an Inbound Webhook, you will need:

* Access to Couchdrop with the appropriate permissions
* A folder or storage location for received data
* An understanding of the data your application will send
* An authentication token, if you want to authenticate requests
  {% endhint %}

{% stepper %}
{% step %}

### Create a new Inbound Webhook

In Couchdrop, select **Webhooks**, then click **Create New**.

If you do not see this option, contact your Couchdrop administrator.
{% endstep %}

{% step %}

### Configure the Webhook

Enter a name for the Webhook so you can identify the endpoint.

Select the folder where received files will be stored. You can choose an existing folder or configure a new cloud storage connection.

Click **Save and Continue**.
{% endstep %}

{% step %}

### Configure authentication

Optionally, configure an authentication token for the Webhook.

Applications sending data to the endpoint can include this token as a bearer token in the `Authorization` header.

Click **Save and Continue** to finish the configuration.
{% endstep %}
{% endstepper %}

## How to upload data to an Inbound Webhook

Once created, the Inbound Webhook can receive HTTPS `POST` requests using its Webhook URL.

### Upload a file with cURL

Use multipart form data to upload a file:

```bash
curl -v \
  -F content=@CHRIS.txt \
  -H "Authorization: Bearer [token]" \
  https://[yourdomain].couchdrop.io/webhook/[webhook_id]
```

Replace:

* `[token]` with the authentication token configured for the Webhook.
* `[yourdomain]` with the ID of your Inbound Webhook.
* `[webhook_id]` with the ID of your Inbound Webhook.

### Upload a binary stream with Python

You can send a file directly in the request body and specify its filename using the `filename` header:

```python
import requests

binary_file_path = "/Users/donald/testing/trophy.jpg"
webhook_id = "[webhook_id]"
token = "[token]"
domain = "[yourdomain]"

with open(binary_file_path, "rb") as f:
    data = f.read()

    res = requests.post(
        url="https://" + domain + ".couchdrop.io/webhook/" + webhook_id,
        data=data,
        headers={
            "filename": "trophy_webhook.jpg",
            "Content-Type": "application/octet-stream",
            "Authorization": "Bearer " + token
        }
    )
```

In this example:

* `filename` defines the name Couchdrop uses for the uploaded file.
* `Content-Type: application/octet-stream` identifies the request body as binary data.
* `Authorization` supplies the configured bearer token.

#### Upload JSON to a file

JSON can also be sent directly in the request body:

```bash
curl \
  -H "Filename: json_test_file.json" \
  -H "Content-Type: application/json" \
  -X POST \
  https://[yourdomain].couchdrop.io/webhook/[webhook_id] \
  -d '{"id":"dasflk34masd","event":"purchase","customer":"testaccount"}'
```

The `Filename` header tells Couchdrop what filename to use when saving the JSON content.

## Settings

Additional Inbound Webhook settings can be configured during creation or after the Webhook has been created.

### General webhook settings

Configure how the Webhook is identified, where uploaded files are stored, and which partner or vendor it belongs to.

| Setting                          | Description                                                                                                                   |
| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| **Connecting Partner or Vendor** | Associate the Webhook with an existing or new partner or vendor for organization. This does not affect how data is processed. |
| **Webhook name**                 | Sets the name used to identify the Webhook in Couchdrop.                                                                      |
| **Upload location**              | Selects the folder or storage location where files uploaded through the Webhook will be saved.                                |

### Expiry and notifications

Configure how long the Webhook remains active and when Couchdrop sends email notifications.

| Setting                            | Description                                                                            |
| ---------------------------------- | -------------------------------------------------------------------------------------- |
| **Expiry**                         | Set the Webhook to **Never Expire** or expire after a specified amount of time.        |
| **Success notifications**          | Send an email when an upload through the Webhook succeeds.                             |
| **Failure notifications**          | Send an email when an upload through the Webhook fails.                                |
| **Custom notification recipients** | Send notifications to one or more custom email addresses using a comma-separated list. |

### Access and Security

Configure authentication and restrict which networks can send data to the Webhook.

| Setting                | Description                                                                                    |
| ---------------------- | ---------------------------------------------------------------------------------------------- |
| **Bearer token**       | Optionally configure or generate a bearer token that clients must provide when uploading data. |
| **Allowed Sender IPs** | Restrict requests to approved IP addresses or CIDR ranges.                                     |

### Transfer Shield

Define the type of content you expect to receive and apply controls to files that do not match those expectations.

| Setting                           | Description                                                                                                           |
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| **Enable Content Classification** | Classifies files uploaded through the Webhook using Couchdrop's DLP engine.                                           |
| **Block unclassified files**      | Denies a file if Transfer Shield cannot classify it for any reason.                                                   |
| **Content Rule Groups**           | Apply a selected content rule group, such as **Detect Malware & Executables**, to files uploaded through the Webhook. |

## Frequently asked questions

<details>

<summary>What can I send to an Inbound Webhook?</summary>

Inbound Webhooks can receive binary files, JSON, and raw request bodies over HTTPS.

</details>

<details>

<summary>Do I need to configure a bearer token?</summary>

No. The **Bearer token** is optional. If configured, clients uploading to the Webhook must include the token in the `Authorization` header.

</details>

<details>

<summary>Can I restrict which IP addresses can use a Webhook?</summary>

Yes. Use **Allowed Sender IPs** to restrict requests to approved IP addresses or CIDR ranges.

</details>

<details>

<summary>Where are uploaded files saved?</summary>

Files are saved to the folder or storage location configured for the Webhook.

</details>

<details>

<summary>Can an Inbound Webhook expire?</summary>

Yes. You can configure the Webhook to **Never Expire** or expire after a specified amount of time.

</details>

<details>

<summary>Can I receive notifications when an upload succeeds or fails?</summary>

Yes. You can enable email notifications for successful and failed uploads and optionally send them to custom recipients.

</details>

<details>

<summary>Can Transfer Shield inspect files uploaded through a Webhook?</summary>

Yes. You can enable content classification, apply a **Content Rule Group**, and optionally block files that cannot be classified.

</details>
