{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/elocuenti-com/json-schema/elocuenti-com-message-record-list-schema.json",
  "title": "MessageRecordList",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/elocuenti-com-messages-api-openapi.yml#/components/schemas/MessageRecordList",
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/MessageRecord"
      },
      "title": "Data"
    },
    "request_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Request Id"
    }
  },
  "required": [
    "data"
  ],
  "$defs": {
    "MessageRecord": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "conversation_id": {
          "type": "string",
          "title": "Conversation Id"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Content"
        },
        "direction": {
          "type": "string",
          "description": "`incoming` (from the customer) or `outgoing` (from your business).",
          "title": "Direction"
        },
        "status": {
          "type": "string",
          "description": "`received` for a message from the customer. For one your business sent, its delivery status, updated from the channel: `sent`, `delivered`, `read` or `failed`.",
          "title": "Status"
        },
        "type": {
          "type": "string",
          "description": "The kind of message: `text`, `template`, `image`, `audio`, `video`, `document`, `sticker`, `location`, `interactive` and the like.",
          "title": "Type"
        },
        "media_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Where the file of the message is, when it has one. It can be `null` although the message has a file (Instagram and Messenger): to download any file, use `GET /api/v1/messages/{id}/media`.",
          "title": "Media Url"
        },
        "media_mime_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "The format of the file, or `null`.",
          "title": "Media Mime Type"
        },
        "whatsapp_message_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Whatsapp Message Id"
        },
        "error_code": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Error Code"
        },
        "error_message": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Error Message"
        },
        "created_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Created At"
        },
        "updated_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Updated At"
        }
      },
      "required": [
        "id",
        "conversation_id",
        "content",
        "direction",
        "status",
        "type",
        "media_url",
        "media_mime_type",
        "whatsapp_message_id",
        "error_code",
        "error_message",
        "created_at",
        "updated_at"
      ],
      "description": "One row of GET /api/v1/messages, newest first.",
      "title": "MessageRecord"
    }
  }
}