> For the complete documentation index, see [llms.txt](https://docs.welkinhealth.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.welkinhealth.com/developer-and-integration-guide/api-reference/sms.md).

# SMS

The SMS API provides read access to SMS message records associated with patients.

**Base path:** `/{tenantName}/{instanceName}/patients/{patientId}/sms`

***

## Endpoints

### GET Get All SMS

**GET** `/{tenantName}/{instanceName}/patients/{patientId}/sms`

Returns all SMS messages associated with a patient.

#### Query Parameters

| Parameter   | Type    | Default | Description                       |
| ----------- | ------- | ------- | --------------------------------- |
| `page`      | integer | `0`     | Page number                       |
| `size`      | integer | `20`    | Results per page                  |
| `direction` | string  | —       | Filter by `INBOUND` or `OUTBOUND` |
| `startDate` | string  | —       | Start of date range (ISO 8601)    |
| `endDate`   | string  | —       | End of date range (ISO 8601)      |

#### Example Response `200 OK`

```json
{
  "data": [
    {
      "id": "sms-uuid",
      "patientId": "a1b2c3d4",
      "direction": "OUTBOUND",
      "body": "Your appointment is confirmed for March 20 at 2:00 PM.",
      "sentAt": "2026-03-19T09:15:00Z",
      "status": "DELIVERED",
      "hasAttachment": false
    }
  ]
}
```

***

### GET Get SMS by ID

**GET** `/{tenantName}/{instanceName}/patients/{patientId}/sms/{smsId}`

Returns a single SMS record with full message metadata.

***

### GET Download SMS Attachment

**GET** `/{tenantName}/{instanceName}/patients/{patientId}/sms/{smsId}/attachment`

Downloads the file attachment from an SMS message.

#### Response

| Header                | Value                                                               |
| --------------------- | ------------------------------------------------------------------- |
| `Content-Type`        | MIME type of the attachment (e.g., `image/jpeg`, `application/pdf`) |
| `Content-Disposition` | `attachment; filename="{originalFilename}"`                         |

> Only available for messages where `hasAttachment: true`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.welkinhealth.com/developer-and-integration-guide/api-reference/sms.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
