Webhook Samples & Examples

Ready-to-use sample queries and response examples for testing your webhook integration

Sample Payloads

Use these sample payloads to test your webhook integration:

Basic User Creation

Minimal required fields for creating a new user

JSON Payload:

{
  "Id": "user_123",
  "Email": "john.doe@example.com"
}

cURL Command:

curl -X POST https://your-domain.com/api/webhooks/salesforce/users \
  -H "Content-Type: application/json" \
  -H "x-salesforce-signature: YOUR_HMAC_SIGNATURE" \
  -d '{
    "Id": "user_123",
    "Email": "john.doe@example.com"
  }'

Complete User Profile

Full user profile with all available fields

JSON Payload:

{
  "Id": "user_456",
  "FirstName": "Jane",
  "LastName": "Smith",
  "Email": "jane.smith@company.com",
  "Phone": "+1234567890",
  "Company": "Acme Corporation",
  "Title": "Senior Developer",
  "CreatedDate": "2024-01-15T10:30:00.000Z",
  "LastModifiedDate": "2024-01-20T14:45:00.000Z"
}

cURL Command:

curl -X POST https://your-domain.com/api/webhooks/salesforce/users \
  -H "Content-Type: application/json" \
  -H "x-salesforce-signature: YOUR_HMAC_SIGNATURE" \
  -d '{
    "Id": "user_456",
    "FirstName": "Jane",
    "LastName": "Smith",
    "Email": "jane.smith@company.com",
    "Phone": "+1234567890",
    "Company": "Acme Corporation",
    "Title": "Senior Developer",
    "CreatedDate": "2024-01-15T10:30:00.000Z",
    "LastModifiedDate": "2024-01-20T14:45:00.000Z"
  }'

User Update

Update existing user information

JSON Payload:

{
  "Id": "existing_user_789",
  "FirstName": "John",
  "LastName": "Doe Updated",
  "Email": "john.updated@example.com",
  "Phone": "+1987654321",
  "Company": "New Company Inc",
  "Title": "Lead Developer",
  "LastModifiedDate": "2024-01-25T16:20:00.000Z"
}

cURL Command:

curl -X POST https://your-domain.com/api/webhooks/salesforce/users \
  -H "Content-Type: application/json" \
  -H "x-salesforce-signature: YOUR_HMAC_SIGNATURE" \
  -d '{
    "Id": "existing_user_789",
    "FirstName": "John",
    "LastName": "Doe Updated",
    "Email": "john.updated@example.com",
    "Phone": "+1987654321",
    "Company": "New Company Inc",
    "Title": "Lead Developer",
    "LastModifiedDate": "2024-01-25T16:20:00.000Z"
  }'

Response Examples

Here are the different types of responses you can expect from the webhook:

Successful User Creation

200
{
  "success": true,
  "message": "Salesforce User Sync processed successfully",
  "data": {
    "uid": "firebase_auth_uid_123",
    "email": "john.doe@example.com",
    "displayName": "John Doe",
    "salesforceId": "user_123",
    "action": "created",
    "tempPassword": "TempPass123!@#"
  }
}

Successful User Update

200
{
  "success": true,
  "message": "Salesforce User Sync processed successfully",
  "data": {
    "uid": "firebase_auth_uid_456",
    "email": "jane.smith@company.com",
    "displayName": "Jane Smith",
    "salesforceId": "user_456",
    "action": "updated"
  }
}

Validation Error

400
{
  "error": "Bad Request",
  "message": "Missing required field: Email"
}

Authentication Error

401
{
  "error": "Unauthorized",
  "message": "Invalid webhook signature"
}

Rate Limit Exceeded

429
{
  "error": "Too Many Requests",
  "message": "Rate limit exceeded",
  "retryAfter": 60
}

Testing Tips

🔐 HMAC Signature

Always include the x-salesforce-signature header with a valid HMAC SHA-256 signature of your payload using your WEBHOOK_SECRET.

📝 Required Fields

Every payload must include Id and Email fields. All other fields are optional.

🔄 User Updates

Users are identified by email address. Sending the same email with different data will update the existing user.

⚡ Rate Limiting

Webhooks are rate limited to 100 requests per minute per IP address. Check response headers for rate limit information.