# Service-Scoped Conversation Message Resource

Use the Service-scoped Conversation Message resource to interact with messages in Conversations that belong to a **non-default,** [service-scoped Conversation](/docs/conversations/api/service-conversation-resource) resource.

Please see the [Conversation Message Resource API Reference page](/docs/conversations/api/conversation-message-resource) for Messages that belong to Conversations in the default [Conversation Service](/docs/conversations/api/service-resource).

## API Base URL

All URLs in the reference documentation use the following base URL:

```bash
https://conversations.twilio.com/v1

```

For Conversations applications that build on more than one Conversation Service instance, you will need to specify the Conversation Service SID in the REST API call:

```bash
GET /v1/Services/ISxx/Conversations/CHxx/Messages

```

## Service-Scoped Conversation Message Properties

```json
{"type":"object","refName":"conversations.v1.service.service_conversation.service_conversation_message","modelName":"conversations_v1_service_service_conversation_service_conversation_message","properties":{"account_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^AC[0-9a-fA-F]{32}$","nullable":true,"description":"The unique ID of the [Account](/docs/iam/api/account) responsible for this message."},"chat_service_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^IS[0-9a-fA-F]{32}$","nullable":true,"description":"The SID of the [Conversation Service](/docs/conversations/api/service-resource) the Participant resource is associated with."},"conversation_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^CH[0-9a-fA-F]{32}$","nullable":true,"description":"The unique ID of the [Conversation](/docs/conversations/api/conversation-resource) for this message."},"sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^IM[0-9a-fA-F]{32}$","nullable":true,"description":"A 34 character string that uniquely identifies this resource."},"index":{"type":"integer","default":0,"description":"The index of the message within the [Conversation](/docs/conversations/api/conversation-resource)."},"author":{"type":"string","nullable":true,"description":"The channel specific identifier of the message's author. Defaults to `system`.","x-twilio":{"pii":{"handling":"standard","deleteSla":30}}},"body":{"type":"string","nullable":true,"description":"The content of the message, can be up to 1,600 characters long.","x-twilio":{"pii":{"handling":"sensitive","deleteSla":30}}},"media":{"type":"array","nullable":true,"description":"An array of objects that describe the Message's media, if the message contains media. Each object contains these fields: `content_type` with the MIME type of the media, `filename` with the name of the media, `sid` with the SID of the Media resource, and `size` with the media object's file size in bytes. If the Message has no media, this value is `null`.","x-twilio":{"pii":{"handling":"standard","deleteSla":30}}},"attributes":{"type":"string","nullable":true,"description":"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.","x-twilio":{"pii":{"handling":"sensitive","deleteSla":30}}},"participant_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^MB[0-9a-fA-F]{32}$","nullable":true,"description":"The unique ID of messages's author participant. Null in case of `system` sent message."},"date_created":{"type":"string","format":"date-time","nullable":true,"description":"The date that this resource was created."},"date_updated":{"type":"string","format":"date-time","nullable":true,"description":"The date that this resource was last updated. `null` if the message has not been edited."},"delivery":{"nullable":true,"description":"An object that contains the summary of delivery statuses for the message to non-chat participants."},"url":{"type":"string","format":"uri","nullable":true,"description":"An absolute API resource URL for this message."},"links":{"type":"object","format":"uri-map","nullable":true,"description":"Contains an absolute API resource URL to access the delivery & read receipts of this message."},"content_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^HX[0-9a-fA-F]{32}$","nullable":true,"description":"The unique ID of the multi-channel [Rich Content](/docs/content) template."}}}
```

## Create a Service-Scoped Conversation Message resource

`POST https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Conversations/{ConversationSid}/Messages`

### Headers

```json
[{"name":"X-Twilio-Webhook-Enabled","in":"header","description":"The X-Twilio-Webhook-Enabled HTTP request header","schema":{"type":"string","enum":["true","false"],"refName":"service_conversation_message_enum_webhook_enabled_type","modelName":"service_conversation_message_enum_webhook_enabled_type"}}]
```

### Path parameters

```json
[{"name":"ChatServiceSid","in":"path","description":"The SID of the [Conversation Service](/docs/conversations/api/service-resource) the Participant resource is associated with.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^IS[0-9a-fA-F]{32}$"},"required":true},{"name":"ConversationSid","in":"path","description":"The unique ID of the [Conversation](/docs/conversations/api/conversation-resource) for this message.","schema":{"type":"string"},"required":true}]
```

### Request body parameters

```json
{"schema":{"type":"object","title":"CreateServiceConversationMessageRequest","properties":{"Author":{"type":"string","description":"The channel specific identifier of the message's author. Defaults to `system`.","x-twilio":{"pii":{"handling":"standard","deleteSla":30}}},"Body":{"type":"string","description":"The content of the message, can be up to 1,600 characters long.","x-twilio":{"pii":{"handling":"sensitive","deleteSla":30}}},"DateCreated":{"type":"string","format":"date-time","description":"The date that this resource was created."},"DateUpdated":{"type":"string","format":"date-time","description":"The date that this resource was last updated. `null` if the message has not been edited."},"Attributes":{"type":"string","description":"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.","x-twilio":{"pii":{"handling":"sensitive","deleteSla":30}}},"MediaSid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^ME[0-9a-fA-F]{32}$","description":"The Media SID to be attached to the new Message."},"ContentSid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^HX[0-9a-fA-F]{32}$","description":"The unique ID of the multi-channel [Rich Content](/docs/content) template, required for template-generated messages.  **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored."},"ContentVariables":{"type":"string","description":"A structurally valid JSON string that contains values to resolve Rich Content template variables."},"Subject":{"type":"string","description":"The subject of the message, can be up to 256 characters long."}}},"examples":{"create":{"value":{"lang":"json","value":"{\n  \"Body\": \"Hello\",\n  \"Author\": \"message author\",\n  \"Attributes\": \"{ \\\"importance\\\": \\\"high\\\" }\",\n  \"DateCreated\": \"2015-12-16T22:18:37Z\",\n  \"DateUpdated\": \"2015-12-16T22:18:38Z\"\n}","meta":"","code":"{\n  \"Body\": \"Hello\",\n  \"Author\": \"message author\",\n  \"Attributes\": \"{ \\\"importance\\\": \\\"high\\\" }\",\n  \"DateCreated\": \"2015-12-16T22:18:37Z\",\n  \"DateUpdated\": \"2015-12-16T22:18:38Z\"\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"Body\"","#7EE787"],[":","#C9D1D9"]," ",["\"Hello\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Author\"","#7EE787"],[":","#C9D1D9"]," ",["\"message author\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Attributes\"","#7EE787"],[":","#C9D1D9"]," ",["\"{","#A5D6FF"]," ",["\\\"","#79C0FF"],["importance","#A5D6FF"],["\\\"","#79C0FF"],[":","#A5D6FF"]," ",["\\\"","#79C0FF"],["high","#A5D6FF"],["\\\"","#79C0FF"]," ",["}\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"DateCreated\"","#7EE787"],[":","#C9D1D9"]," ",["\"2015-12-16T22:18:37Z\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"DateUpdated\"","#7EE787"],[":","#C9D1D9"]," ",["\"2015-12-16T22:18:38Z\"","#A5D6FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}},"createWithMedia":{"value":{"lang":"json","value":"{\n  \"MediaSid\": \"MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n  \"Author\": \"message author\",\n  \"Attributes\": \"{ \\\"importance\\\": \\\"high\\\" }\",\n  \"DateCreated\": \"2015-12-16T22:18:37Z\",\n  \"DateUpdated\": \"2015-12-16T22:18:38Z\"\n}","meta":"","code":"{\n  \"MediaSid\": \"MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n  \"Author\": \"message author\",\n  \"Attributes\": \"{ \\\"importance\\\": \\\"high\\\" }\",\n  \"DateCreated\": \"2015-12-16T22:18:37Z\",\n  \"DateUpdated\": \"2015-12-16T22:18:38Z\"\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"MediaSid\"","#7EE787"],[":","#C9D1D9"]," ",["\"MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Author\"","#7EE787"],[":","#C9D1D9"]," ",["\"message author\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Attributes\"","#7EE787"],[":","#C9D1D9"]," ",["\"{","#A5D6FF"]," ",["\\\"","#79C0FF"],["importance","#A5D6FF"],["\\\"","#79C0FF"],[":","#A5D6FF"]," ",["\\\"","#79C0FF"],["high","#A5D6FF"],["\\\"","#79C0FF"]," ",["}\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"DateCreated\"","#7EE787"],[":","#C9D1D9"]," ",["\"2015-12-16T22:18:37Z\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"DateUpdated\"","#7EE787"],[":","#C9D1D9"]," ",["\"2015-12-16T22:18:38Z\"","#A5D6FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}},"createNoAttributes":{"value":{"lang":"json","value":"{\n  \"Body\": \"Hello\",\n  \"Author\": \"message author\",\n  \"DateCreated\": \"2020-07-01T22:18:37Z\",\n  \"DateUpdated\": \"2020-07-01T22:18:37Z\"\n}","meta":"","code":"{\n  \"Body\": \"Hello\",\n  \"Author\": \"message author\",\n  \"DateCreated\": \"2020-07-01T22:18:37Z\",\n  \"DateUpdated\": \"2020-07-01T22:18:37Z\"\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"Body\"","#7EE787"],[":","#C9D1D9"]," ",["\"Hello\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Author\"","#7EE787"],[":","#C9D1D9"]," ",["\"message author\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"DateCreated\"","#7EE787"],[":","#C9D1D9"]," ",["\"2020-07-01T22:18:37Z\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"DateUpdated\"","#7EE787"],[":","#C9D1D9"]," ",["\"2020-07-01T22:18:37Z\"","#A5D6FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}},"createWithContentSid":{"value":{"lang":"json","value":"{\n  \"Author\": \"message author\",\n  \"DateCreated\": \"2015-12-16T22:18:37Z\",\n  \"DateUpdated\": \"2015-12-16T22:18:38Z\",\n  \"ContentSid\": \"HXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n  \"ContentVariables\": \"{\\\"name\\\": \\\"John\\\"}\"\n}","meta":"","code":"{\n  \"Author\": \"message author\",\n  \"DateCreated\": \"2015-12-16T22:18:37Z\",\n  \"DateUpdated\": \"2015-12-16T22:18:38Z\",\n  \"ContentSid\": \"HXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n  \"ContentVariables\": \"{\\\"name\\\": \\\"John\\\"}\"\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"Author\"","#7EE787"],[":","#C9D1D9"]," ",["\"message author\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"DateCreated\"","#7EE787"],[":","#C9D1D9"]," ",["\"2015-12-16T22:18:37Z\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"DateUpdated\"","#7EE787"],[":","#C9D1D9"]," ",["\"2015-12-16T22:18:38Z\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"ContentSid\"","#7EE787"],[":","#C9D1D9"]," ",["\"HXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"ContentVariables\"","#7EE787"],[":","#C9D1D9"]," ",["\"{","#A5D6FF"],["\\\"","#79C0FF"],["name","#A5D6FF"],["\\\"","#79C0FF"],[":","#A5D6FF"]," ",["\\\"","#79C0FF"],["John","#A5D6FF"],["\\\"","#79C0FF"],["}\"","#A5D6FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}},"createWithSubject":{"value":{"lang":"json","value":"{\n  \"Author\": \"message author\",\n  \"Body\": \"message body\",\n  \"DateCreated\": \"2015-12-16T22:18:37Z\",\n  \"DateUpdated\": \"2015-12-16T22:18:38Z\",\n  \"Subject\": \"message subject\"\n}","meta":"","code":"{\n  \"Author\": \"message author\",\n  \"Body\": \"message body\",\n  \"DateCreated\": \"2015-12-16T22:18:37Z\",\n  \"DateUpdated\": \"2015-12-16T22:18:38Z\",\n  \"Subject\": \"message subject\"\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"Author\"","#7EE787"],[":","#C9D1D9"]," ",["\"message author\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Body\"","#7EE787"],[":","#C9D1D9"]," ",["\"message body\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"DateCreated\"","#7EE787"],[":","#C9D1D9"]," ",["\"2015-12-16T22:18:37Z\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"DateUpdated\"","#7EE787"],[":","#C9D1D9"]," ",["\"2015-12-16T22:18:38Z\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Subject\"","#7EE787"],[":","#C9D1D9"]," ",["\"message subject\"","#A5D6FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}}},"encodingType":"application/x-www-form-urlencoded","conditionalParameterMap":{}}
```

Create a Message

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function createServiceConversationMessage() {
  const message = await client.conversations.v1
    .services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .conversations("ConversationSid")
    .messages.create();

  console.log(message.accountSid);
}

createServiceConversationMessage();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

message = (
    client.conversations.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .conversations("ConversationSid")
    .messages.create()
)

print(message.account_sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Conversations.V1.Service.Conversation;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var message = await MessageResource.CreateAsync(
            pathChatServiceSid: "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            pathConversationSid: "ConversationSid");

        Console.WriteLine(message.AccountSid);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.conversations.v1.service.conversation.Message;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Message message = Message.creator("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "ConversationSid").create();

        System.out.println(message.getAccountSid());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	conversations "github.com/twilio/twilio-go/rest/conversations/v1"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &conversations.CreateServiceConversationMessageParams{}

	resp, err := client.ConversationsV1.CreateServiceConversationMessage("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
		"ConversationSid",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.AccountSid != nil {
			fmt.Println(*resp.AccountSid)
		} else {
			fmt.Println(resp.AccountSid)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$message = $twilio->conversations->v1
    ->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->conversations("ConversationSid")
    ->messages->create();

print $message->accountSid;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

message = @client
          .conversations
          .v1
          .services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
          .conversations('ConversationSid')
          .messages
          .create

puts message.account_sid
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:conversations:v1:services:conversations:messages:create \
   --chat-service-sid ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \
   --conversation-sid ConversationSid
```

```bash
curl -X POST "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/ConversationSid/Messages" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "conversation_sid": "ConversationSid",
  "body": "Hello",
  "media": null,
  "author": "message author",
  "participant_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "attributes": "{ \"importance\": \"high\" }",
  "date_created": "2015-12-16T22:18:37Z",
  "date_updated": "2015-12-16T22:18:38Z",
  "index": 0,
  "delivery": {
    "total": 2,
    "sent": "all",
    "delivered": "some",
    "read": "some",
    "failed": "none",
    "undelivered": "none"
  },
  "content_sid": null,
  "url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "links": {
    "delivery_receipts": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Receipts",
    "channel_metadata": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelMetadata"
  }
}
```

## Fetch a Service-Scoped Conversation Message resource

`GET https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Conversations/{ConversationSid}/Messages/{Sid}`

### Path parameters

```json
[{"name":"ChatServiceSid","in":"path","description":"The SID of the [Conversation Service](/docs/conversations/api/service-resource) the Participant resource is associated with.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^IS[0-9a-fA-F]{32}$"},"required":true},{"name":"ConversationSid","in":"path","description":"The unique ID of the [Conversation](/docs/conversations/api/conversation-resource) for this message.","schema":{"type":"string"},"required":true},{"name":"Sid","in":"path","description":"A 34 character string that uniquely identifies this resource.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^IM[0-9a-fA-F]{32}$"},"required":true}]
```

Fetch a Message

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function fetchServiceConversationMessage() {
  const message = await client.conversations.v1
    .services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .conversations("ConversationSid")
    .messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .fetch();

  console.log(message.accountSid);
}

fetchServiceConversationMessage();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

message = (
    client.conversations.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .conversations("ConversationSid")
    .messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .fetch()
)

print(message.account_sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Conversations.V1.Service.Conversation;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var message = await MessageResource.FetchAsync(
            pathChatServiceSid: "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            pathConversationSid: "ConversationSid",
            pathSid: "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");

        Console.WriteLine(message.AccountSid);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.conversations.v1.service.conversation.Message;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Message message =
            Message
                .fetcher("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "ConversationSid", "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
                .fetch();

        System.out.println(message.getAccountSid());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	resp, err := client.ConversationsV1.FetchServiceConversationMessage("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
		"ConversationSid",
		"IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.AccountSid != nil {
			fmt.Println(*resp.AccountSid)
		} else {
			fmt.Println(resp.AccountSid)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$message = $twilio->conversations->v1
    ->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->conversations("ConversationSid")
    ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->fetch();

print $message->accountSid;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

message = @client
          .conversations
          .v1
          .services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
          .conversations('ConversationSid')
          .messages('IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
          .fetch

puts message.account_sid
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:conversations:v1:services:conversations:messages:fetch \
   --chat-service-sid ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \
   --conversation-sid ConversationSid \
   --sid IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
```

```bash
curl -X GET "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/ConversationSid/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "conversation_sid": "ConversationSid",
  "body": "Welcome!",
  "media": null,
  "author": "system",
  "participant_sid": null,
  "attributes": "{ \"importance\": \"high\" }",
  "date_created": "2016-03-24T20:37:57Z",
  "date_updated": "2016-03-24T20:37:57Z",
  "index": 0,
  "delivery": {
    "total": 2,
    "sent": "all",
    "delivered": "some",
    "read": "some",
    "failed": "none",
    "undelivered": "none"
  },
  "content_sid": null,
  "url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "links": {
    "delivery_receipts": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Receipts",
    "channel_metadata": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelMetadata"
  }
}
```

## Read all Service-Scoped Conversation Message resources

`GET https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Conversations/{ConversationSid}/Messages`

### Path parameters

```json
[{"name":"ChatServiceSid","in":"path","description":"The SID of the [Conversation Service](/docs/conversations/api/service-resource) the Participant resource is associated with.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^IS[0-9a-fA-F]{32}$"},"required":true},{"name":"ConversationSid","in":"path","description":"The unique ID of the [Conversation](/docs/conversations/api/conversation-resource) for messages.","schema":{"type":"string"},"required":true}]
```

### Query parameters

```json
[{"name":"Order","in":"query","description":"The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default.","schema":{"type":"string","enum":["asc","desc"],"refName":"service_conversation_message_enum_order_type","modelName":"service_conversation_message_enum_order_type"},"examples":{"readLastMessage":{"value":"desc"},"readFullOrderAscMixedAsc":{"value":"AsC"},"readFullOrderDescMixedDesc":{"value":"DesC"}}},{"name":"PageSize","in":"query","description":"How many resources to return in each list page. The default is 50, and the maximum is 100.","schema":{"type":"integer","format":"int64","minimum":1,"maximum":100}},{"name":"Page","in":"query","description":"The page index. This value is simply for client state.","schema":{"type":"integer","minimum":0}},{"name":"PageToken","in":"query","description":"The page token. This is provided by the API.","schema":{"type":"string"}}]
```

List multiple Messages

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function listServiceConversationMessage() {
  const messages = await client.conversations.v1
    .services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .conversations("ConversationSid")
    .messages.list({ limit: 20 });

  messages.forEach((m) => console.log(m.accountSid));
}

listServiceConversationMessage();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

messages = (
    client.conversations.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .conversations("ConversationSid")
    .messages.list(limit=20)
)

for record in messages:
    print(record.account_sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Conversations.V1.Service.Conversation;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var messages = await MessageResource.ReadAsync(
            pathChatServiceSid: "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            pathConversationSid: "ConversationSid",
            limit: 20);

        foreach (var record in messages) {
            Console.WriteLine(record.AccountSid);
        }
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.conversations.v1.service.conversation.Message;
import com.twilio.base.ResourceSet;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        ResourceSet<Message> messages =
            Message.reader("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "ConversationSid").limit(20).read();

        for (Message record : messages) {
            System.out.println(record.getAccountSid());
        }
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	conversations "github.com/twilio/twilio-go/rest/conversations/v1"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &conversations.ListServiceConversationMessageParams{}
	params.SetLimit(20)

	resp, err := client.ConversationsV1.ListServiceConversationMessage("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
		"ConversationSid",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		for record := range resp {
			if resp[record].AccountSid != nil {
				fmt.Println(*resp[record].AccountSid)
			} else {
				fmt.Println(resp[record].AccountSid)
			}
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$messages = $twilio->conversations->v1
    ->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->conversations("ConversationSid")
    ->messages->read([], 20);

foreach ($messages as $record) {
    print $record->accountSid;
}
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

messages = @client
           .conversations
           .v1
           .services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
           .conversations('ConversationSid')
           .messages
           .list(limit: 20)

messages.each do |record|
   puts record.account_sid
end
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:conversations:v1:services:conversations:messages:list \
   --chat-service-sid ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \
   --conversation-sid ConversationSid
```

```bash
curl -X GET "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/ConversationSid/Messages?PageSize=20" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "meta": {
    "page": 0,
    "page_size": 50,
    "first_page_url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages?PageSize=50&Page=0",
    "previous_page_url": null,
    "url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages?PageSize=50&Page=0",
    "next_page_url": null,
    "key": "messages"
  },
  "messages": [
    {
      "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "body": "I like pie.",
      "media": null,
      "author": "pie_preferrer",
      "participant_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "attributes": "{ \"importance\": \"high\" }",
      "date_created": "2016-03-24T20:37:57Z",
      "date_updated": "2016-03-24T20:37:57Z",
      "index": 0,
      "delivery": {
        "total": 2,
        "sent": "all",
        "delivered": "some",
        "read": "some",
        "failed": "none",
        "undelivered": "none"
      },
      "content_sid": null,
      "url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "links": {
        "delivery_receipts": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Receipts",
        "channel_metadata": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelMetadata"
      }
    },
    {
      "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "body": "Cake is my favorite!",
      "media": null,
      "author": "cake_lover",
      "participant_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "attributes": "{ \"importance\": \"high\" }",
      "date_created": "2016-03-24T20:38:21Z",
      "date_updated": "2016-03-24T20:38:21Z",
      "index": 0,
      "delivery": {
        "total": 2,
        "sent": "all",
        "delivered": "some",
        "read": "some",
        "failed": "none",
        "undelivered": "none"
      },
      "content_sid": null,
      "url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "links": {
        "delivery_receipts": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Receipts",
        "channel_metadata": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelMetadata"
      }
    },
    {
      "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "body": null,
      "media": [
        {
          "sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "size": 42056,
          "content_type": "image/jpeg",
          "filename": "car.jpg"
        }
      ],
      "author": "cake_lover",
      "participant_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "attributes": "{ \"importance\": \"high\" }",
      "date_created": "2016-03-24T20:38:21Z",
      "date_updated": "2016-03-24T20:38:21Z",
      "index": 0,
      "delivery": {
        "total": 2,
        "sent": "all",
        "delivered": "some",
        "read": "some",
        "failed": "none",
        "undelivered": "none"
      },
      "content_sid": null,
      "url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "links": {
        "delivery_receipts": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Receipts",
        "channel_metadata": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelMetadata"
      }
    }
  ]
}
```

## Update a Service-Scoped Conversation Message resource

`POST https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Conversations/{ConversationSid}/Messages/{Sid}`

### Headers

```json
[{"name":"X-Twilio-Webhook-Enabled","in":"header","description":"The X-Twilio-Webhook-Enabled HTTP request header","schema":{"type":"string","enum":["true","false"],"refName":"service_conversation_message_enum_webhook_enabled_type","modelName":"service_conversation_message_enum_webhook_enabled_type"}}]
```

### Path parameters

```json
[{"name":"ChatServiceSid","in":"path","description":"The SID of the [Conversation Service](/docs/conversations/api/service-resource) the Participant resource is associated with.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^IS[0-9a-fA-F]{32}$"},"required":true},{"name":"ConversationSid","in":"path","description":"The unique ID of the [Conversation](/docs/conversations/api/conversation-resource) for this message.","schema":{"type":"string"},"required":true},{"name":"Sid","in":"path","description":"A 34 character string that uniquely identifies this resource.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^IM[0-9a-fA-F]{32}$"},"required":true}]
```

### Request body parameters

```json
{"schema":{"type":"object","title":"UpdateServiceConversationMessageRequest","properties":{"Author":{"type":"string","description":"The channel specific identifier of the message's author. Defaults to `system`.","x-twilio":{"pii":{"handling":"standard","deleteSla":30}}},"Body":{"type":"string","description":"The content of the message, can be up to 1,600 characters long.","x-twilio":{"pii":{"handling":"sensitive","deleteSla":30}}},"DateCreated":{"type":"string","format":"date-time","description":"The date that this resource was created."},"DateUpdated":{"type":"string","format":"date-time","description":"The date that this resource was last updated. `null` if the message has not been edited."},"Attributes":{"type":"string","description":"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.","x-twilio":{"pii":{"handling":"sensitive","deleteSla":30}}},"Subject":{"type":"string","description":"The subject of the message, can be up to 256 characters long."}}},"examples":{"update":{"value":{"lang":"json","value":"{\n  \"Body\": \"Hello\",\n  \"Author\": \"message author\",\n  \"Attributes\": \"{ \\\"importance\\\": \\\"high\\\" }\",\n  \"DateCreated\": \"2015-12-16T22:18:37Z\",\n  \"DateUpdated\": \"2015-12-16T22:18:38Z\"\n}","meta":"","code":"{\n  \"Body\": \"Hello\",\n  \"Author\": \"message author\",\n  \"Attributes\": \"{ \\\"importance\\\": \\\"high\\\" }\",\n  \"DateCreated\": \"2015-12-16T22:18:37Z\",\n  \"DateUpdated\": \"2015-12-16T22:18:38Z\"\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"Body\"","#7EE787"],[":","#C9D1D9"]," ",["\"Hello\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Author\"","#7EE787"],[":","#C9D1D9"]," ",["\"message author\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Attributes\"","#7EE787"],[":","#C9D1D9"]," ",["\"{","#A5D6FF"]," ",["\\\"","#79C0FF"],["importance","#A5D6FF"],["\\\"","#79C0FF"],[":","#A5D6FF"]," ",["\\\"","#79C0FF"],["high","#A5D6FF"],["\\\"","#79C0FF"]," ",["}\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"DateCreated\"","#7EE787"],[":","#C9D1D9"]," ",["\"2015-12-16T22:18:37Z\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"DateUpdated\"","#7EE787"],[":","#C9D1D9"]," ",["\"2015-12-16T22:18:38Z\"","#A5D6FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}}},"encodingType":"application/x-www-form-urlencoded","conditionalParameterMap":{}}
```

Update a Message

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function updateServiceConversationMessage() {
  const message = await client.conversations.v1
    .services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .conversations("ConversationSid")
    .messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .update({ author: "Author" });

  console.log(message.accountSid);
}

updateServiceConversationMessage();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

service_conversation_message = (
    client.conversations.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .conversations("ConversationSid")
    .messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .update(author="Author")
)

print(service_conversation_message.account_sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Conversations.V1.Service.Conversation;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var message = await MessageResource.UpdateAsync(
            author: "Author",
            pathChatServiceSid: "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            pathConversationSid: "ConversationSid",
            pathSid: "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");

        Console.WriteLine(message.AccountSid);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.conversations.v1.service.conversation.Message;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Message message =
            Message
                .updater("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "ConversationSid", "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
                .setAuthor("Author")
                .update();

        System.out.println(message.getAccountSid());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	conversations "github.com/twilio/twilio-go/rest/conversations/v1"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &conversations.UpdateServiceConversationMessageParams{}
	params.SetAuthor("Author")

	resp, err := client.ConversationsV1.UpdateServiceConversationMessage("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
		"ConversationSid",
		"IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.AccountSid != nil {
			fmt.Println(*resp.AccountSid)
		} else {
			fmt.Println(resp.AccountSid)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$service_conversation_message = $twilio->conversations->v1
    ->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->conversations("ConversationSid")
    ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->update(["author" => "Author"]);

print $service_conversation_message->accountSid;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

message = @client
          .conversations
          .v1
          .services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
          .conversations('ConversationSid')
          .messages('IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
          .update(author: 'Author')

puts message.account_sid
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:conversations:v1:services:conversations:messages:update \
   --chat-service-sid ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \
   --conversation-sid ConversationSid \
   --sid IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \
   --author Author
```

```bash
curl -X POST "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/ConversationSid/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
--data-urlencode "Author=Author" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "conversation_sid": "ConversationSid",
  "body": "Hello",
  "media": null,
  "author": "Author",
  "participant_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "attributes": "{ \"importance\": \"high\" }",
  "date_created": "2015-12-16T22:18:37Z",
  "date_updated": "2015-12-16T22:18:38Z",
  "index": 0,
  "delivery": {
    "total": 2,
    "sent": "all",
    "delivered": "some",
    "read": "some",
    "failed": "none",
    "undelivered": "none"
  },
  "content_sid": null,
  "url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "links": {
    "delivery_receipts": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Receipts",
    "channel_metadata": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelMetadata"
  }
}
```

## Delete a Service-Scoped Conversation Message resource

`DELETE https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Conversations/{ConversationSid}/Messages/{Sid}`

### Headers

```json
[{"name":"X-Twilio-Webhook-Enabled","in":"header","description":"The X-Twilio-Webhook-Enabled HTTP request header","schema":{"type":"string","enum":["true","false"],"refName":"service_conversation_message_enum_webhook_enabled_type","modelName":"service_conversation_message_enum_webhook_enabled_type"}}]
```

### Path parameters

```json
[{"name":"ChatServiceSid","in":"path","description":"The SID of the [Conversation Service](/docs/conversations/api/service-resource) the Participant resource is associated with.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^IS[0-9a-fA-F]{32}$"},"required":true},{"name":"ConversationSid","in":"path","description":"The unique ID of the [Conversation](/docs/conversations/api/conversation-resource) for this message.","schema":{"type":"string"},"required":true},{"name":"Sid","in":"path","description":"A 34 character string that uniquely identifies this resource.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^IM[0-9a-fA-F]{32}$"},"required":true}]
```

Delete a Message

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function deleteServiceConversationMessage() {
  await client.conversations.v1
    .services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .conversations("ConversationSid")
    .messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .remove();
}

deleteServiceConversationMessage();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

client.conversations.v1.services(
    "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
).conversations("ConversationSid").messages(
    "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
).delete()
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Conversations.V1.Service.Conversation;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        await MessageResource.DeleteAsync(
            pathChatServiceSid: "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            pathConversationSid: "ConversationSid",
            pathSid: "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.conversations.v1.service.conversation.Message;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Message.deleter("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "ConversationSid", "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
            .delete();
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	conversations "github.com/twilio/twilio-go/rest/conversations/v1"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &conversations.DeleteServiceConversationMessageParams{}

	err := client.ConversationsV1.DeleteServiceConversationMessage("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
		"ConversationSid",
		"IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$twilio->conversations->v1
    ->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->conversations("ConversationSid")
    ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->delete();
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

@client
  .conversations
  .v1
  .services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
  .conversations('ConversationSid')
  .messages('IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
  .delete
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:conversations:v1:services:conversations:messages:remove \
   --chat-service-sid ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \
   --conversation-sid ConversationSid \
   --sid IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
```

```bash
curl -X DELETE "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/ConversationSid/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```
