Destinations
Create Destination
Creates a new destination for the tenant. The request body structure depends on the type.
post/tenants/{tenant_id}/destinations
Request body
Example request
{
"id": "user-provided-id",
"filter": {
"data": {
"amount": {
"$gte": 100
},
"customer": {
"tier": "premium"
}
}
},
"config": {
"url": "https://example.com/webhooks/user",
"custom_headers": "{\"x-api-key\":\"secret123\",\"x-tenant-id\":\"customer-456\"}"
},
"credentials": {
"secret": "whsec_abc123",
"previous_secret": "whsec_xyz789",
"previous_secret_invalid_at": "2024-01-02T00:00:00Z"
},
"delivery_metadata": {
"app-id": "my-app",
"region": "us-east-1"
},
"metadata": {
"internal-id": "123",
"team": "platform"
},
"created_at": "2024-02-15T10:00:00Z",
"updated_at": "2024-02-15T10:00:00Z"
}Response
Destination created successfully.
Example response
{
"id": "des_webhook_123",
"type": "webhook",
"topics": [
"user.created",
"order.shipped"
],
"disabled_at": null,
"created_at": "2024-02-15T10:00:00Z",
"updated_at": "2024-02-15T10:00:00Z",
"config": {
"url": "https://my-service.com/webhook/handler"
},
"credentials": {
"secret": "whsec_abc123def456",
"previous_secret": "whsec_prev789xyz012",
"previous_secret_invalid_at": "2024-02-16T10:00:00Z"
}
}