Webhooks

Webhooks let your application receive real-time notifications when events occur in Rally CRM. Instead of polling the API, configure an endpoint to receive HTTP POST requests whenever contacts are created, deals change stage, activities are completed, and more.

Endpoints

GET
/api/v1/webhooksList all webhooks
POST
/api/v1/webhooksCreate a webhook
GET
/api/v1/webhooks/{id}Get webhook details
PUT
/api/v1/webhooks/{id}Update a webhook
DELETE
/api/v1/webhooks/{id}Delete a webhook
POST
/api/v1/webhooks/{id}/testSend a test event
GET
/api/v1/webhooks/{id}/deliveriesGet delivery history

Create Request

CreateWebhookRequest

PropertyTypeRequiredDescription
namestringA descriptive name for the webhook
urlstringThe HTTPS endpoint URL that will receive event payloads
eventsList<string>Event types to subscribe to (e.g., contact.created, deal.won)

Response Model

WebhookResponse

PropertyTypeRequiredDescription
idGuidUnique webhook identifier
namestringWebhook name
urlstringDestination endpoint URL
secretstringHMAC signing secret for verifying webhook payloads
eventsList<string>Subscribed event types
isActiveboolWhether the webhook is currently active
lastTriggeredAtDateTime?Timestamp of the last triggered event
failureCountintConsecutive delivery failures (resets on success)
createdAtDateTimeWhen the webhook was created
{
  "id": "d4e5f6a7-b8c9-0123-def4-567890abcdef",
  "name": "CRM Sync",
  "url": "https://your-app.com/webhooks/rally",
  "secret": "whsec_K7xG9pQ3mN2vR8yT5wB1jL4cF6hD0sA",
  "events": [
    "contact.created",
    "contact.updated",
    "deal.stage_changed"
  ],
  "isActive": true,
  "lastTriggeredAt": null,
  "failureCount": 0,
  "createdAt": "2025-02-01T10:00:00Z"
}

Available Events

Subscribe to any combination of the following event types when creating or updating a webhook.

EventDescription
contact.createdNew contact created
contact.updatedContact information updated
contact.deletedContact deleted
company.createdNew company created
company.updatedCompany updated
deal.createdNew deal created
deal.updatedDeal updated
deal.stage_changedDeal moved to a new stage
deal.wonDeal marked as won
deal.lostDeal marked as lost
activity.createdActivity logged
activity.completedActivity completed

Webhook Payload

When an event fires, Rally sends an HTTP POST request to your endpoint with a JSON payload. Every payload includes the event type, a timestamp, and the relevant entity data.

{
  "event": "contact.created",
  "timestamp": "2025-02-01T10:30:00Z",
  "data": {
    "id": "c1d2e3f4-a5b6-7890-cdef-1234567890ab",
    "firstName": "Jane",
    "lastName": "Smith",
    "email": "jane@example.com"
  }
}

Your endpoint should return a 2xx status code within 10 seconds to acknowledge receipt. Failed deliveries are retried with exponential backoff up to 5 times.

Signature Verification

Every webhook request includes an X-Rally-Signature header containing an HMAC-SHA256 hash of the request body, signed with your webhook secret. Always verify this signature to confirm the request originated from Rally.

Verification Steps

  1. Read the raw request body as a UTF-8 string
  2. Compute an HMAC-SHA256 hash using your webhook secret as the key
  3. Hex-encode the result
  4. Compare with the X-Rally-Signature header value using a constant-time comparison
const crypto = require("crypto");

function verifyWebhookSignature(payload, signature, secret) {
  const expected = crypto
    .createHmac("sha256", secret)
    .update(payload, "utf8")
    .digest("hex");

  return crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(expected)
  );
}

// Express.js example
app.post("/webhooks/rally", express.raw({ type: "application/json" }), (req, res) => {
  const signature = req.headers["x-rally-signature"];
  const payload = req.body.toString();

  if (!verifyWebhookSignature(payload, signature, process.env.WEBHOOK_SECRET)) {
    return res.status(401).send("Invalid signature");
  }

  const event = JSON.parse(payload);
  console.log("Received event:", event.event);

  // Process the event...
  res.status(200).send("OK");
});

Examples

Create a Webhook

curl -X POST https://your-tenant.rallycrm.io/api/v1/webhooks \
  -H "X-Api-Key: rk_live_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "CRM Sync",
    "url": "https://your-app.com/webhooks/rally",
    "events": [
      "contact.created",
      "contact.updated",
      "deal.stage_changed",
      "deal.won"
    ]
  }'

Next Steps

Rally Support

We typically reply in a few hours

Hi! 👋 How can we help you today?