> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Message

> This endpoint updates a message

### Body

<ParamField body="id" type="string">
  This is the ID of the message to be created.
</ParamField>

<ParamField body="time" type="string">
  This is the time of the message to be created.
</ParamField>

<ParamField body="body" type="string">
  This is the body of the message to be created.
</ParamField>

<ParamField body="username" type="string">
  This is the username of the message to be created.
</ParamField>

<ParamField body="channel_id" type="string">
  This is the channel\_id of the message to be created.
</ParamField>

<ParamField body="user_id" type="string">
  This is the user\_id of the message to be created.
</ParamField>

<ParamField body="is_public" type="boolean">
  This is the is\_public of the message to be created.
</ParamField>

<ParamField body="from" type="string">
  This is the from of the message to be created.
</ParamField>

<ParamField body="to" type="string">
  This is the to of the message to be created.
</ParamField>

<ParamField body="from_me" type="boolean">
  This is the from\_me of the message to be created.
</ParamField>

<ParamField body="sent_receipt" type="boolean">
  This is the sent\_receipt of the message to be created.
</ParamField>

<ParamField body="delivered_receipt" type="boolean">
  This is the delivered\_receipt of the message to be created.
</ParamField>

<ParamField body="message_number" type="number">
  This is the message\_number of the message to be created.
</ParamField>

<ParamField body="date" type="string">
  This is the date of the message to be created.
</ParamField>

<ParamField body="timestamp" type="string">
  This is the timestamp of the message to be created.
</ParamField>

<ParamField body="created_at" type="string">
  This is the created\_at of the message to be created.
</ParamField>

<ParamField body="updated_at" type="string">
  This is the updated\_at of the message to be created.
</ParamField>

### Response

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request PUT 'https://api.stateset.com/v1/messages/:id' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Token <token>' \
  --data-raw '{
      "id": ""
  }'
  ```

  ```graphQL GraphQL theme={null}

  mutation insert_message ($message: message_insert_input! ){
    insert_message (
      objects: [$message]
    ) {
      returning {
        id
        time
        body
        username
      }
    }
  }
  ```

  ```javascript Node.js theme={null}

  const created = await stateset.message.create({
    id: "",
  });

  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
      "data": {
          "insert_message": {
          "returning": [
              {
              "id": "",
              }
          ]
          }
      }

  }
  ```
</ResponseExample>

### Messages

| Field            | Type     | Description                                                |
| ---------------- | -------- | ---------------------------------------------------------- |
| id               | String   | Unique identifier for the message                          |
| body             | String   | The content or text of the message                         |
| created\_at      | DateTime | The date and time when the message was created             |
| date             | Date     | The date when the message was sent                         |
| deliveredReceipt | Boolean  | Indicates if the message has been delivered                |
| from             | String   | Sender of the message                                      |
| fromMe           | Boolean  | Indicates if the message was sent by the user              |
| is\_public       | Boolean  | Indicates if the message is public or private              |
| messageNumber    | Integer  | Unique number assigned to the message                      |
| sentReceipt      | Boolean  | Indicates if the message has been sent                     |
| time             | Time     | The time when the message was sent                         |
| timestamp        | DateTime | The timestamp of the message                               |
| to               | String   | Recipient of the message                                   |
| user\_id         | String   | Unique identifier for the user associated with the message |
| username         | String   | Username of the user associated with the message           |
