# Update a message `PATCH / PUT / POST /api/v1/messages/{id}` Updates a message by ID. ## Permissions Send your API key in `X-API-Key`. Required permissions are **Messages → Write**. ## Path parameters - `id` (integer, required) — ID of the message. ## 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) — 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. Send the current channel and status to preserve them. Otherwise they default to email and queued. ## Request (PATCH) Set ASDINCLOUD_API_KEY and any variables named in the example before running it. ```sh curl --request PATCH \ --url "https://api.asdincloud.com/api/v1/messages/${ID:?Set ID}" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "Content-Type: application/json" \ --data '{"channel":"email","status":"queued","subject":"Updated practice schedule"}' ``` ## Request (PUT) Set ASDINCLOUD_API_KEY and any variables named in the example before running it. ```sh curl --request PUT \ --url "https://api.asdincloud.com/api/v1/messages/${ID:?Set ID}" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "Content-Type: application/json" \ --data '{"channel":"email","status":"queued","subject":"Updated practice schedule"}' ``` ## Request (POST) 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/${ID:?Set ID}" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "Content-Type: application/json" \ --data '{"channel":"email","status":"queued","subject":"Updated practice schedule"}' ``` ## Response **200 OK** Returns a successful update response. Example with fictional data and selected fields. ```json { "message_key": "entities.message.messages.updated" } ``` ## Errors - `401` — The API key is missing or invalid. - `403` — The API key lacks the required permission. - `404` — The requested record was not found. - `400` — The body must be a JSON object. - `422` — One or more fields failed validation.