> ## Documentation Index
> Fetch the complete documentation index at: https://sendcloud.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Integration deleted

> A request is sent to the defined webhook whenever the integration is deleted from our system.



## OpenAPI

````yaml /.openapi/v3/webhooks/openapi.yaml webhook IntegrationDeleted
openapi: 3.1.0
info:
  title: Webhooks
  version: 3.0.0
  description: >-
    Sendcloud uses webhooks to notify your application of parcel updates, such
    as changes in delivery status.


    > **Important:** Webhooks are scoped to the integration they are configured
    on. You'll only receive webhook events for parcels created through this
    integration, and for actions that belong to it. If you have multiple
    integrations, each one needs its own webhook configuration.


    **To receive the parcel data for every update to a parcel, you need to:**

    - In the Sendcloud platform, go to **Settings** >
    [**Integrations**](https://app.sendcloud.com/v2/settings/integrations/manage),
    and click **Configure** on your Sendcloud API integration.

    - Select the **Webhook feedback enabled** checkbox.

    - In the **Webhook url** field, enter the URL of the endpoint in your
    application that will process the data.

    - Click **Save**.

    - Optional: to check your setup, click **Test API webhook** to send a test
    webhook to your application.


    Sendcloud signs every webhook request using an HMAC (Hash-based Message
    Authentication Code) signature with the SHA-256 algorithm. It uses the
    **Secret Key** or the **Webhook Signature Key** as the secret, depending on
    your integration type. To check that a webhook came from Sendcloud, compute
    the HMAC-SHA256 over the entire raw request body, exactly as received and
    before any parsing, using your secret. Then compare the hex-encoded result
    with the value of the `Sendcloud-Signature` header.


    ```php

    <?php

    $secret_key = "secretkey";

    // Use the raw request body; don't use $_POST or re-encoded JSON.

    $payload = file_get_contents('php://input');

    $received_signature = $_SERVER['HTTP_SENDCLOUD_SIGNATURE'] ?? '';


    $expected_signature = hash_hmac('sha256', $payload, $secret_key);


    if (!hash_equals($expected_signature, $received_signature)) {
        http_response_code(401);
        exit;
    }


    // Example: for the body {"key": "value"} and secret "secretkey",

    // the signature is
    1eed4b3d41f4653ac64fd56f1bf1cbfd349e4482cbc11dff7134bd93e5da4b0a

    ```


    ```python

    import hmac

    import hashlib


    def is_valid_signature(raw_body: bytes, received_signature: str, secret_key:
    str) -> bool:
        # Hash the raw request body exactly as received; don't parse and re-serialise it.
        expected = hmac.new(secret_key.encode("utf-8"), raw_body, hashlib.sha256).hexdigest()
        return hmac.compare_digest(expected, received_signature)

    # Example: for the body {"key": "value"} and secret "secretkey",

    # the signature is
    1eed4b3d41f4653ac64fd56f1bf1cbfd349e4482cbc11dff7134bd93e5da4b0a

    assert is_valid_signature(
        b'{"key": "value"}',
        "1eed4b3d41f4653ac64fd56f1bf1cbfd349e4482cbc11dff7134bd93e5da4b0a",
        "secretkey",
    )

    ```


    **Additional notes:**

    - The data your application receives is the same as the parcel payload
    described in the [Parcel status
    changed](/api/v3/webhooks/parcel-status-changed) webhook reference.

    - If a delivery fails, Sendcloud retries up to 10 times with exponential
    backoff, starting at 5 minutes and capped at 1 hour between attempts. If all
    retries fail, Sendcloud stops and logs the failure in the [connection issue
    log](https://app.sendcloud.com/v2/settings/integrations/logs).

    - Webhooks can arrive out of order, for example if your application was
    unreachable for a while. Use the `timestamp` field in each payload to find
    the most recent update.

    - For return parcels, you'll only receive webhook updates if the outgoing
    shipment was created through the API integration.
  contact:
    name: Sendcloud API Support
    url: https://www.sendcloud.dev
    email: contact@sendcloud.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://www.shop_url.com/webhook
    description: User API endpoint
security:
  - Sendcloud-Signature: []
tags:
  - name: Webhooks
paths: {}
components:
  securitySchemes:
    Sendcloud-Signature:
      name: Sendcloud-Signature
      type: apiKey
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.