API reference / Messages

Send a message

Send an email only when the user has authorized it. Retry with the SAME idempotencyKey and unchanged contents.

POST/v1/inboxes/{inboxId}/messages/send

Requires an API key with the messages:send scope. MCP tool: send. CLI: goshenemail messages send.

Request

Path parameters

NameTypeRequiredNotes
inboxIdstring (email)Yesup to 254 characters

Body

FieldTypeRequiredNotes
attachmentsobject[]up to 10 items
filenamestringYes1–200 characters
contentTypestringYesup to 100 characters
contentstringYesup to 2,796,204 characters
labelsstring[]up to 50 items
textstringup to 2,000,000 characters
htmlstringup to 2,000,000 characters
tostring (email)[]Yesat least 1 item, up to 50 items
ccstring (email)[]up to 50 items
bccstring (email)[]up to 50 items
subjectstringup to 998 characters, default ""
idempotencyKeystringYes1–200 characters

Response

FieldTypeNotes
messageIdstring
threadIdstring
deduplicatedboolean

Errors return { "error": { "code", "message", "transient" } } with a 4xx or 5xx status. See Errors.

Examples

curl

curl "https://api.goshenemail.com/v1/inboxes/research%40agents.goshenemail.com/messages/send" \
  -H "Authorization: Bearer $GOSHENEMAIL_API_KEY" \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Hello, could you send the current quote?",
    "to": [
      "recipient@example.net"
    ],
    "subject": "Quote request",
    "idempotencyKey": "2f7c1c1e-6d1a-4a3b-9b0e-0c9b3f5c8a11"
  }'

CLI

goshenemail messages send --json '{"inboxId":"research@agents.goshenemail.com","text":"Hello, could you send the current quote?","to":["recipient@example.net"],"subject":"Quote request","idempotencyKey":"2f7c1c1e-6d1a-4a3b-9b0e-0c9b3f5c8a11"}'