---
availability: INSTALLABLE
description: A plugin that allows employees to update their emergency contact information.
installation_asset_uuid: dcdd6051-b912-42a7-8fca-8015127c2ded
name: Manage Emergency Contacts
purple_chat_link: https://marketplace.moveworks.com/purple-chat?conversation=%7B%22messages%22%3A%5B%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22I+need+to+update+my+emergency+contact+information.%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Detected+intent+to+manage+emergency+contacts.%22%7D%2C%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Retrieving+current+emergency+contact+information+from+%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ESAP+SuccessFactors%3C%2Fb%3E.%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp%3EI+can+help+with+that.+Here+are+your+current+emergency+contacts%3A%3C%2Fp%3E%3Cul%3E%3Cli%3E%3Cp%3E%3Cstrong%3EMary+Johnson%3C%2Fstrong%3E+%28Mother%2C+555-111-2222%29%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EDavid+Lee%3C%2Fstrong%3E+%28Spouse%2C+555-333-4444%29%3C%2Fp%3E%3C%2Fli%3E%3C%2Ful%3E%3Cp%3E+Would+you+like+to+%3Cstrong%3Eupdate+an+existing+one+%3C%2Fstrong%3Eor%3Cstrong%3E+add+a+new+emergency+contact%3C%2Fstrong%3E%3F%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22I+want+to+add+a+new+emergency+contact%3A+John+Smith%2C+my+brother%2C+555-123-4567.%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Parsed+details+for+a+new+emergency+contact+from+the+user%27s+input.%22%7D%2C%7B%22status%22%3A%22pending%22%2C%22richText%22%3A%22Preparing+to+add+the+new+contact+to+%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ESAP+SuccessFactors%3C%2Fb%3E.%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp%3EOkay%2C+you%27d+like+to+add+a+new+emergency+contact+with+the+following+details%3A%3C%2Fp%3E%3Cul%3E%3Cli%3E%3Cp%3E%3Cstrong%3EName%3C%2Fstrong%3E%3A+John+Smith%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3ERelationship%3C%2Fstrong%3E%3A+Brother%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EPhone%3C%2Fstrong%3E%3A+555-123-4567%3C%2Fp%3E%3C%2Fli%3E%3C%2Ful%3E%3Cp%3E+Does+this+look+correct%3F+I+will+add+this+to+your+records.%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22Yes%2C+please+add+him.%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Received+confirmation+to+add+the+new+emergency+contact.%22%7D%2C%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Adding+John+Smith+as+an+emergency+contact+in+%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ESAP+SuccessFactors%3C%2Fb%3E.%22%7D%5D%7D%2C%7B%22richText%22%3A%22Great%21+John+Smith+has+been+successfully+added+as+your+new+emergency+contact.%22%7D%2C%7B%22citations%22%3A%5B%7B%22connectorName%22%3A%22sap-successfactors%22%2C%22citationTitle%22%3A%22John+Smith+%28Emergency+Contact%29%22%7D%5D%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22Now+I+also+need+to+update+Mary+Johnson%27s+phone+number.%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Detected+request+to+update+an+existing+emergency+contact.%22%7D%2C%7B%22status%22%3A%22pending%22%2C%22richText%22%3A%22Preparing+to+retrieve+and+modify+Mary+Johnson%27s+contact+information.%22%7D%5D%7D%2C%7B%22richText%22%3A%22Okay%2C+I+can+help+update+Mary+Johnson%27s+information.+What+is+the+new+phone+number+you%27d+like+to+set+for+her%3F%22%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22Her+new+phone+number+is+555-987-6543.%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Parsed+new+phone+number+for+Mary+Johnson.%22%7D%2C%7B%22status%22%3A%22pending%22%2C%22richText%22%3A%22Preparing+to+update+Mary+Johnson%27s+phone+number+in+%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ESAP+SuccessFactors%3C%2Fb%3E.%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp%3EJust+to+confirm%2C+you+want+to+update+Mary+Johnson%27s+phone+number+to+%3Cstrong%3E555-987-6543%3C%2Fstrong%3E.+Is+that+correct%3F+I+will+update+this+information+for+your+contact.%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22Yes%2C+that%27s+correct.%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Received+confirmation+to+update+Mary+Johnson%27s+phone+number.%22%7D%2C%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Updating+Mary+Johnson%27s+phone+number+to+555-987-6543+in+%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ESAP+SuccessFactors%3C%2Fb%3E.%22%7D%5D%7D%2C%7B%22richText%22%3A%22Mary+Johnson%27s+phone+number+has+been+successfully+updated+to+%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E555-987-6543%3C%2Fb%3E.%22%7D%2C%7B%22citations%22%3A%5B%7B%22connectorName%22%3A%22sap-successfactors%22%2C%22citationTitle%22%3A%22Mary+Johnson+%28Emergency+Contact%29%22%7D%5D%7D%5D%7D%5D%7D
solution_tags:
- HR - Employee Records
systems:
- sap-success-factors
---

## Introduction

The “**Manage Emergency Contacts**” plugin allows employees to easily add or update their emergency contact information in SAP SuccessFactors through the Moveworks AI Assistant. This automation ensures HR teams always have the latest contact information for emergencies without delays. This guide will walk you through installing and configuring the plugin in Agent Studio in just a few minutes. Let’s get started!

This guide will walk you through installing and configuring the plugin in **Agent Studio** in just a few minutes. Let’s get started

## Prerequisites

- Access to Agent Studio

## **What are we building?**

### **Agent Design**

This [purple chat](https://marketplace.moveworks.com/purple-chat?conversation=%7B%22messages%22%3A%5B%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22I+need+to+update+my+emergency+contact+information.%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Detected+intent+to+manage+emergency+contacts.%22%7D%2C%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Retrieving+current+emergency+contact+information+from+%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ESAP+SuccessFactors%3C%2Fb%3E.%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp%3EI+can+help+with+that.+Here+are+your+current+emergency+contacts%3A%3C%2Fp%3E%3Cul%3E%3Cli%3E%3Cp%3E%3Cstrong%3EMary+Johnson%3C%2Fstrong%3E+%28Mother%2C+555-111-2222%29%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EDavid+Lee%3C%2Fstrong%3E+%28Spouse%2C+555-333-4444%29%3C%2Fp%3E%3C%2Fli%3E%3C%2Ful%3E%3Cp%3E+Would+you+like+to+%3Cstrong%3Eupdate+an+existing+one+%3C%2Fstrong%3Eor%3Cstrong%3E+add+a+new+emergency+contact%3C%2Fstrong%3E%3F%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22I+want+to+add+a+new+emergency+contact%3A+John+Smith%2C+my+brother%2C+555-123-4567.%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Parsed+details+for+a+new+emergency+contact+from+the+user%27s+input.%22%7D%2C%7B%22status%22%3A%22pending%22%2C%22richText%22%3A%22Preparing+to+add+the+new+contact+to+%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ESAP+SuccessFactors%3C%2Fb%3E.%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp%3EOkay%2C+you%27d+like+to+add+a+new+emergency+contact+with+the+following+details%3A%3C%2Fp%3E%3Cul%3E%3Cli%3E%3Cp%3E%3Cstrong%3EName%3C%2Fstrong%3E%3A+John+Smith%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3ERelationship%3C%2Fstrong%3E%3A+Brother%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EPhone%3C%2Fstrong%3E%3A+555-123-4567%3C%2Fp%3E%3C%2Fli%3E%3C%2Ful%3E%3Cp%3E+Does+this+look+correct%3F+I+will+add+this+to+your+records.%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22Yes%2C+please+add+him.%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Received+confirmation+to+add+the+new+emergency+contact.%22%7D%2C%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Adding+John+Smith+as+an+emergency+contact+in+%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ESAP+SuccessFactors%3C%2Fb%3E.%22%7D%5D%7D%2C%7B%22richText%22%3A%22Great%21+John+Smith+has+been+successfully+added+as+your+new+emergency+contact.%22%7D%2C%7B%22citations%22%3A%5B%7B%22connectorName%22%3A%22sap-successfactors%22%2C%22citationTitle%22%3A%22John+Smith+%28Emergency+Contact%29%22%7D%5D%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22Now+I+also+need+to+update+Mary+Johnson%27s+phone+number.%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Detected+request+to+update+an+existing+emergency+contact.%22%7D%2C%7B%22status%22%3A%22pending%22%2C%22richText%22%3A%22Preparing+to+retrieve+and+modify+Mary+Johnson%27s+contact+information.%22%7D%5D%7D%2C%7B%22richText%22%3A%22Okay%2C+I+can+help+update+Mary+Johnson%27s+information.+What+is+the+new+phone+number+you%27d+like+to+set+for+her%3F%22%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22Her+new+phone+number+is+555-987-6543.%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Parsed+new+phone+number+for+Mary+Johnson.%22%7D%2C%7B%22status%22%3A%22pending%22%2C%22richText%22%3A%22Preparing+to+update+Mary+Johnson%27s+phone+number+in+%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ESAP+SuccessFactors%3C%2Fb%3E.%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp%3EJust+to+confirm%2C+you+want+to+update+Mary+Johnson%27s+phone+number+to+%3Cstrong%3E555-987-6543%3C%2Fstrong%3E.+Is+that+correct%3F+I+will+update+this+information+for+your+contact.%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22Yes%2C+that%27s+correct.%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Received+confirmation+to+update+Mary+Johnson%27s+phone+number.%22%7D%2C%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Updating+Mary+Johnson%27s+phone+number+to+555-987-6543+in+%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ESAP+SuccessFactors%3C%2Fb%3E.%22%7D%5D%7D%2C%7B%22richText%22%3A%22Mary+Johnson%27s+phone+number+has+been+successfully+updated+to+%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E555-987-6543%3C%2Fb%3E.%22%7D%2C%7B%22citations%22%3A%5B%7B%22connectorName%22%3A%22sap-successfactors%22%2C%22citationTitle%22%3A%22Mary+Johnson+%28Emergency+Contact%29%22%7D%5D%7D%5D%7D%5D%7D) shows the experience we are going to build.

## **Installation Steps**

While you can create a connector during plugin installation, we recommend setting up the connector in **Agent Studio** beforehand to streamline the process. Please follow our [**SAP SuccessFactors Connector Guide**](https://developer.moveworks.com/creator-studio/resources/connector/?id=sap-success-factors&commit_id=21f2fb0f5f2b0852c62a72235121cd8d78d6b46b;) for detailed instructions. Once completed, proceed to install the **Manage Emergency Contacts** plugin and complete the setup efficiently.

For this plugin, ensure the SAP SuccessFactors integration user has the following permissions:

**Required Scopes:**

- `Upsert` access to the **PerEmergencyContacts** entity
- `View` access to the **PerEmergencyContacts** entity
- `View` access to the **User** entity

After configuring the connector, refer to our [plugin installation documentation](https://help.moveworks.com/docs/ai-agent-marketplace-installation) for more details on completing the setup.

## **Appendix**

### **API #1 : Get User Id By Email**

```bash
curl --location 'https://<YOUR_INSTANCE>/odata/v2/User?$filter=email%20eq%20%27{{email}}%27&$select=userId,username' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'Accept: application/json'
```

**Query Parameters:**

- **`email`** (string) – The work email address of the employee to search for.
- `$select` (string) - Select properties to be returned.

### **API #2 : Get Emergency Contacts By User Id**

```bash
curl --location 'https://<YOUR_INSTANCE>/odata/v2/PerEmergencyContacts?$filter=personIdExternal%20eq%20%27{{personIdExternal}}%27' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'Accept: application/json'
```

**Query Parameters:**

- **`personIdExternal`** (string) – The unique identifier of the employee whose emergency contacts you want to retrieve.

### **API #3 : Add Or Update Emergency Contact**

```bash
curl --location 'https://<YOUR_INSTANCE>/odata/v2/upsert' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '[
  {
    "__metadata": {
      "uri": "PerEmergencyContacts"
    },
    "personIdExternal": "{{personIdExternal}}",
    "name": "{{contact_name}}",
    "relationship": "{{relationship}}",
    "email": "{{email}}",
    "phone": "{{phone}}",
    "primaryFlag": "{{primaryFlag}}"
  }
]'
```

**Body Parameters:**

- **`personIdExternal`** (string) – The unique identifier of the employee for whom the emergency contact is being added or updated.
- **`name`** (string) – Full name of the emergency contact.
- **`relationship`** (string) – Relationship of the contact to the employee
- **`email`** (string, optional) – Email address of the emergency contact.
- **`phone`** (string, optional) – Phone number of the emergency contact.
- **`primaryFlag`** (string, optional) – Indicates if this is the primary emergency contact (`Y` or `N`).

**Note:**

The UPSERT API allows you to **create new emergency contact records** or **update existing ones**.

- **Supported updates for existing contacts:** `email`, `phone`, and `primaryFlag`.
- **Unsupported updates for existing contacts:** `name` and `relationship`. These fields can only be set when creating a new contact.

When creating a **new emergency contact**, all fields are supported: `name`, `relationship`, `email`, `phone`, and `primaryFlag`.

**Rules for `primaryFlag`:**

1. **Creating a primary contact (`primaryFlag = 'Y'`):**
    - Allowed **only if the employee has no existing emergency contacts**.
2. **Creating a secondary contact (`primaryFlag = 'N'`):**
    - Allowed **only if there is already an existing primary contact (`primaryFlag = 'Y'`)**.
3. **Updating an existing contact to secondary (`primaryFlag = 'N'`):**
    - Allowed **only if there is at least one other contact with `primaryFlag = 'Y'`**.
    - Only the fields `email`, `phone`, and `primaryFlag` can be updated; `name` and `relationship` cannot be modified.