{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/instasent/json-schema/instasent-response-sms-item-schema.json",
  "title": "ResponseSmsItem",
  "description": "SMS message entity",
  "x-generated": "2026-10-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/product.openapi.yaml#/components/schemas/ResponseSmsItem",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "SMS message ID"
    },
    "status": {
      "type": "string",
      "description": "Message status (e.g., 'enqueued', 'sent', 'delivered', 'failed')"
    },
    "statusCode": {
      "type": [
        "string",
        "null"
      ],
      "description": "Status code from the SMS provider (if available)"
    },
    "from": {
      "type": "string",
      "description": "Sender ID or phone number"
    },
    "to": {
      "type": "string",
      "description": "Recipient phone number"
    },
    "normalizedTo": {
      "type": "string",
      "description": "Normalized recipient phone number"
    },
    "text": {
      "type": "string",
      "description": "Original message text (with template variables like {{short:url}} and {{unsubscribe}})"
    },
    "deliveredText": {
      "type": [
        "string",
        "null"
      ],
      "description": "Final delivered text (with template variables resolved)"
    },
    "charsCount": {
      "type": "integer",
      "description": "Character count of the message"
    },
    "messagesCount": {
      "type": "integer",
      "description": "Number of SMS parts (1 for single SMS, 2+ for concatenated messages)"
    },
    "encoding": {
      "type": "string",
      "description": "Message encoding (e.g., 'GSM_7BIT', 'UCS2')"
    },
    "unicode": {
      "type": "boolean",
      "description": "Whether the message contains Unicode characters"
    },
    "allowUnicode": {
      "type": "boolean",
      "description": "Whether Unicode characters were allowed for this message"
    },
    "charged": {
      "type": "boolean",
      "description": "Whether the message was charged"
    },
    "pricePerSms": {
      "type": [
        "number",
        "null"
      ],
      "description": "Price per SMS part"
    },
    "priceUser": {
      "type": [
        "number",
        "null"
      ],
      "description": "Total price charged to user"
    },
    "sentAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the message was sent (null if not yet sent)"
    },
    "deliveredAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the message was delivered (null if not yet delivered)"
    },
    "scheduledAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the message is scheduled to be sent (null for immediate sending)"
    },
    "inbound": {
      "type": "boolean",
      "description": "Whether this is an inbound message (false for outbound)"
    },
    "country": {
      "type": [
        "string",
        "null"
      ],
      "description": "Country code of the recipient"
    },
    "audienceContact": {
      "type": [
        "object",
        "null"
      ],
      "description": "Audience contact information",
      "additionalProperties": true,
      "properties": {
        "id": {
          "type": "string",
          "description": "Audience contact ID"
        },
        "project": {
          "type": "string",
          "description": "Project ID"
        }
      }
    },
    "metadata": {
      "type": [
        "object",
        "null"
      ],
      "description": "Additional metadata about the message (organization, token, send entity)",
      "additionalProperties": true
    }
  },
  "required": [
    "id",
    "status",
    "from",
    "to",
    "normalizedTo",
    "text",
    "charsCount",
    "messagesCount",
    "encoding",
    "unicode",
    "allowUnicode",
    "charged",
    "inbound"
  ],
  "additionalProperties": true,
  "x-stoplight": {
    "id": "htlexm05z2jyf"
  }
}