Configure how Gensail authenticates when sending webhooks to your server. This allows you to secure your webhook endpoint by requiring authentication on incoming requests from the pipeline.
When you configure webhook credentials, the pipeline will include authentication headers when delivering webhooks to your endpoint. This is the outbound authentication (pipeline → your server), complementing the webhook signature verification which verifies the payload integrity.
No authentication headers are added to webhook requests. Use this only for development or if your endpoint is secured by other means (e.g., IP allowlisting).
Sends an API key or token in the Authorization header:
Authorization: Bearer <your-token>Use cases:
- API key authentication
- JWT tokens
- OAuth2 access tokens
Sends an HMAC-SHA256 signature of the request body:
X-Signature: t=1734789600,v1=<hmac-signature>,key=<key-id>Use cases:
- Stripe-style webhook verification
- Custom signature validation
- High-security requirements
Sends Base64-encoded username:password credentials:
Authorization: Basic <base64(username:password)>Use cases:
- Legacy systems
- Simple authentication requirements
- Basic HTTP authentication
GET /api/v1/config/{entity_type}/{entity_id}/webhook-credential
Authorization: Bearer <platform-token>Path Parameters:
| Parameter | Type | Description |
|---|---|---|
entity_type | string | One of: partner, organization, workspace |
entity_id | uuid | The entity's unique identifier |
Response (200 OK):
{
"credential_id": "550e8400-e29b-41d4-a716-446655440000",
"credential_hint": "...x7f9",
"auth_type": "bearer",
"header_name": "Authorization"
}Response (404 Not Found):
{
"detail": "No webhook credential configured"
}POST /api/v1/config/{entity_type}/{entity_id}/webhook-credential
Authorization: Bearer <platform-token>
Content-Type: application/jsonRequest Body:
{
"auth_type": "bearer",
"credential": "your-api-key-or-token",
"secret": null,
"header_name": "Authorization"
}Request Fields:
| Field | Type | Required | Description |
|---|---|---|---|
auth_type | string | Yes | One of: bearer, hmac, basic |
credential | string | Yes | API key (bearer), key ID (hmac), or username (basic) |
secret | string | Conditional | HMAC secret or password (required for hmac and basic) |
header_name | string | No | Custom header name (defaults: Authorization for bearer/basic, X-Signature for hmac) |
Response (200 OK):
{
"credential_id": "550e8400-e29b-41d4-a716-446655440000",
"credential_hint": "...x7f9",
"auth_type": "bearer",
"header_name": "Authorization"
}DELETE /api/v1/config/{entity_type}/{entity_id}/webhook-credential
Authorization: Bearer <platform-token>Response (200 OK):
{
"message": "Webhook credential deleted",
"auth_type": "none"
}curl -X POST \
"https://analytics-api.gensail.com/api/v1/config/partner/YOUR_PARTNER_ID/webhook-credential" \
-H "Authorization: Bearer $PLATFORM_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"auth_type": "bearer",
"credential": "sk_live_abc123xyz789"
}'Your webhook endpoint will receive:
POST /your-webhook-endpoint HTTP/1.1
Authorization: Bearer sk_live_abc123xyz789
Content-Type: application/json
X-Signature: t=1734789600,v1=...
{"job_id": "...", "status": "completed", ...}curl -X POST \
"https://analytics-api.gensail.com/api/v1/config/partner/YOUR_PARTNER_ID/webhook-credential" \
-H "Authorization: Bearer $PLATFORM_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"auth_type": "hmac",
"credential": "key_production_001",
"secret": "whsec_supersecretkey123"
}'Your webhook endpoint will receive:
POST /your-webhook-endpoint HTTP/1.1
X-Signature: t=1734789600,v1=a3b2c1d4e5f6...,key=key_production_001
Content-Type: application/json
{"job_id": "...", "status": "completed", ...}curl -X POST \
"https://analytics-api.gensail.com/api/v1/config/partner/YOUR_PARTNER_ID/webhook-credential" \
-H "Authorization: Bearer $PLATFORM_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"auth_type": "basic",
"credential": "webhook_user",
"secret": "secure_password_123"
}'Your webhook endpoint will receive:
POST /your-webhook-endpoint HTTP/1.1
Authorization: Basic d2ViaG9va191c2VyOnNlY3VyZV9wYXNzd29yZF8xMjM=
Content-Type: application/json
{"job_id": "...", "status": "completed", ...}For endpoints that expect authentication in a non-standard header:
curl -X POST \
"https://analytics-api.gensail.com/api/v1/config/partner/YOUR_PARTNER_ID/webhook-credential" \
-H "Authorization: Bearer $PLATFORM_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"auth_type": "bearer",
"credential": "api_key_12345",
"header_name": "X-API-Key"
}'Your webhook endpoint will receive:
POST /your-webhook-endpoint HTTP/1.1
X-API-Key: api_key_12345
Content-Type: application/json
{"job_id": "...", "status": "completed", ...}Webhook credentials follow the standard configuration hierarchy:
Platform → Partner → Organization → WorkspaceCredentials configured at a lower level override those at higher levels. For example:
- A partner-level credential applies to all organizations and workspaces
- An organization can override with its own credential
- A workspace can have its own specific credential
All credentials are encrypted at rest using Fernet symmetric encryption. Only the last 4 characters are stored as a hint for identification purposes.
To rotate credentials:
- Generate a new credential on your server
- Update the credential via the API
- Verify webhooks are being received with the new credential
- Revoke the old credential on your server
- Use HTTPS: Always configure webhook URLs with HTTPS
- Rotate regularly: Rotate credentials periodically (e.g., every 90 days)
- Use strong secrets: Generate cryptographically random secrets
- Monitor failures: Watch for webhook delivery failures after credential changes
- Test first: Configure in test environment before production
- Verify credential is set: Use GET to check current configuration
- Check credential value: Ensure the credential matches what your server expects
- Verify header name: Confirm your server checks the correct header
- Check encoding: For basic auth, ensure proper Base64 handling
The entity doesn't have a credential set. Either:
- Configure one using POST
- Or the entity inherits from a parent (check parent entity)
- Wait a few seconds for cache invalidation
- Trigger a new webhook (e.g., reprocess a job)
- Check webhook delivery logs for the auth header
- Webhook Authentication (Signature Verification) - Verify incoming webhook payloads
For questions about webhook credential configuration, contact support@gensail.com.