---
agentTools:
  projectIndex: https://api-docs.plumvoice.com/llms.txt
---

# Get SMS Message

Lists SMS messages that have been sent and/or received.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "DEV APIs (SMS)",
    "description": "Plum offers four services for its SMS REST API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://hosting.plumvoice.com/ws/sms"
    }
  ],
  "security": [
    {
      "basicAuth": []
    }
  ],
  "paths": {
    "/messages.{resource_type}": {
      "get": {
        "tags": [
          "SMS"
        ],
        "summary": "Get SMS Message",
        "description": "Lists SMS messages that have been sent and/or received.",
        "parameters": [
          {
            "$ref": "#/components/parameters/resource_type"
          },
          {
            "$ref": "#/components/parameters/offset"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/order"
          },
          {
            "$ref": "#/components/parameters/start_timestamp"
          },
          {
            "$ref": "#/components/parameters/end_timestamp"
          },
          {
            "$ref": "#/components/parameters/msg_type"
          },
          {
            "$ref": "#/components/parameters/phone_number"
          },
          {
            "$ref": "#/components/parameters/number_type"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/getMessagesSuccess"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "success": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "result": {
            "type": "object"
          }
        }
      },
      "smsMessages": {
        "allOf": [
          {
            "$ref": "#/components/schemas/success"
          },
          {
            "properties": {
              "sms_messages": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            }
          }
        ]
      }
    },
    "responses": {
      "getMessagesSuccess": {
        "description": "OK",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/smsMessages"
            },
            "examples": {
              "Success": {
                "$ref": "#/components/examples/getMessagesSuccessEx"
              },
              "Invalid LIMIT": {
                "$ref": "#/components/examples/invalidLimit"
              },
              "Invalid ORDER": {
                "$ref": "#/components/examples/invalidOrder"
              },
              "Invalid START TIMESTAMP": {
                "$ref": "#/components/examples/invalidStartTimestamp"
              },
              "Invalid Number Type": {
                "$ref": "#/components/examples/invalidNumberType"
              },
              "Number Type Not Required": {
                "$ref": "#/components/examples/numberTypeNotRequired"
              }
            }
          }
        }
      }
    },
    "parameters": {
      "end_timestamp": {
        "name": "end_timestamp",
        "in": "query",
        "description": "End timestamp to stop searching for SMS messages.",
        "required": false,
        "style": "form",
        "explode": true,
        "schema": {
          "type": "integer"
        }
      },
      "limit": {
        "name": "limit",
        "in": "query",
        "description": "Maximum number of SMS messages to return.\n##### Note: minimum limit is 50, maximum limit is 1000.\n",
        "required": false,
        "style": "form",
        "explode": true,
        "schema": {
          "type": "integer"
        }
      },
      "msg_type": {
        "name": "msg_type",
        "in": "query",
        "description": "Type of messages to be returned.\n##### Note: Accepted values are 'inbound', 'outbound', 'all' (for both inbound and outbound), or blank.\n",
        "required": false,
        "style": "form",
        "explode": true,
        "schema": {
          "type": "string"
        }
      },
      "number_type": {
        "name": "number_type",
        "in": "query",
        "description": "Available and required only when message type is inbound or outbound\nAND a phone number is provided.\n##### Note: accepted values are 'account' (your SMS phone number) and 'customer' (your end user's SMS phone number) \n",
        "required": false,
        "style": "form",
        "explode": true,
        "schema": {
          "type": "string"
        }
      },
      "offset": {
        "name": "offset",
        "in": "query",
        "description": "Number of SMS messages to skip before returning results.",
        "required": false,
        "style": "form",
        "explode": true,
        "schema": {
          "type": "integer"
        }
      },
      "order": {
        "name": "order",
        "in": "query",
        "description": "Sort the SMS messages in ascending or descending order by date.\n#### Note: Accepted values are asc, desc, or blank\n",
        "required": false,
        "style": "form",
        "explode": true,
        "schema": {
          "type": "string"
        }
      },
      "phone_number": {
        "name": "phone_number",
        "in": "query",
        "description": "The phone number to filter results on.",
        "required": false,
        "style": "form",
        "explode": true,
        "schema": {
          "type": "integer"
        }
      },
      "resource_type": {
        "name": "resource_type",
        "in": "path",
        "description": "Enter json as the resource type.",
        "required": true,
        "style": "simple",
        "explode": false,
        "schema": {
          "type": "string"
        }
      },
      "start_timestamp": {
        "name": "start_timestamp",
        "in": "query",
        "description": "Start timestamp to begin searching for SMS messages.",
        "required": false,
        "style": "form",
        "explode": true,
        "schema": {
          "type": "integer"
        }
      }
    },
    "examples": {
      "getMessagesSuccessEx": {
        "value": {
          "status": "success",
          "error": "",
          "result": {
            "sms_messages": [
              {
                "sms_message_id": "e7f41fdc813d481081ec2840d68838b5",
                "to": 19998881234,
                "from": 2435678910,
                "body": "This is a notification",
                "request_timestamp": 1664470748,
                "response_timestamp": 1330464357,
                "result_url": "",
                "status": "sent"
              },
              {
                "sms_message_id": "bf811cfb5e864a2793d9b6b81ec2185f",
                "to": 19998881234,
                "from": 2435678910,
                "body": "Resending notification",
                "request_timestamp": 1330464386,
                "response_timestamp": 1330464387,
                "result_url": "",
                "status": "sent"
              }
            ]
          }
        }
      },
      "invalidLimit": {
        "value": {
          "status": "failure",
          "error": "Invalid parameter \"limit\" must be >= 50"
        }
      },
      "invalidOrder": {
        "value": {
          "status": "failure",
          "error": "Invalid parameter \"order\" must be equal to ASC, DESC or left blank"
        }
      },
      "invalidStartTimestamp": {
        "value": {
          "status": "failure",
          "error": "Invalid parameters \"start_timestamp\" must be before \"end_timestamp\""
        }
      },
      "invalidNumberType": {
        "value": {
          "status": "failure",
          "error": "Invalid parameter \"order\" must be equal to ASC, DESC or left blank"
        }
      },
      "numberTypeNotRequired": {
        "value": {
          "status": "failure",
          "error": "Parameter \"number_type\" is not required in this"
        }
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 99,
      "1": 238,
      "2": 62,
      "3": 55,
      "4": 99,
      "5": 203,
      "6": 219,
      "7": 5,
      "8": 112,
      "9": 1,
      "10": 105,
      "11": 90
    }
  }
}
```