> For the complete documentation index, see [llms.txt](https://docs.vomevolunteer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vomevolunteer.com/resources/editor/write-operations.md).

# Write Operations

Vome API offers endpoints to create, update or upsert (create and/or update) profiles directly in your Vome database.

***

**How we does Vome identify a profile in your database?**\
\
We offer 3 flexible ways for your team to identify profiles from your Vome database. <br>

1. **Email address (default method)**: The email address field is a **username** in the Vome system, and therefore can be used to match profiles from other systems. <br>

   *<mark style="color:orange;">For example, let's say you want to update existing profiles in your Vome database. One of the profiles getting updated will be Bill Smith (who has an email of <bill@domain.com>). When sending a PUT request to update profiles, we will check to see if there is a profile with the email <bill@domain.com> to update).</mark>*<br>
2. **Vome ID:** Every profile on Vome has a unique identifier string value associated with their account. You can access these Vome ID values when retrieving profiles\
   \
   \&#xNAN;*<mark style="color:orange;">For example, let's say you want to update existing profiles in your Vome database. One of the profiles getting updated will be Bill Smith (who has a Vome ID equal to "123"). When sending a PUT request to update profiles, we will check to see if there is a profile with the Vome ID of "123" to update).</mark>*<br>
3. **Custom ID field**: On Vome, we offer the ability for admins to create **custom fields** in their database. We offer a **field type** called "**Unique ID**" which allows you to add Unique ID values and associate them with profiles. \
   \
   \&#xNAN;*<mark style="color:orange;">For example, you can create a Vome database field. The field type would be "Unique ID" and the name of the field entered is "Salesforce ID". By doing so, we can then match profiles based on this user value for this custom field.</mark>* <br>

#### Endpoints

```plaintext
POST api/profiles/bulk-create/
PUT api/profiles/bulk-update/
PUT api/profiles/bulk-upsert/
```

#### API specification

* **unique\_identifier** (`object`): Includes the setting of how you would like to identify users from your database.
  * **identifier\_type** (`integer` | `null`):&#x20;
    * `0` = Email
    * `1` = Vome ID
    * `2` = Custom Field - Unique ID
  * **unique\_id** (`string` | `null`): If the **identifier\_type** is set to **Custom Field - Unique ID**, this would be the ID of the field from Vome.&#x20;
    * *For example, if you created a new field on the Vome database calle**d Salesforce User ID**, when retrieving a profile using our endpoint, you will see this field has an **associated field ID**, which can be used here.*<br>
* **invite\_user\_to\_vome** (`boolean`| `null`): Whether you choose to invite the new user to claim their profile on Vome. If you choose to make this **False**, the profile will remain **Offline** in your database unless invited in the future.&#x20;
* **invite\_language** (`string` | `null`): You can pass "EN" or "FR".&#x20;
  * If you choose to invite the user to claim their profile, indicate whether you want to send the invitation in English or French
* **invite\_message** (`string` | `null`): You can send HTML inside of a string.&#x20;
  * If you choose to invite the user to claim their profile, you can include a custom message to be included in the email notification sent to them.
* **user\_data** (`array` | `null`): An array storing profile and other related information to the user. For complete information about the fiels that relate to the user profile, please review [the Profile object](/resources/editor/the-profile-object.md).

#### Example Request Payload

```json
{
    "unique_identifier": {
        "identifier_type":0, //Email address
        "unique_custom_field": "" 
    },
    "invite_user_to_vome": true,
    "invite_language": 'EN',
    "invite_message": '<p>We cannot wait for you to claim your profile!</p>',
    "volunteers_data": [
        {
            "emergency_contact": {
                "name": "Jon Smith",
                "phone_number": "5555555555",
                "relationship": "Father"
            },
            "medical_information": {
                "description": "Allergies to peanuts",
                "has_medical_info": "true"
            },
            "occupation_info":{
                "occupation":0, //Student
                "occupation_institution_name":"University of Memphis"
            },
            "profile_data": {
                "id":"d2fcbe43-1eba-419e-a489-3d471f7658ff",
                "first_name": "Lily",
                "last_name": "Smith",
                "email":"lily.smith123@domain.com",
                "phone_number": "555555555",
                "date_of_birth": "1998-06-06",
                "gender": 1, //Female
                "address": "7 Freedom Trail, Medway, Norfolk, MA, USA",
                "address_coordinates": [ 
                    "42.14579519999999",
                    "-71.4391298"
                ]
            },
            "custom_field_data": [
                {
                    "custom_field_id": "395fd06d-48ca-41a0-be0c-3cd22fdad976",
                    "custom_field_name": "Salesforce ID",
                    "custom_field_user_value": "fe8fwe7f7897487r87hb"
                },
                {
                    "custom_field_id": "78c03e94-097b-4f00-8aaa-6b7e4ddf1e93",
                    "custom_field_name": "T-shirt size",
                    "custom_field_user_value": "Medium"
                }

            ]
        }
    ]
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.vomevolunteer.com/resources/editor/write-operations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
