---
title: "Sends a message to a specified channel or user in Discord."
method: POST
path: "/sendMessage"
---

# Sends a message to a specified channel or user in Discord.

`POST /sendMessage`

This function allows sending messages to either a specific channel or directly to a user in Discord. It supports sending text content, embedding images/links, and including rich embeds. The function is versatile, enabling various types of message compositions for different communication needs.

## Request body

- object
  - `body` object — Body of the sendMessage sls call
    - `arguments` unknown[], required
      - unknown
    - `auth` object — Authentication object
      - `strategy` 'apikey' — Authentication strategy
      - `variables` unknown[] — Variables for the authentication strategy
        - unknown
    - `packageName` string — @microfox/discord

## Response `200`

Message sent successfully

- object
  - `id` string — The ID of the sent message
  - `content` string — The content of the sent message
  - `channelId` string — The ID of the channel where the message was sent
  - `timestamp` string, date-time — The timestamp when the message was sent

## Other responses

- `400` — Bad request - invalid parameters
- `403` — Forbidden - lack of permissions to send the message
- `404` — Not found - channel or user not found
- `500` — Internal server error

---

[API](https://skmtc.net/microfox-ai/apis/microfox-discord-sdk-api.md) · [All operations](https://skmtc.net/microfox-ai/apis/microfox-discord-sdk-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/microfox-ai/microfox-discord-sdk-api/versions/7cb5b64ae924/schema)
