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

# Send Message

> Sends a new email from one inbox and returns message_id and thread_id.

Sends a new email from one inbox and returns `message_id` and `thread_id`. Takes `to`, `cc`, `bcc`, `subject`, `text`, `html`, `labels` and `attachments`. 🔴 **This sends real email and it cannot be recalled.** Every AIsa caller shares one AgentMail account, so this reaches inboxes other callers created, so the sending address may not be one you created — check `get_agentmail_inbox` first. To answer an existing message use `post_agentmail_inbox_message_reply`; to write without sending, `post_agentmail_inbox_draft`.

## Example

<CodeGroup>
  ```bash REST theme={null}
  curl -X POST "https://api.aisa.one/apis/v1/agentmail/inboxes/{inbox_id}/messages/send" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```jsonc MCP theme={null}
  // Copy this whole block into Claude Code, Codex, Cursor or any coding agent.
  // It carries everything needed to connect, authorize and run this example —
  // no key to paste, one click of Allow in the browser.
  {
    "operation_id": "post_agentmail_inbox_message_send",
    "arguments": {},
    "max_price_usd": 0.05
  }
  // ── for the agent ─────────────────────────────────────────────────────────
  // Register the AIsa MCP server, then call its `use` tool with the JSON above.
  //   name       aisa
  //   endpoint   https://mcp.aisa.one/mcp
  //   transport  streamable-http
  //   auth       OAuth. The server publishes RFC 9728 metadata, so open a
  //              browser and the user clicks Allow once — nothing to paste.
  //              If AISA_API_KEY is set, send it as a bearer header instead.
  // Use your own MCP mechanism, not a hand-edited config file:
  //   Codex        codex mcp add aisa --url https://mcp.aisa.one/mcp
  //   Claude Code  claude mcp add --transport http -s user aisa https://mcp.aisa.one/mcp
  //   Cursor / VS Code   a "url" entry for https://mcp.aisa.one/mcp in the MCP config
  // The server lists five tools over https://mcp.aisa.one/servers worth of APIs:
  // search, get_details, use, batch_use, list_categories. search and
  // get_details are free; use is billed per call and max_price_usd refuses
  // anything above the cap before spending. This operation's full contract —
  // every argument, the response shape, the price and the pitfalls — is at
  //   https://aisa.one/docs/api-reference/agentmail/post_agentmail-inboxes-inbox-id-messages-send.md
  // Then run the call and show me the result.
  ```
</CodeGroup>

<Note>
  **First time?** Point any MCP client at `https://mcp.aisa.one/mcp` — Claude
  Code, Codex, Cursor, VS Code and the rest. Authorization is OAuth: the client
  opens a browser, you click Allow once, and there is no key to paste. The
  commands per client, and what each call costs, are on
  [aisa.one/mcp](https://aisa.one/mcp#connect).
</Note>

[Set this endpoint up in your agent →](https://aisa.one/mcp?from=/api-reference/agentmail/post_agentmail-inboxes-inbox-id-messages-send)


## OpenAPI

````yaml openapi/agentmail.json POST /agentmail/inboxes/{inbox_id}/messages/send
openapi: 3.1.0
info:
  title: AgentMail API
  version: 1.0.0
  description: >-
    AgentMail email API endpoints exposed through the AIsa unified gateway.
    Adapted from the upstream docs.agentmail.to OpenAPI spec.
servers:
  - url: https://api.aisa.one/apis/v1
security:
  - Bearer: []
paths:
  /agentmail/inboxes/{inbox_id}/messages/send:
    post:
      tags:
        - subpackage_inboxes.subpackage_inboxes/messages
      summary: Send Message
      description: >-
        Sends a new email from one inbox and returns `message_id` and
        `thread_id`. Takes `to`, `cc`, `bcc`, `subject`, `text`, `html`,
        `labels` and `attachments`. 🔴 **This sends real email and it cannot be
        recalled.** Every AIsa caller shares one AgentMail account, so this
        reaches inboxes other callers created, so the sending address may not be
        one you created — check `get_agentmail_inbox` first. To answer an
        existing message use `post_agentmail_inbox_message_reply`; to write
        without sending, `post_agentmail_inbox_draft`.
      operationId: post_agentmail_inbox_message_send
      parameters:
        - name: inbox_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/type_inboxes_InboxId'
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/type_messages_SendMessageRequest'
      responses:
        '200':
          description: Response with status 200
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_messages_SendMessageResponse'
        '400':
          description: Error response with status 400
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type__ValidationErrorResponse'
        '403':
          description: Error response with status 403
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type__ErrorResponse'
        '404':
          description: Error response with status 404
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type__ErrorResponse'
components:
  schemas:
    type_inboxes_InboxId:
      type: string
      description: The ID of the inbox.
      title: InboxId
    type_messages_SendMessageRequest:
      type: object
      properties:
        labels:
          $ref: '#/components/schemas/type_messages_MessageLabels'
        reply_to:
          $ref: '#/components/schemas/type_messages_SendMessageReplyTo'
        to:
          $ref: '#/components/schemas/type_messages_SendMessageTo'
        cc:
          $ref: '#/components/schemas/type_messages_SendMessageCc'
        bcc:
          $ref: '#/components/schemas/type_messages_SendMessageBcc'
        subject:
          $ref: '#/components/schemas/type_messages_MessageSubject'
        text:
          $ref: '#/components/schemas/type_messages_MessageText'
        html:
          $ref: '#/components/schemas/type_messages_MessageHtml'
        attachments:
          $ref: '#/components/schemas/type_messages_SendMessageAttachments'
        headers:
          $ref: '#/components/schemas/type_messages_SendMessageHeaders'
      title: SendMessageRequest
    type_messages_SendMessageResponse:
      type: object
      properties:
        message_id:
          $ref: '#/components/schemas/type_messages_MessageId'
        thread_id:
          $ref: '#/components/schemas/type_threads_ThreadId'
      required:
        - message_id
        - thread_id
      title: SendMessageResponse
    type__ValidationErrorResponse:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/type__ErrorName'
        errors:
          description: Validation errors.
      required:
        - name
        - errors
      title: ValidationErrorResponse
    type__ErrorResponse:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/type__ErrorName'
        message:
          $ref: '#/components/schemas/type__ErrorMessage'
      required:
        - name
        - message
      title: ErrorResponse
    type_messages_MessageLabels:
      type: array
      items:
        type: string
      description: Labels of message.
      title: MessageLabels
    type_messages_SendMessageReplyTo:
      $ref: '#/components/schemas/type_messages_Addresses'
      description: Reply-to address or addresses.
      title: SendMessageReplyTo
    type_messages_SendMessageTo:
      $ref: '#/components/schemas/type_messages_Addresses'
      description: Recipient address or addresses.
      title: SendMessageTo
    type_messages_SendMessageCc:
      $ref: '#/components/schemas/type_messages_Addresses'
      description: CC recipient address or addresses.
      title: SendMessageCc
    type_messages_SendMessageBcc:
      $ref: '#/components/schemas/type_messages_Addresses'
      description: BCC recipient address or addresses.
      title: SendMessageBcc
    type_messages_MessageSubject:
      type: string
      description: Subject of message.
      title: MessageSubject
    type_messages_MessageText:
      type: string
      description: Plain text body of message.
      title: MessageText
    type_messages_MessageHtml:
      type: string
      description: HTML body of message.
      title: MessageHtml
    type_messages_SendMessageAttachments:
      type: array
      items:
        $ref: '#/components/schemas/type_attachments_SendAttachment'
      description: Attachments to include in message.
      title: SendMessageAttachments
    type_messages_SendMessageHeaders:
      type: object
      additionalProperties:
        type: string
      description: Headers to include in message.
      title: SendMessageHeaders
    type_messages_MessageId:
      type: string
      description: ID of message.
      title: MessageId
    type_threads_ThreadId:
      type: string
      description: ID of thread.
      title: ThreadId
    type__ErrorName:
      type: string
      description: Name of error.
      title: ErrorName
    type__ErrorMessage:
      type: string
      description: Error message.
      title: ErrorMessage
    type_messages_Addresses:
      oneOf:
        - type: string
        - type: array
          items:
            type: string
      title: Addresses
    type_attachments_SendAttachment:
      type: object
      properties:
        filename:
          $ref: '#/components/schemas/type_attachments_AttachmentFilename'
        content_type:
          $ref: '#/components/schemas/type_attachments_AttachmentContentType'
        content_disposition:
          $ref: '#/components/schemas/type_attachments_AttachmentContentDisposition'
        content_id:
          $ref: '#/components/schemas/type_attachments_AttachmentContentId'
        content:
          type: string
          description: Base64 encoded content of attachment.
        url:
          type: string
          description: URL to the attachment.
      title: SendAttachment
    type_attachments_AttachmentFilename:
      type: string
      description: Filename of attachment.
      title: AttachmentFilename
    type_attachments_AttachmentContentType:
      type: string
      description: Content type of attachment.
      title: AttachmentContentType
    type_attachments_AttachmentContentDisposition:
      type: string
      enum:
        - inline
        - attachment
      description: Content disposition of attachment.
      title: AttachmentContentDisposition
    type_attachments_AttachmentContentId:
      type: string
      description: Content ID of attachment.
      title: AttachmentContentId
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.