---
title: "POST /messages"
method: POST
path: "/messages"
tags: ["messages"]
---

# POST /messages

`POST /messages`

Send emails to recipients

## Request body

- PayloadInputMessageRequest
  - `channel` 'email', required — Today, only the email channel is upported.
  - `idempotency_key` string — This key must be used if you want to avoid duplicates. When receiving 2 calls with the same idempotency key, we refuse the second call. Can also be used by the sender to identify a specific message.
  - `properties` PayloadProperties, required
    - `content_id` string — ID of the message content (design).
    - `html_content` string — Email properties must be coherent. If you provide an HTML in the call, you must also add the email headers.
    - `options` PayloadOptions
      - `expiration_date` string
      - `expiration_delay` integer
    - `sender_email` string
    - `sender_name` string
    - `reply_to` string
    - `subject` string
    - `text_content` string — Text version of the email. This version is displayed in email client apps that can't display HTML.
  - `recipients` PayloadRecipient[], required — Recipients type must be coherent within a same call. The first recipient type matched is considered as the one used for all the recipients.
    - `contact_id` string
    - `email` string
    - `name` string
    - `resources` PayloadResources
      - `order_id` string
    - `variables` object — Those variables will be applied to this specific recipient. They are used to personalize the messages but won't modify the contacts in database. They have the priority over the variables coming from the database.
  - `transactional` boolean — When 'true', the message will be considered as transactional. It means that it will bypass some optins and blacklists. Warning: in the case of a marketing message, you cannot communicate with a contact which is not optin, and so not use this option.
  - `metadata` object — Those metadata are used to aggregate the events for statistics purposes
    - `campaign_name` string
    - `campaign_category` string
    - `campaign_code_operation` string
    - `campaign_external_id` string
  - `variables` object — Those variables will be applied to all the messages in this sending. They are used to personalize the messages but won't modify the contacts in database.

## Response `200`

MessageEvent sending request approved

- GitlabSplioComMessagingMcApiMessagesSendMessageResponse
  - `message_id` string
  - `status` string

## Other responses

- `400` — Wrong payload

---

[API](https://skmtc.net/splio/apis/splio-customer-platform.md) · [All operations](https://skmtc.net/splio/apis/splio-customer-platform/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/splio/splio-customer-platform/revisions/2ff4735f665c/schema)
