{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/eztexting-com/json-schema/eztexting-com-message-details-schema.json",
  "title": "MessageDetails",
  "description": "Message",
  "x-generated": "2026-11-07",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/eztexting-com-api-openapi.yml#/components/schemas/MessageDetails",
  "type": "object",
  "properties": {
    "groups": {
      "type": "array",
      "description": "Groups this message was sent to",
      "items": {
        "$ref": "#/$defs/ContactGroup"
      }
    },
    "contacts": {
      "type": "array",
      "description": "Individual contacts this message was sent to (not in Groups)",
      "items": {
        "$ref": "#/$defs/Contact"
      }
    },
    "recipientsCount": {
      "type": "integer",
      "format": "int32",
      "description": "Number of recipients for this message"
    },
    "credits": {
      "type": "integer",
      "format": "int32",
      "description": "Number of credits used to send this message"
    },
    "fromNumber": {
      "type": "string",
      "description": "Number this message was sent from"
    },
    "sentOn": {
      "type": "string",
      "format": "date-time",
      "description": "The date this message was sent"
    },
    "type": {
      "type": "string",
      "description": "Requested message type: SMS or MMS",
      "enum": [
        "SMS",
        "MMS"
      ]
    }
  },
  "$defs": {
    "Contact": {
      "type": "object",
      "description": "Contact",
      "properties": {
        "phoneNumber": {
          "type": "string",
          "description": "Phone number"
        },
        "firstName": {
          "type": "string",
          "description": "First name"
        },
        "lastName": {
          "type": "string",
          "description": "Last name"
        },
        "email": {
          "type": "string",
          "description": "Email address"
        },
        "note": {
          "type": "string",
          "description": "Notes"
        },
        "custom1": {
          "type": "string",
          "description": "Custom value 1"
        },
        "custom2": {
          "type": "string",
          "description": "Custom value 2"
        },
        "custom3": {
          "type": "string",
          "description": "Custom value 3"
        },
        "custom4": {
          "type": "string",
          "description": "Custom value 4"
        },
        "custom5": {
          "type": "string",
          "description": "Custom value 5"
        },
        "source": {
          "type": "integer",
          "format": "int32",
          "description": "Source this contact was created from, e.g. API, WEBWIDGET, UPLOAD etc",
          "enum": [
            0,
            1,
            2,
            3,
            4,
            5,
            10,
            11,
            12,
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            21,
            22,
            23,
            999990,
            999991,
            999992,
            999993,
            999994,
            999995
          ]
        },
        "values": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "description": "Created date"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time",
          "description": "Last modification date"
        },
        "optOut": {
          "type": "boolean",
          "description": "Is opted out"
        },
        "groups": {
          "type": "array",
          "description": "Groups this contact is in",
          "items": {
            "$ref": "#/$defs/ContactGroup"
          }
        }
      }
    },
    "ContactGroup": {
      "type": "object",
      "description": "ContactGroup",
      "properties": {
        "id": {
          "type": "string",
          "description": "Group id"
        },
        "name": {
          "type": "string",
          "description": "Group name"
        },
        "note": {
          "type": "string",
          "description": "Notes related to contact group"
        },
        "contactsCount": {
          "type": "integer",
          "format": "int32",
          "description": "Number of contacts in contact group"
        }
      }
    }
  }
}