curl --request POST \
  --url https://api.frigade.com/v1/public/userGroups \
  --header 'Authorization: Bearer <token>'

The user groups endpoint allows you to create groups, add events, and update group properties.

If Frigade does not recognize the foreignUserId or foreignUserGroupId, a user and/or organization will automatically be created.

Add events to an organization

curl -i -X POST \
   -H "Authorization:Bearer api_public_J3FNG3dJASDKLW98SN4KLOJHNTYUFGNVSK" \
   -H "Content-Type:application/json" \
   -d \
'{
  "foreignUserGroupId":"MyCompanyId",
  "foreignUserId": "MyUserId",
  "events": [
    {
      "event": "ProjectCreation",
      "properties": {
        "hasCreatedProject": true
      }
    }
  ]
}' \
 'https://api.frigade.com/v1/public/userGroups'

Update organization properties

curl -i -X POST \
   -H "Authorization:Bearer api_public_J3FNG3dJASDKLW98SN4KLOJHNTYUFGNVSK" \
   -H "Content-Type:application/json" \
   -d \
'{
  "foreignUserGroupId":"MyCompanyId",
  "foreignUserId": "MyUserId",
  "properties": {
    "companyName": "My Company",
    "hasConnectedToGithub": true
  }
}' \
 'https://api.frigade.com/v1/public/userGroups'