# `Twilio.Conversations.V1.Conversation.MessageService`
[🔗](https://github.com/jeffhuen/twilio_elixir/blob/main/lib/twilio/conversations/v1/conversation/message_service.ex#L2)

A Message resource represents a message in a conversation.

Operations: `list`, `create`, `fetch`, `update`, `delete`

# `create`

```elixir
@spec create(Twilio.Client.t(), String.t(), map(), keyword()) ::
  {:ok, Twilio.Resources.Conversations.V1.Conversation.Message.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}
```

Add a new message to the conversation

Operation: `CreateConversationMessage` | Tags: ConversationsV1Message

## Optional Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `Attributes` | string | A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified.  **Note** that if the attributes are not set "{}" will be returned. |
| `Author` | string | The channel specific identifier of the message's author. Defaults to `system`. |
| `Body` | string | The content of the message, can be up to 1,600 characters long. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `ContentSid` | string | The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages.  **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `ContentVariables` | string | A structurally valid JSON string that contains values to resolve Rich Content template variables. |
| `DateCreated` | string (date-time) | The date that this resource was created. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `DateUpdated` | string (date-time) | The date that this resource was last updated. `null` if the message has not been edited. |
| `MediaSid` | string | The Media SID to be attached to the new Message. |
| `Subject` | string | The subject of the message, can be up to 256 characters long. |

# `delete`

```elixir
@spec delete(Twilio.Client.t(), String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:ok, map(), map()} | :ok | {:error, Twilio.Error.t()}
```

Remove a message from the conversation

Operation: `DeleteConversationMessage` | Tags: ConversationsV1Message

# `fetch`

```elixir
@spec fetch(Twilio.Client.t(), String.t(), String.t(), keyword()) ::
  {:ok, Twilio.Resources.Conversations.V1.Conversation.Message.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}
```

Fetch a message from the conversation

Operation: `FetchConversationMessage` | Tags: ConversationsV1Message

# `list`

```elixir
@spec list(Twilio.Client.t(), String.t(), map(), keyword()) ::
  {:ok, Twilio.Page.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}
```

Retrieve a list of all messages in the conversation

Operation: `ListConversationMessage` | Tags: ConversationsV1Message

## Query Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `Order` | string | The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. |

# `stream`

```elixir
@spec stream(Twilio.Client.t(), String.t(), map(), keyword()) :: Enumerable.t()
```

Stream: Retrieve a list of all messages in the conversation (lazy auto-pagination).

# `update`

```elixir
@spec update(Twilio.Client.t(), String.t(), String.t(), map(), keyword()) ::
  {:ok, Twilio.Resources.Conversations.V1.Conversation.Message.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}
```

Update an existing message in the conversation

Operation: `UpdateConversationMessage` | Tags: ConversationsV1Message

## Optional Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `Attributes` | string | A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified.  **Note** that if the attributes are not set "{}" will be returned. |
| `Author` | string | The channel specific identifier of the message's author. Defaults to `system`. |
| `Body` | string | The content of the message, can be up to 1,600 characters long. |
| `DateCreated` | string (date-time) | The date that this resource was created. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `DateUpdated` | string (date-time) | The date that this resource was last updated. `null` if the message has not been edited. |
| `Subject` | string | The subject of the message, can be up to 256 characters long. |

---

*Consult [api-reference.md](api-reference.md) for complete listing*
