> ## Documentation Index
> Fetch the complete documentation index at: https://docs.morf.health/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Or Update Contact

> Documentation for the Create Or Update Contact action for Open Phone

![images/open\_phone.svg](https://mintcdn.com/morfhealth/EU2WCxuXGIUQcziR/images/open_phone.svg?fit=max\&auto=format\&n=EU2WCxuXGIUQcziR\&q=85\&s=410b90111f612d86547e1b70dd6ca33e)

# Parameters

**Action** `Parameters`

**parameters**

**Contact ID** `string`

`ID`
This field maps to the destination API `id` field.

**First Name** `string`

`PII`
This field maps to the destination API `first_name` field.

**Last Name** `string`

`PII`
This field maps to the destination API `last_name` field.

**Company Name** `string`

`PII`
This field maps to the destination API `company` field.

**Role** `string`

This field maps to the destination API `role` field.

**Emails** `Map\<string,string\>`

`PII`

**Phone Numbers** `Map\<string,string\>`

`PII`

**Custom Fields** `Map\<Custom Field,dynamic (any)\>`

`HI` `ID` `PII`
This field maps to the destination API `customFields` field.

```json Result Object Example theme={null}
{
  "$result_object_key": {
    "created_by_user_id": "US123abc",
    "custom_fields": [
      {
        "key": "inbound-lead",
        "typed_value": "value1",
        "value": "value1"
      }
    ],
    "default_fields": {
      "company": "OpenPhone",
      "emails": [
        {
          "id": "email123",
          "name": "company email",
          "value": "abc@example.com"
        }
      ],
      "first_name": "John",
      "last_name": "Doe",
      "phone_numbers": [
        {
          "id": "phone123",
          "name": "company phone",
          "value": "+12345678901"
        }
      ],
      "role": "Sales"
    },
    "external_id": "664d0db69fcac7cf2e6ec",
    "id": "664d0db69fcac7cf2e6ec",
    "source": "public-api",
    "source_url": "https://openphone.co/contacts/664d0db69fcac7cf2e6ec"
  }
}
```

```json Result Object Description theme={null}
{
  "$result_object_key": {
    "created_by_user_id": "ID of the user who created the contact",
    "custom_fields": {
      "key": "Key for the custom field",
      "typed_value": {
        "bool_value": null,
        "list_value": {
          "values": null
        },
        "null_value": null,
        "number_value": null,
        "string_value": null,
        "struct_value": null
      },
      "value": "Values for the custom field, converted to a list of strings"
    },
    "default_fields": {
      "company": "Company name of the contact",
      "emails": {
        "id": "Unique identifier for the email field",
        "name": "Name of the email field",
        "value": "Email address"
      },
      "first_name": "First name of the contact",
      "last_name": "Last name of the contact",
      "phone_numbers": {
        "id": "Unique identifier for the phone number field",
        "name": "Name of the phone number field",
        "value": "Phone number"
      },
      "role": "Role of the contact"
    },
    "external_id": "Unique identifier from an external system",
    "id": "Unique identifier for the contact",
    "source": "Source of the contact",
    "source_url": "Link to the contact in the source system"
  }
}
```

### Result Object Field Details

You can use the result of the action's data as inputs to downstream workflow actions.

Each fetch action requires an object name, which nests the action's result data inside the downstream data context in the workflow. See [Passing Data Between Actions](https://docs.morf.health/docs/knowledge_base/passing_data_between_actions.md) for how to set it and reference the result from downstream nodes.

Here we demonstrate how to refer to this data using the prefix `$result_object_key`.

**Contact** `Fetch Action Response Object`

**fields**

**id** `string` *required*

Unique identifier for the contact

```json CEL theme={null}
$result_object_key.id
```

```json Example theme={null}
"664d0db69fcac7cf2e6ec"
```

**default\_fields** `object` *required*

Default fields for the contact

```json CEL theme={null}
$result_object_key.default_fields
```

```json Example theme={null}
{
"company": "OpenPhone",
"emails": [
{
"id": "email123",
"name": "company email",
"value": "abc@example.com"
}
],
"first_name": "John",
"last_name": "Doe",
"phone_numbers": [
{
"id": "phone123",
"name": "company phone",
"value": "+12345678901"
}
],
"role": "Sales"
}
```

**default\_fields.first\_name** `string`

First name of the contact

```json CEL theme={null}
$result_object_key.default_fields.first_name
```

```json Example theme={null}
"John"
```

**default\_fields.last\_name** `string`

Last name of the contact

```json CEL theme={null}
$result_object_key.default_fields.last_name
```

```json Example theme={null}
"Doe"
```

**default\_fields.company** `string`

Company name of the contact

```json CEL theme={null}
$result_object_key.default_fields.company
```

```json Example theme={null}
"OpenPhone"
```

**default\_fields.emails** `[]object` *required*

List of email addresses for the contact

```json CEL theme={null}
$result_object_key.default_fields.emails
```

```json Example theme={null}
[
{
"id": "email123",
"name": "company email",
"value": "abc@example.com"
}
]
```

**default\_fields.emails.map(x, x.id)** `[]string` *required*

Mapped array of: Unique identifier for the email field

```json CEL theme={null}
$result_object_key.default_fields.emails.map(x, x.id)
```

```json Example theme={null}
[
"email123"
]
```

**default\_fields.emails.map(x, x.name)** `[]string` *required*

Mapped array of: Name of the email field

```json CEL theme={null}
$result_object_key.default_fields.emails.map(x, x.name)
```

```json Example theme={null}
[
"company email"
]
```

**default\_fields.emails.map(x, x.value)** `[]string` *required*

Mapped array of: Email address

```json CEL theme={null}
$result_object_key.default_fields.emails.map(x, x.value)
```

```json Example theme={null}
[
"abc@example.com"
]
```

**default\_fields.phone\_numbers** `[]object` *required*

List of phone numbers for the contact

```json CEL theme={null}
$result_object_key.default_fields.phone_numbers
```

```json Example theme={null}
[
{
"id": "phone123",
"name": "company phone",
"value": "+12345678901"
}
]
```

**default\_fields.phone\_numbers.map(x, x.id)** `[]string` *required*

Mapped array of: Unique identifier for the phone number field

```json CEL theme={null}
$result_object_key.default_fields.phone_numbers.map(x, x.id)
```

```json Example theme={null}
[
"phone123"
]
```

**default\_fields.phone\_numbers.map(x, x.name)** `[]string` *required*

Mapped array of: Name of the phone number field

```json CEL theme={null}
$result_object_key.default_fields.phone_numbers.map(x, x.name)
```

```json Example theme={null}
[
"company phone"
]
```

**default\_fields.phone\_numbers.map(x, x.value)** `[]string` *required*

Mapped array of: Phone number

```json CEL theme={null}
$result_object_key.default_fields.phone_numbers.map(x, x.value)
```

```json Example theme={null}
[
"+12345678901"
]
```

**default\_fields.role** `string`

Role of the contact

```json CEL theme={null}
$result_object_key.default_fields.role
```

```json Example theme={null}
"Sales"
```

**custom\_fields** `[]object` *required*

List of custom fields for the contact

```json CEL theme={null}
$result_object_key.custom_fields
```

```json Example theme={null}
[
{
"key": "inbound-lead",
"typed_value": "value1",
"value": "value1"
}
]
```

**custom\_fields.map(x, x.key)** `[]string` *required*

Mapped array of: Key for the custom field

```json CEL theme={null}
$result_object_key.custom_fields.map(x, x.key)
```

```json Example theme={null}
[
"inbound-lead"
]
```

**custom\_fields.map(x, x.value)** `[]bool` *required*

Mapped array of: Values for the custom field, converted to a list of strings

```json CEL theme={null}
$result_object_key.custom_fields.map(x, x.value)
```

```json Example theme={null}
[
"value1"
]
```

**custom\_fields.map(x, x.typed\_value)** `[]bool` *required*

Mapped array of: Typed value for the custom field

```json CEL theme={null}
$result_object_key.custom_fields.map(x, x.typed_value)
```

```json Example theme={null}
[
"value1"
]
```

**typed\_value.null\_value** `google.protobuf.NullValue`

Mapped array of: Typed value for the custom field

```json CEL theme={null}
typed_value.null_value
```

**created\_by\_user\_id** `string`

ID of the user who created the contact

```json CEL theme={null}
$result_object_key.created_by_user_id
```

```json Example theme={null}
"US123abc"
```

**source** `string`

Source of the contact

```json CEL theme={null}
$result_object_key.source
```

```json Example theme={null}
"public-api"
```

**source\_url** `string`

Link to the contact in the source system

```json CEL theme={null}
$result_object_key.source_url
```

```json Example theme={null}
"https://openphone.co/contacts/664d0db69fcac7cf2e6ec"
```

**external\_id** `string`

Unique identifier from an external system

```json CEL theme={null}
$result_object_key.external_id
```

```json Example theme={null}
"664d0db69fcac7cf2e6ec"
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.