<!-- Generated from the reviewed public OpenAPI contract. Do not edit this file. -->

# Message



**Type:** object

Required means required **within its containing object**, when that object is present. Union/conditional constraints remain defined by the JSON Schema below.


| Field | Type | Presence | Description / constraints |
| --- | --- | --- | --- |
| ` agent ` | anyOf: string; null | Optional | — |
| ` billing_status ` | ` pending `, ` settled ` | Optional | — |
| ` body ` | string | Required | — |
| ` cost_micros ` | anyOf: string; null | Optional | — |
| ` direction ` | ` inbound `, ` outbound ` | Optional | — |
| ` estimated_segments ` | anyOf: integer; null | Optional | — |
| ` from_e164 ` | string | Optional | pattern: ` ^\+[1-9][0-9]{6,14}$ ` |
| ` id ` | string | Required | Public msg_… reference (not a UUID). pattern: ` ^msg_[0-7][0-9A-HJKMNP-TV-Z]{25}$ ` |
| ` line ` | string | Optional | pattern: ` ^\+[1-9][0-9]{6,14}$ ` |
| ` line_id ` | anyOf: string; null | Optional | — |
| ` rating ` | anyOf: object; null | Optional | Paid accounts only: the price book's route class (e.g. us-ordinary, us-high-cost) and version its charge used; null until charged |
| ` segments ` | anyOf: integer; null | Optional | — |
| ` status ` | ` queued `, ` sent `, ` delivered `, ` failed `, ` received `, ` delivery_unconfirmed ` | Required | — |
| ` to_e164 ` | string | Optional | pattern: ` ^\+[1-9][0-9]{6,14}$ ` |


**JSON Schema**
```json
{
  "additionalProperties": true,
  "properties": {
    "agent": {
      "anyOf": [
        {
          "description": "Public agent_… reference (not a UUID)",
          "pattern": "^agent_[0-7][0-9A-HJKMNP-TV-Z]{25}$",
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_status": {
      "enum": [
        "pending",
        "settled"
      ],
      "type": "string"
    },
    "body": {
      "type": "string"
    },
    "cost_micros": {
      "anyOf": [
        {
          "description": "Integer USD micros as a decimal string; $1 = 1000000 micros",
          "pattern": "^[0-9]+$",
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "direction": {
      "enum": [
        "inbound",
        "outbound"
      ],
      "type": "string"
    },
    "estimated_segments": {
      "anyOf": [
        {
          "minimum": 0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "from_e164": {
      "examples": [
        "+12125550101"
      ],
      "pattern": "^\\+[1-9][0-9]{6,14}$",
      "type": "string"
    },
    "id": {
      "description": "Public msg_… reference (not a UUID)",
      "pattern": "^msg_[0-7][0-9A-HJKMNP-TV-Z]{25}$",
      "type": "string"
    },
    "line": {
      "examples": [
        "+12125550101"
      ],
      "pattern": "^\\+[1-9][0-9]{6,14}$",
      "type": "string"
    },
    "line_id": {
      "anyOf": [
        {
          "description": "Public line_… reference (not a UUID)",
          "pattern": "^line_[0-7][0-9A-HJKMNP-TV-Z]{25}$",
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "rating": {
      "anyOf": [
        {
          "additionalProperties": true,
          "properties": {
            "price_book_version": {
              "type": "string"
            },
            "route_id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "description": "Paid accounts only: the price book's route class (e.g. us-ordinary, us-high-cost) and version its charge used; null until charged"
    },
    "segments": {
      "anyOf": [
        {
          "minimum": 0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "enum": [
        "queued",
        "sent",
        "delivered",
        "failed",
        "received",
        "delivery_unconfirmed"
      ],
      "type": "string"
    },
    "to_e164": {
      "examples": [
        "+12125550101"
      ],
      "pattern": "^\\+[1-9][0-9]{6,14}$",
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "body"
  ],
  "type": "object"
}
```
