---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Conversation - Scoped

# Conversation - Scoped {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

The Conversation API enables you to create or modify Connect
conversations.

To use this class in a scoped application, use the `sn_connect` namespace
identifier. The Connect Scriptable APIs plugin (ID: com.glide.connect.scriptable) should be
enabled to access the Conversation API.

## Conversation - addSubscriber(String sysID) {#ariaid-title2}

Adds a user to a conversation.
{#conversation-addSubscriber_string__table_e3k_bmx_cbb__entry__3}

| Name | Type | Description |
|-|-|-|
| sysID | String | Sys_ID of the user you want to add to a conversation. |
[Table 1. Parameters]

{#conversation-addSubscriber_string__table_e3k_bmx_cbb} {#conversation-addSubscriber_string__table_f3k_bmx_cbb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 2. Returns]

{#conversation-addSubscriber_string__table_f3k_bmx_cbb}  

    var conversation = sn_connect.Conversation.get("7caf49111309030034bb58a12244b06c");
    conversation.addSubscriber("a8f98bb0eb32010045e1a5115206fe3a");

## Conversation - create(String name) {#ariaid-title3}

Creates a Connect conversation.
{#conversation-create_String_String__table_lwg_b4w_cbb__entry__3}

| Name | Type | Description |
|-|-|-|
| name | String | Create a conversation with a specific name. |
| type | String | Include a specific conversation type. The type is determined by the type choice list. The base system includes the following type options: * connect * support * group * peer * qanda * team {#conversation-create_String_String__ul_ut2_4df_wbb} |
[Table 3. Parameters]

{#conversation-create_String_String__table_lwg_b4w_cbb} {#conversation-create_String_String__table_mwg_b4w_cbb__entry__2}

| Type | Description |
|-|-|
| Object | Scriptable Conversation |
[Table 4. Returns]

{#conversation-create_String_String__table_mwg_b4w_cbb}  

    var conversation = sn_connect.Conversation.create({
        name: "Hello world",
        type: "connect"
    });

## Conversation - get(String sysID) {#ariaid-title4}

Returns an existing Connect conversation by sys_id.
{#conversation-get-string__table_zkg_1x5_bbb__entry__3}

| Name | Type | Description |
|-|-|-|
| sysID | String | The sys_id of the conversation record. |
[Table 5. Parameters]

{#conversation-get-string__table_zkg_1x5_bbb} {#conversation-get-string__table_alg_1x5_bbb__entry__2}

| Type | Description |
|-|-|
| Object | Conversation object |
[Table 6. Returns]

{#conversation-get-string__table_alg_1x5_bbb}  

    var conversation = sn_connect.Conversation.get("27b9844c1385030034bb58a12244b037");

## Conversation - removeSubscriber(String sysID) {#ariaid-title5}

Removes a user from a conversation.
{#conversation-removeSubscriber_string__table_e3k_bmx_cbb__entry__3}

| Name | Type | Description |
|-|-|-|
| SysID | String | The sys_id of the user you want to remove from a conversation. |
[Table 7. Parameters]

{#conversation-removeSubscriber_string__table_e3k_bmx_cbb} {#conversation-removeSubscriber_string__table_f3k_bmx_cbb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 8. Returns]

{#conversation-removeSubscriber_string__table_f3k_bmx_cbb}  

    var conversation = sn_connect.Conversation.get("7caf49111309030034bb58a12244b06c");
    conversation.removeSubscriber("a8f98bb0eb32010045e1a5115206fe3a");

## Conversation - sendMessage(String body, String field) {#ariaid-title6}

Sends a message to a conversation.
{#conversation-sendMessage_String_String__table_kcw_pmv_2bb__entry__3}

| Name | Type | Description |
|-|-|-|
| Body | String | The main text of the message. |
| Field | String | The field you want the message to appear as. Only use this option if adding a message to a record conversation. Choose from work_notes, comments, or system. Using the field system treats the message as a system message. |
[Table 9. Parameters]

{#conversation-sendMessage_String_String__table_kcw_pmv_2bb} {#conversation-sendMessage_String_String__table_lcw_pmv_2bb__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 10. Returns]

{#conversation-sendMessage_String_String__table_lcw_pmv_2bb}  

    var conversation = sn_connect.Conversation.get("2064fa3919010300964f5270e9840fbb");
    conversation.sendMessage({body: "Hello world", field: "work_notes"});


