Welcome to using Moego Webhook Service. This guide will help you step-by-step through the integration process of Webhooks, including configuring receiving endpoints, creating Webhooks, verifying signatures, testing integration, handling failed requests, and monitoring delivery status.
| Step | Description |
|---|---|
| 1οΈβ£ | Prepare Webhook Receiving Endpoint |
| 2οΈβ£ | Create Webhook (via API or Management Console) |
| 3οΈβ£ | Verify Request Origin Authenticity |
| 4οΈβ£ | Test if Webhook Works Properly |
| 5οΈβ£ | Handle Failures and Retry Mechanisms |
| 6οΈβ£ | Monitor Webhook Delivery Status |
To successfully receive Webhook requests from Moego, your service must meet the following basic requirements:
| Requirement | Description |
|---|---|
| HTTPS Support | Must use HTTPS protocol (HTTP is not accepted) |
| Accept POST Requests | Must accept JSON-formatted POST requests |
| Response Time | Should return a 2xx response within 30 seconds |
| Idempotency Support | Use X-Moe-Delivery-ID to identify unique deliveries and avoid duplicates |
| Signature Verification (Optional) | Strongly recommend validating X-Moe-Signature or X-Moe-Signature-256 headers |
https://your-service.com/webhook-endpoint
β οΈ Note: Avoid using local addresses like
localhost. Itβs recommended to use tools like ngrok or localtunnel to expose local services as public URLs for testing.
| Header Name | Sample Value | Description |
|---|---|---|
User-Agent |
Moego/Webhook-1.0 |
Identifies Moego as the source. |
X-Moe-Client-Id |
018e5b36-e35c-7925-a9de-321ed638b682 |
Unique client identifier. |
X-Moe-Event-Type |
HEALTH_CHECK |
Type of event. |
X-Moe-Delivery-ID |
whkdXfP |
Unique ID for this delivery. |
X-Moe-Webhook-ID |
whk01 |
Unique ID for this Webhook. |
X-Moe-Nonce |
780525611260542810 |
Random string for replay prevention. |
X-Moe-Timestamp |
1751284717825 |
Unix timestamp (in milliseconds). |
X-Moe-Signature |
base64_encoded_sha1_signature |
SHA1-based HMAC signature. |
X-Moe-Signature-256 |
base64_encoded_sha256_signature |
SHA256-based HMAC signature (preferred). |
These headers are used for security and idempotency, especially when you enable signing with a secret_token.
{
"id": "a21eb4cd-367e-485f-932a-397a0951b709",
"type": "HEALTH_CHECK",
"timestamp": "2025-06-30T11:58:36.740351808Z",
"companyId": "encoded_company_id",
"payload": {
"validation": "hello world"
}
}
| Field | Type | Description |
|---|---|---|
id |
string | Unique event ID |
type |
string | Event type (e.g., HEALTH_CHECK, APPOINTMENT_CREATED, CUSTOMER_CREATED) |
timestamp |
string | ISO 8601 formatted timestamp |
companyId |
string | Encoded company ID associated with the event |
payload |
bytes | Varies based on event type. The string encoded in base64 |
You can register a new Webhook using Moegoβs RESTful API.
POST/v1/webhooks| Field | Type | Description |
|---|---|---|
endpointUrl |
string | Webhook receiving endpoint URL |
eventTypes |
array | List of event types to subscribe |
{
"endpointUrl": "https://your-service.com/webhook-endpoint",
"eventTypes": [
"HEALTH_CHECK",
"APPOINTMENT_CREATED",
"CUSTOMER_CREATED",
"CUSTOMER_UPDATED",
"CUSTOMER_DELETED"
],
"secretToken": "your_secure_token_here",
"isActive": true,
"verifySsl": true,
"headers": {
"Authorization": {
"values": [
"Bearer your_api_key"
]
}
}
}
{
"id": "whk_001",
"endpointUrl": "https://your-service.com/webhook-endpoint",
"eventTypes": [
"HEALTH_CHECK",
"APPOINTMENT_CREATED"
],
"isActive": true,
"createdTime": "2025-06-30T11:58:36Z"
}
π‘ Tip: Save the returned
idfield, which can be used later for triggering tests or querying logs. β οΈ Note: When creating a Webhook, make sure to save thesecret_token, which is used to verify request signatures. You can also query existing Webhooks using theListWebhooksAPI. ListWebhooks - webhook.md
To prevent forged requests, Moego includes signature fields in outgoing Webhook requests.
| Header Name | Description |
|---|---|
X-Moe-Signature |
SHA1-generated signature (not recommended) |
X-Moe-Signature-256 |
SHA256-generated signature (recommended) |
The signature is generated by concatenating the following fields and performing HMAC encryption:
clientID + nonce + timestamp + body
func isValidWebhookSignature(receivedSig string, secretToken string,
clientID string, nonce string, timestamp string, body []byte) bool {
raw := clientID + nonce + timestamp + string(body)
h := hmac.New(sha256.New, []byte(secretToken))
h.Write([]byte(raw))
expectedSig := base64.StdEncoding.EncodeToString(h.Sum(nil))
return hmac.Equal([]byte(receivedSig), []byte(expectedSig))
}
POST/v1/webhooks/{id}/test{
"eventType": "HEALTH_CHECK",
"payload": "aGVsbG8gd29ybGQ="
}
{
"id": "evt_health_check",
"type": "HEALTH_CHECK",
"timestamp": "2025-06-30T11:58:36.740351808Z",
"companyId": "cmp_001",
"payload": {
"validation": "hello world"
}
}
RedeliverWebhookDelivery.
See RedeliverWebhookDelivery - webhook.mdUse ListWebhookDeliveries to retrieve historical records:
{
"webhookId": "whk_001",
"filter": {
"success": false
}
}
200 OK immediately upon successful request receiptListWebhookDeliveries to check delivery success rateX-Moe-Delivery-ID and X-Moe-Nonce to prevent duplicate processingHTTPS and verify_ssl for encrypted communicationsecret_token for request signature verificationKey steps to successfully integrate with Moego Webhook:
| Error Code | Description |
|---|---|
ALREADY_EXISTS |
A Webhook with the same endpointUrl already exists |
NOT_FOUND |
Requested Webhook ID or Delivery ID does not exist |
PERMISSION_DENIED |
Current user lacks permission to perform this action |
INVALID_ARGUMENT |
Invalid request parameters (e.g., malformed URL or missing fields) |
INTERNAL |
Internal system error; try again later |
RESOURCE_EXHAUSTED |
System limit exceeded (e.g., max Webhook count or push frequency reached) |
For more error codes, see Common Error Codes - webhook.md
A: Use the TriggerTestWebhookDelivery API to send a test event and check if your endpoint receives the request.
A: Use the X-Moe-Delivery-ID header to uniquely identify each delivery and avoid reprocessing.
A: This means your account has reached the maximum number of allowed Webhooks. Contact your admin to adjust quotas or delete unused Webhooks.
A: JSON (CONTENT_TYPE_JSON) is currently supported. Additional formats may be added in the future.
A: Logs are retained for 15 days by default. They are automatically deleted after this period, so we recommend regular export for auditing purposes.
A: Yes, Moego automatically retries failed requests up to 3 times. You can also manually redeliver them using
RedeliverWebhookDelivery.