# Test receiving a Group/User/Created webhook
curl --location 'https://your-server.com/webhook' \
--header 'Content-Type: application/json' \
--data '{
"type": "Group/User/Created",
"occuredAt": 1508225229,
"body": {
"user": {
"id": "1234567890",
"name": "John Doe",
"email": "john@example.com",
"language": "en",
"timezone": "Europe/London",
"role": {
"alias": "learner"
},
"userAttributes": {
"department": "Sales",
"employeeId": "EMP123"
}
},
"group": {
"id": 123,
"name": "Sales Team",
"description": "Sales department team members"
}
}
}'

# Retrieve last group webhook event
curl --location 'https://YOURSITE.konstant.ly/openapi/v1/webhook/group.user.created/last' \
--header 'X-API-KEY: 1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv'

Group webhooks notify you about changes related to group membership and updates. These events help you track when users are added to groups and when group information changes.

Event Types

Group/User/Created
event

Triggered when a user is added to a group

Common Properties

All group webhook events share these common properties:

occuredAt
integer
required

Timestamp when the event occurred

type
string
required

Event type identifier

body
object
required

Event-specific payload data

Group/User/Created Event

This event is triggered whenever a user is added to a group.

Payload Structure

user
object
required

Details about the user being added

group
object
required

Details about the group

Implementation Examples

# Test receiving a Group/User/Created webhook
curl --location 'https://your-server.com/webhook' \
--header 'Content-Type: application/json' \
--data '{
"type": "Group/User/Created",
"occuredAt": 1508225229,
"body": {
"user": {
"id": "1234567890",
"name": "John Doe",
"email": "john@example.com",
"language": "en",
"timezone": "Europe/London",
"role": {
"alias": "learner"
},
"userAttributes": {
"department": "Sales",
"employeeId": "EMP123"
}
},
"group": {
"id": 123,
"name": "Sales Team",
"description": "Sales department team members"
}
}
}'

# Retrieve last group webhook event
curl --location 'https://YOURSITE.konstant.ly/openapi/v1/webhook/group.user.created/last' \
--header 'X-API-KEY: 1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv'

Best Practices

  1. Event Processing
  • Process events asynchronously to ensure quick response
  • Implement idempotency to handle potential duplicate events
  • Store raw event data for debugging and auditing
  1. Error Handling
  • Implement proper error handling and logging
  • Set up monitoring for failed webhook processing
  • Handle network timeouts and retries appropriately
  1. Security
  • Validate webhook source using API keys or signatures
  • Use HTTPS endpoints for receiving webhooks
  • Implement rate limiting and request validation
  1. Integration Tips
  • Update related systems when group membership changes
  • Maintain audit logs of group membership changes
  • Consider implementing event queuing for reliable processing