# Create a message `POST /api/v1/messages` Creates a message. ## Permissions Send your API key in `X-API-Key`. Required permissions are **Messages → Write**. ## Body parameters - `channel` (string) — Use email or sms. Defaults to email when omitted from a write. - `status` (string) — Use queued, sent, failed, delivered, opened, or clicked. Defaults to queued when omitted from a write. - `email` (string) — Recipient email address. - `phone` (string or null) — Recipient phone number. - `subject` (string) — Email subject, up to 255 characters. - `body` (string, required) — Message body. For email, supply the HTML content. - `athlete_id` (integer or null) — ID of the associated athlete. - `parent_id` (integer or null) — ID of the associated parent. - `staff_id` (integer or null) — ID of the associated staff member or coach. - `cc` (string) — Copy addresses separated by commas or semicolons. Alias email_cc. - `send_copy_to_club` (boolean) — Copy the club email. Alias copy_to_club. Defaults to false for new messages. - `metadata` (map or null) — Structured message details. Use the send endpoint to deliver a queued email. ## Request Set ASDINCLOUD_API_KEY and any variables named in the example before running it. ```sh curl --request POST \ --url "https://api.asdincloud.com/api/v1/messages" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "Content-Type: application/json" \ --data '{"email":"alex@example.com","subject":"Practice schedule","body":"

Practice starts at 18:00.

"}' ``` ## Response **201 Created** The created message is returned in data. Example with fictional data and selected fields. ```json { "message_key": "entities.message.messages.created", "data": { "id": 18, "channel": "email", "status": "queued", "email": "alex@example.com", "subject": "Practice schedule", "body": "

Practice starts at 18:00.

", "sent_at": null } } ``` ## Errors - `401` — The API key is missing or invalid. - `403` — The API key lacks the required permission. - `400` — The body must be a JSON object. - `422` — One or more fields failed validation.