> ## 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 Message Thread

> Documentation for the Create Message Thread action for Elation

![images/elation.svg](https://mintcdn.com/morfhealth/EU2WCxuXGIUQcziR/images/elation.svg?fit=max\&auto=format\&n=EU2WCxuXGIUQcziR\&q=85\&s=06d58e76eb0b3a5e191b8fc13f4ba68a)

# Parameters

**Action** `Parameters`

**parameters**

**Is Urgent** `bool`

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

**User Members** `[]int64`

`ID`
This field maps to the destination API `members[].user` field.

**Group Members** `[]int64`

`ID`
This field maps to the destination API `members[].group` field.

**Body** `string` *required*

`HI`
This field maps to the destination API `body` field.

**Sender** `int64 (User)` *required*

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

**Patient ID** `string`

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

**Practice** `int64 (Practice)` *required*

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

**Chart Date** `timing.v1.Timestamp` *required*

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

```json Result Object Example theme={null}
{
  "$result_object_key": {
    "added_to_chart_at": "2021-05-05T22:02:09Z",
    "created_at": "2021-05-05T22:02:10Z",
    "deleted_at": "",
    "id": "140754787631195",
    "is_urgent": false,
    "members": [
      {
        "acked_at": "",
        "group_id": "851981",
        "id": "346292316",
        "status": "THREAD_MEMBER_STATUS_ADDRESSED",
        "thread_id": "346226779",
        "user_id": "6"
      }
    ],
    "messages": [
      {
        "associated_document": {
          "added_to_chart_at": "2014-01-24T18:13:48Z",
          "authoring_practice_id": "65540",
          "created_at": "2014-01-24T18:13:48Z",
          "deleted_at": "",
          "document_timestamp": "2014-01-24T18:59:15Z",
          "document_type": 91,
          "id": "64077889627",
          "last_modified_at": "2016-05-02T18:53:12Z",
          "patient_id": "64072843265",
          "signed_at": "2014-01-24T18:13:48Z",
          "signed_by": "4"
        },
        "body": "Patient should have appointment already booked.",
        "id": "346423390",
        "patient_id": "342753281",
        "practice_id": "655364",
        "sender_id": "6",
        "sent_at": "2021-10-19T19:08:48",
        "thread_id": "346226779"
      }
    ],
    "patient_id": "140754786975745",
    "practice_id": "140754817318916",
    "thread_document_created_at": "2021-05-05T22:02:09Z"
  }
}
```

```json Result Object Description theme={null}
{
  "$result_object_key": {
    "added_to_chart_at": "Date and time when the thread was added to the patient's chart.",
    "created_at": "Timestamp when the message thread was created.",
    "deleted_at": "Timestamp when the message thread was deleted, if applicable.",
    "id": "Unique identifier for the message thread.",
    "is_urgent": "Flag indicating whether this thread is marked as urgent.",
    "members": {
      "acked_at": "Timestamp when the member acknowledged the thread, if applicable.",
      "group_id": "ID of the group, if this member represents a group.",
      "id": "Unique identifier for the thread member.",
      "status": "Current status of the member in this thread.",
      "thread_id": "ID of the thread this member belongs to.",
      "user_id": "ID of the user, if this member represents a user."
    },
    "messages": {
      "associated_document": {
        "added_to_chart_at": "Date and time when the document was added to the chart.",
        "authoring_practice_id": "ID of the practice that authored this document.",
        "created_at": "Timestamp when the document was created.",
        "deleted_at": "Timestamp when the document was deleted, if applicable.",
        "document_timestamp": "Date and time of the document.",
        "document_type": "Type identifier for the document.",
        "id": "Unique identifier for the document.",
        "last_modified_at": "Timestamp when the document was last modified.",
        "patient_id": "ID of the patient this document belongs to.",
        "signed_at": "Timestamp when the document was signed.",
        "signed_by": "ID of the user who signed the document."
      },
      "body": "Content of the message. Must not be empty.",
      "id": "Unique identifier for the message.",
      "patient_id": "ID of the patient this message relates to.",
      "practice_id": "ID of the practice this message belongs to.",
      "sender_id": "ID of the user who sent this message.",
      "sent_at": "Timestamp when the message was sent.",
      "thread_id": "ID of the thread this message belongs to."
    },
    "patient_id": "ID of the patient this thread belongs to.",
    "practice_id": "ID of the practice this thread belongs to.",
    "thread_document_created_at": "Date and time when the thread document was created."
  }
}
```

### 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`.

**MessageThread** `Fetch Action Response Object`

**fields**

**id** `string` *required*

Unique identifier for the message thread.

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

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

**created\_at** `timing.v1.Timestamp` *required*

Timestamp when the message thread was created.

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

```json Example theme={null}
"2021-05-05T22:02:10Z"
```

**deleted\_at** `timing.v1.Timestamp`

Timestamp when the message thread was deleted, if applicable.

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

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

**thread\_document\_created\_at** `timing.v1.Timestamp` *required*

Date and time when the thread document was created.

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

```json Example theme={null}
"2021-05-05T22:02:09Z"
```

**added\_to\_chart\_at** `timing.v1.Timestamp` *required*

Date and time when the thread was added to the patient's chart.

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

```json Example theme={null}
"2021-05-05T22:02:09Z"
```

**patient\_id** `string` *required*

`ID` ID of the patient this thread belongs to.

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

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

**practice\_id** `string` *required*

ID of the practice this thread belongs to.

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

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

**is\_urgent** `bool` *required*

Flag indicating whether this thread is marked as urgent.

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

```json Example theme={null}
false
```

**members** `[]object` *required*

List of members participating in this thread.

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

```json Example theme={null}
[
{
"acked_at": "",
"group_id": "851981",
"id": "346292316",
"status": "THREAD_MEMBER_STATUS_ADDRESSED",
"thread_id": "346226779",
"user_id": "6"
}
]
```

**members.map(x, x.id)** `[]string` *required*

`ID` Mapped array of: Unique identifier for the thread member.

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

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

**members.map(x, x.thread\_id)** `[]string` *required*

Mapped array of: ID of the thread this member belongs to.

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

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

**members.map(x, x.user\_id)** `[]string` *required*

`ID` Mapped array of: ID of the user, if this member represents a user.

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

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

**members.map(x, x.group\_id)** `[]string` *required*

Mapped array of: ID of the group, if this member represents a group.

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

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

**status** `elation.v1.ThreadMemberStatus` *required*

Mapped array of: Current status of the member in this thread.

```json CEL theme={null}
status
```

```json Example theme={null}
elation.v1.ThreadMemberStatus.THREAD_MEMBER_STATUS_ADDRESSED
elation.v1.ThreadMemberStatus.THREAD_MEMBER_STATUS_REQUIRING_ACTION
```

**members.map(x, x.acked\_at)** `[]timing.v1.Timestamp` *required*

Mapped array of: Timestamp when the member acknowledged the thread, if applicable.

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

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

**messages** `[]object` *required*

List of messages in this thread.

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

```json Example theme={null}
[
{
"associated_document": {
"added_to_chart_at": "2014-01-24T18:13:48Z",
"authoring_practice_id": "65540",
"created_at": "2014-01-24T18:13:48Z",
"deleted_at": "",
"document_timestamp": "2014-01-24T18:59:15Z",
"document_type": 91,
"id": "64077889627",
"last_modified_at": "2016-05-02T18:53:12Z",
"patient_id": "64072843265",
"signed_at": "2014-01-24T18:13:48Z",
"signed_by": "4"
},
"body": "Patient should have appointment already booked.",
"id": "346423390",
"patient_id": "342753281",
"practice_id": "655364",
"sender_id": "6",
"sent_at": "2021-10-19T19:08:48",
"thread_id": "346226779"
}
]
```

**messages.map(x, x.id)** `[]string` *required*

Mapped array of: Unique identifier for the message.

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

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

**messages.map(x, x.body)** `[]string` *required*

Mapped array of: Content of the message. Must not be empty.

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

```json Example theme={null}
[
"Patient should have appointment already booked."
]
```

**messages.map(x, x.patient\_id)** `[]string` *required*

`ID` Mapped array of: ID of the patient this message relates to.

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

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

**messages.map(x, x.practice\_id)** `[]string` *required*

Mapped array of: ID of the practice this message belongs to.

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

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

**messages.map(x, x.thread\_id)** `[]string` *required*

Mapped array of: ID of the thread this message belongs to.

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

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

**messages.map(x, x.sender\_id)** `[]string` *required*

`ID` Mapped array of: ID of the user who sent this message.

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

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

**messages.map(x, x.sent\_at)** `[]timing.v1.Timestamp` *required*

Mapped array of: Timestamp when the message was sent.

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

```json Example theme={null}
[
"2021-10-19T19:08:48"
]
```

**messages.map(x, x.associated\_document)** `[]bool` *required*

Mapped array of: Reference to the document this message is associated with, if any.

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

```json Example theme={null}
[
{
"added_to_chart_at": "2014-01-24T18:13:48Z",
"authoring_practice_id": "65540",
"created_at": "2014-01-24T18:13:48Z",
"deleted_at": "",
"document_timestamp": "2014-01-24T18:59:15Z",
"document_type": 91,
"id": "64077889627",
"last_modified_at": "2016-05-02T18:53:12Z",
"patient_id": "64072843265",
"signed_at": "2014-01-24T18:13:48Z",
"signed_by": "4"
}
]
```


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