Skip to content

Registering webhooks in Truto for Customer.io

  1. If you have not already, register a webhook in Truto. Follow this guide to create a webhook in Truto. Please make sure it is subscribed to the following events

    • record:created
    • record:updated
    • record:deleted

    Truto webhook setup

  2. Please make a note of the integrated account ID of the Customer.io account you'd like to register the webhook for. Next, head on over to the Customer.io interface to create a webhook. You can find it under Journeys > Data & Integrations > Reporting webhooks. Click the Add reporting webhook button.

    New webhook

  3. Enter a name for the webhook and paste the following URL into the Webhook URL field. Replace with the integrated account ID you noted in step 2.

    https://api.truto.one/integrated-account-webhook/{{INTEGRATED_ACCOUNT_ID}}
  4. Select the events you'd like to receive notifications for.

    Enter webhook url

  5. Save the webhook.

  6. In the webhook list screen, click the 3-dots icon for the webhook you just registered and click Copy signing key.

    Copy signing key

  7. Head on over to the integrated account details page in Truto and click Edit varaibles button in the Variables section of the Details tab. Click Add variable and enter webhook_secret under the Name field and paste the signing key you copied in step 6 under the Value field. Click Save.

    Click edit variables

    Enter webhook secret

  8. You're all set! Truto will now send notifications to the webhook URL you registered in Customer.io whenever a record is created, updated, or deleted in the integrated account.

Example webhook event

json
{
  "id": "64fbf363-7ba3-4745-8c7b-730c0fdbf40d",
  "event": "record:created",
  "payload": {
    "resource": "customerio/events",
    "records": [
      {
        "data": {
          "action_id": 42,
          "campaign_id": 23,
          "content": "Welcome to the club, we are with you.",
          "customer_id": "user-123",
          "delivery_id": "RAECAAFwnUSneIa0ZXkmq8EdkAM==",
          "headers": {
            "Custom-Header": [
              "custom-value"
            ]
          },
          "identifiers": {
            "id": "user-123"
          },
          "recipient": "test@example.com",
          "subject": "Thanks for signing up"
        },
        "event_id": "01E2EMRMM6TZ12TF9WGZN0WJQT",
        "metric": "sent",
        "object_type": "email",
        "timestamp": "2024-02-16T14:27:36.000Z"
      }
    ],
    "integrated_account_id": "37440f42-0e20-442e-a98d-04b2766247cc",
    "raw_event_type": "email.sent",
    "raw_payload": {
      "data": {
        "action_id": 42,
        "campaign_id": 23,
        "content": "Welcome to the club, we are with you.",
        "customer_id": "user-123",
        "delivery_id": "RAECAAFwnUSneIa0ZXkmq8EdkAM==",
        "headers": {
          "Custom-Header": [
            "custom-value"
          ]
        },
        "identifiers": {
          "id": "user-123"
        },
        "recipient": "test@example.com",
        "subject": "Thanks for signing up"
      },
      "event_id": "01E2EMRMM6TZ12TF9WGZN0WJQT",
      "metric": "sent",
      "object_type": "email",
      "timestamp": 1708093656
    }
  },
  "environment_id": "ac15abdc-b38e-47d0-97a2-69194017c177",
  "created_at": "2024-02-16T14:27:36.805Z",
  "webhook_id": "15d12ab3-64a8-450e-a185-ead081cee0e4"
}