# Retrieve the status of an SMS message

> 📘 Note
>
> New Sandbox API endpoint: <https://api.us.webexconnect.io/v1/sms/messages/{messageId}>

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "version": "1",
    "title": "SMS API",
    "description": ""
  },
  "tags": [
    {
      "name": "Status",
      "description": "APIs for querying the status of sent SMS text messages"
    }
  ],
  "servers": [
    {
      "url": "https://api-sandbox.imiconnect.io"
    }
  ],
  "paths": {
    "/v1/sms/messages/{messageId}": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Retrieve the status of an SMS message",
        "security": [
          {
            "BearerToken": []
          }
        ],
        "parameters": [
          {
            "name": "messageId",
            "schema": {
              "type": "string"
            },
            "in": "path",
            "required": true,
            "description": "The message ID being queried"
          }
        ],
        "responses": {
          "200": {
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "description": "Message status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageStatusResponse"
                }
              }
            }
          },
          "404": {
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "description": "Invalid message ID"
          },
          "500": {
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "description": "Internal error processing the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "headers": {
      "RequestId": {
        "schema": {
          "type": "string"
        },
        "example": "ca44810a-acc0-4f5e-851f-95c02e03110a",
        "description": "Unique ID that identifies this HTTP request."
      }
    },
    "securitySchemes": {
      "BearerToken": {
        "type": "http",
        "scheme": "bearer",
        "description": "Authorization token (this can be either a JWT signed by a secret key or a service key)"
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string",
            "description": "Human readable description of error state"
          }
        }
      },
      "MessageStatusResponse": {
        "type": "object",
        "properties": {
          "messageId": {
            "type": "string",
            "description": "Message's unique ID",
            "example": "96fe8948-bc7c-4eae-8118-78f0ad64f27c"
          },
          "acceptedTime": {
            "$ref": "#/components/schemas/AcceptedTime"
          },
          "from": {
            "type": "string",
            "description": "Short or long code that the message was sent from",
            "example": 34343
          },
          "to": {
            "type": "string",
            "format": "E.164",
            "description": "Mobile device phone number in E.164 format that the message was sent to",
            "example": "+19545551212"
          },
          "correlationId": {
            "$ref": "#/components/schemas/CorrelationId"
          },
          "content": {
            "type": "string",
            "example": "Hello, world!",
            "description": "Actual message content that was sent to the device.  This contains any substitutions that may have been made."
          },
          "contentType": {
            "$ref": "#/components/schemas/ContentType"
          },
          "dltTemplateId": {
            "$ref": "#/components/schemas/DltTemplateId"
          },
          "status": {
            "type": "string",
            "enum": [
              "QUEUED",
              "SENT",
              "DELIVERED",
              "FAILED"
            ],
            "description": "Message status"
          },
          "statusTime": {
            "type": "string",
            "description": "Timestamp in ISO8601 format reflecting when the message status was updated",
            "example": "2021-07-29T13:45:33.404Z"
          },
          "error": {
            "description": "This is only included if the status is FAILED",
            "allOf": [
              {
                "$ref": "#/components/schemas/ErrorResponse"
              }
            ]
          }
        }
      },
      "ContentType": {
        "type": "string",
        "enum": [
          "TEXT",
          "TEMPLATE",
          "UNICODE",
          "FLASH",
          "BINARY"
        ],
        "default": "TEXT",
        "description": "Denotes whether the content string is the actual text content to be sent or a reference to a template ID."
      },
      "DltTemplateId": {
        "type": "string",
        "example": "2kRCRhhxOmT28jMn",
        "description": "Specifies the DLT template ID used for this message.  This is only used in certain regions."
      },
      "CorrelationId": {
        "type": "string",
        "description": "User defined ID that is assigned to an individual message",
        "example": "de36bb32-3f5d-46c9-b132-15e010a80ccc"
      },
      "AcceptedTime": {
        "type": "string",
        "description": "Timestamp in ISO8601 format when message was received by the API",
        "example": "2021-07-29T13:45:33.404Z"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 106,
      "1": 154,
      "2": 167,
      "3": 210,
      "4": 198,
      "5": 45,
      "6": 148,
      "7": 123,
      "8": 69,
      "9": 120,
      "10": 178,
      "11": 4
    }
  }
}
```