# 🎅🏽 Release Notes - Alpha Platform - Web-hook Configuration for Case Service - 24.12-24.x.x

**URL:** https://community.neutrinos.com/t/release-notes-alpha-platform-web-hook-configuration-for-case-service-24-12-24-x-x/239
**Category:** Announcements
**Tags:** neutrinos-alpha, alpha-release-notes
**Created:** [December 24, 2024, 4:36pm UTC](https://community.neutrinos.com/t/release-notes-alpha-platform-web-hook-configuration-for-case-service-24-12-24-x-x/239 "2024-12-24T16:36:17Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![doomedCode](https://community.neutrinos.com/user_avatar/community.neutrinos.com/doomedcode/32/49_2.png) [@doomedCode](https://community.neutrinos.com/u/doomedCode)
#### Post date: [December 24, 2024, 4:36pm UTC](https://community.neutrinos.com/t/release-notes-alpha-platform-web-hook-configuration-for-case-service-24-12-24-x-x/239/1 "2024-12-24T16:36:17Z")

</div>

## 🎁 Enhancements

# Case Service Webhooks

This document specifies the necessary configuration required for the Alpha Case Service and their expected format and usage.

## Required Environment Variables

1. CREATE\_CASE\_WEBHOOK\_CONFIG: Specifies the callback URL configurations for the “Create Case” operation.

2. UPDATE\_CASE\_WEBHOOK\_CONFIG: Specifies the callback URL configurations for the “Update Case” operation.

### Format

The value for both `CREATE_CASE_WEBHOOK_CONFIG` and `UPDATE_CASE_WEBHOOK_CONFIG` should be a valid JSON string in the following format:

```json
{
    "{project_id}": "{callback_url}"
}

```

### Example

```json
{
    "project123": "http://localhost:5000/webhook-endpoint",
    "project456": "http://example.com/api/webhook"
}

```

- project\_id: A unique identifier for the project.
- callback\_url: The URL that will receive webhook `POST` requests.

### Callback URL Requirements

- The callback URL must be a `POST` endpoint.
- The endpoint must be accessible without requiring any authentication.
- It should handle the request body as described below.

* * *

## Request Body for Webhook Callbacks

### For “Create Case” Operation

The CREATE\_CASE\_WEBHOOK\_CONFIG callback will receive a `POST` request with the following body:

```json
{
    "cid": "{case_instance_id}",
    "piid": "{process_instance_id}",
    "caseType": "{case_type}",
    "operation": "create_case",
    "projectId": "{project_id}"
}

```

### For “Update Case” Operation

The UPDATE\_CASE\_WEBHOOK\_CONFIG callback will receive a `POST` request with the following body:

```json
{
    "cid": "{case_instance_id}",
    "piid": "{process_instance_id}",
    "caseType": "{case_type}",
    "operation": "update_case",
    "projectId": "{project_id}"
}

```

* * *

## Example Configuration in Environment Variables In Helmchart Values File

```yaml
- name: CREATE_CASE_WEBHOOK_CONFIG
  value: '{"76fde341-b2a0-41d7-a7d8-674a8cd5vbbc": "http://sample-node-sample-nodejs-app.alpha.svc.cluster.local:3000/api/data"}'
- name: UPDATE_CASE_WEBHOOK_CONFIG
  value: '{"76fde341-b2a0-41d7-a7d8-674a8cd5vbbc": "http://sample-node-sample-nodejs-app.alpha.svc.cluster.local:3000/api/data"}'

```

 ![](https://community.neutrinos.com/uploads/default/original/1X/96b4201e6209733f81fa01c61c39d66c5ee86781.jpeg)

## Notes

- Ensure the callback URL is reachable and properly configured to handle the expected `POST` requests.
- The cid, piid, caseType, and projectId will be dynamically populated based on the operation and project-specific configurations.

## Demos:

### Case Create Webhook Demo:

[CASE\_CREATE\_HOOK.mov](https://drive.google.com/file/d/1CAnzNzHkjhaN22-YvEa-OHSmfArI3bq2/view?usp=drive_link)

### Case Update Webhook Demo:

[CASE\_UPDATE\_HOOK.mov](https://drive.google.com/file/d/1gxiHZ_dwJJXS-JMYH6UVcjpejP4rb2yi/view?usp=drive_link)

Once this is configured, whenever ANY case gets created or case data is updated, the configured endpoint will get called with `POST` method with the following payload:

```javascript
{
    cid: 14469, // case id of the case that got created
    piid: 7255, // associated process id
    caseType: 'motor_claim', // onboarded case type
    operation: 'create_case', // operation: 'create_case' or 'update_case'
    projectId: '76fde341-b2a0-41d7-a7d8-674a8cd5vbbc' // projectId for which the URL is configured in the env variable
}

```

## 📸 Images

| Service Name | Image Name | Image Version |
| --- | --- | --- |
| alpha-caseservice | [neutrinos.azurecr.io/alpha/alpha-case-service](http://neutrinos.azurecr.io/alpha/alpha-case-service) | 24.12.0.0.14-prod |

## 🌲 Environment Variables

| Service Name | Env Variable Name | Description | Example |
| --- | --- | --- | --- |
| alpha-caseservice | CREATE\_CASE\_WEBHOOK\_CONFIG | Per project create case notification callback URL configuration | { “{project\_id}”:“{callback\_url}”} |
| alpha-caseservice | UPDATE\_CASE\_WEBHOOK\_CONFIG | Per project update case notification callback URL configuration | { “{project\_id}”:“{callback\_url}”} |

* * *
