{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/envoisms-ma/json-schema/envoisms-ma-message-schema.json",
  "title": "Message",
  "description": "Response to POST /messages — the message as accepted into the send queue.",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/envoisms-ma-api-openapi.json#/components/schemas/Message",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "to": {
      "type": "string"
    },
    "channel": {
      "type": "string",
      "enum": [
        "sms",
        "whatsapp",
        "voice",
        "rcs"
      ],
      "description": "sms is generally available with multi-operator routing. whatsapp sends from your own connected WhatsApp Business number (templates, text, media, interactive messages, reactions, contacts, locations) via the official WhatsApp Cloud API. voice and rcs are available on request."
    },
    "cascade": {
      "type": "boolean"
    },
    "status": {
      "type": "string"
    },
    "cost": {
      "type": "object",
      "description": "What was actually charged. Always zero on a sandbox key.",
      "properties": {
        "eur": {
          "type": "number"
        },
        "mad": {
          "type": "number"
        }
      }
    },
    "segments": {
      "type": "integer"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "sandbox": {
      "type": "boolean",
      "description": "Present and true only when the request used an `env_test_` key. Nothing was delivered and nothing was charged."
    },
    "simulated_cost": {
      "type": "object",
      "description": "Sandbox only. What this exact send would have cost on a live key, at the account's own rates — so an integration can be costed before it goes live. Reported separately from `cost` so a rehearsal can never be mistaken for revenue.\n",
      "properties": {
        "eur": {
          "type": "number"
        },
        "mad": {
          "type": "number"
        }
      }
    },
    "warnings": {
      "type": "array",
      "description": "Sandbox only. What a live key would have been refused for — today `OUT_OF_24H_WINDOW` for a free-form WhatsApp message outside the customer service window. The sandbox still simulates the send.\n",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      }
    }
  }
}