---
title: "messageSend"
description: >
  Send a new message in a chat app or messaging system. Before you call this mutation, ensure that a conversation has been created using the [conversationCreate](https://developer.shopline.com/docs/storefront-api/message/mutations/conversation-create.md) mutation.
doc_type: graphql
doc_category: storefront
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/storefront-api/message/mutations/message-send'
  md: 'https://developer.shopline.com/docs/storefront-api/message/mutations/message-send.md'
---
# messageSend

Send a new message in a chat app or messaging system. Before you call this mutation, ensure that a conversation has been created using the [conversationCreate](https://developer.shopline.com/docs/storefront-api/message/mutations/conversation-create.md) mutation.

- **Required Scopes:** `unauthenticated_write_message`
- **API Version:** v20270301
- **API Type:** Storefront
- **API Protocol:** GraphQL
- **Operation Type:** Mutation

## Required Permissions

* `unauthenticated_write_message`

An access token is required to call this API. Refer to [Authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md) for more information about how to obtain the token.

## Arguments

* `input`

  [MessageSendInput](https://developer.shopline.com/docs/storefront-api/message/inputs/message-send-input.md)

  The input fields to send a message.

## Returns

* `message`

  [Message](https://developer.shopline.com/docs/storefront-api/message/objects/message.md)

  Details of the message.

* `userErrors`

  [[MessageUserError!]!](https://developer.shopline.com/docs/storefront-api/message/objects/message-user-error.md)

  Errors related to the user information.

## Examples

### Send a message

Send a new message in a chat application or messaging system. Before you call this mutation, ensure that a conversation has been created using the [conversationCreate](https://developer.shopline.com/docs/storefront-api/message/mutations/conversation-create.md) mutation.

**Request:**

```json
mutation {
    messageSend(
        input: {
            storeId: "******2170"
            conversationId: "gid://shopline/Conversation/******403588"
            content: "demoString"
            contentAttachmentUrl: "demoString"
            messageType: TEXT
        }
    ) {
        userErrors {
            code
            field
            message
        }
        message {
            contentAttachmentUrl
            messageType
            createAt
            conversationId
            sendErrorCode
            senderType
            sendStatus
            id
            storeId
            userId
            content
        }
    }
}

```

**Response:**

```json
{
  "data": {
    "messageSend": {
      "message": {
        "createTime": null,
        "messageType": "TEXT",
        "sendErrorCode": "",
        "userId": "gid://shopline/ThirdUser/******5235111",
        "content": "demoString",
        "conversationId": "gid://shopline/Conversation/******403588",
        "id": null,
        "sendStatus": "SEND_SUCCESS",
        "senderType": "USER",
        "storeId": "******2170",
        "contentAttachmentUrl": ""
      },
      "userErrors": []
    }
  }
}
```

## Error Handling

For detailed information about common codes, see [Status and error codes](https://developer.shopline.com/docs/apps/api-instructions-for-use/storefront-api/overview.md#status-and-error-codes).

