# Unrecognized SMS

**Base URL:** `https://api.welkinhealth.com/{tenantName}/{instanceName}/unrecognized-sms`

Unrecognized SMS messages are inbound texts from phone numbers not associated with any known patient.

***

## Get All Unrecognized SMS

**GET** `/unrecognized-sms`

Returns a paginated list of unrecognized inbound SMS messages.

### Query Parameters

| Parameter   | Type              | Required | Description              |
| ----------- | ----------------- | -------- | ------------------------ |
| `startDate` | string (ISO 8601) | No       | Filter from date         |
| `endDate`   | string (ISO 8601) | No       | Filter to date           |
| `status`    | string            | No       | `PENDING` or `RESOLVED`  |
| `page`      | integer           | No       | Page number (default: 0) |
| `size`      | integer           | No       | Page size (default: 20)  |

### Example Request

```bash
curl -X GET "https://api.welkinhealth.com/acme/live/unrecognized-sms?status=PENDING" \
  -H "Authorization: Bearer {access_token}"
```

### Example Response

```json
{
  "content": [
    {
      "id": "usms_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "fromNumber": "+15559991234",
      "toNumber": "+18005551000",
      "body": "Hello, I would like to schedule an appointment",
      "receivedAt": "2026-03-19T09:30:00Z",
      "status": "PENDING",
      "resolvedBy": null,
      "patientId": null
    }
  ],
  "totalElements": 1,
  "totalPages": 1,
  "page": 0,
  "size": 20
}
```

***

## Get Unrecognized SMS by ID

**GET** `/unrecognized-sms/{smsId}`

Returns a single unrecognized SMS record.

### Path Parameters

| Parameter | Type   | Required | Description                |
| --------- | ------ | -------- | -------------------------- |
| `smsId`   | string | Yes      | ID of the unrecognized SMS |

### Example Request

```bash
curl -X GET "https://api.welkinhealth.com/acme/live/unrecognized-sms/usms_a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
  -H "Authorization: Bearer {access_token}"
```

### Example Response

```json
{
  "id": "usms_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "fromNumber": "+15559991234",
  "toNumber": "+18005551000",
  "body": "Hello, I would like to schedule an appointment",
  "receivedAt": "2026-03-19T09:30:00Z",
  "status": "PENDING",
  "resolvedBy": null,
  "patientId": null
}
```

***

## Resolve Unrecognized SMS

**PATCH** `/unrecognized-sms/{smsId}`

Links the SMS to a known patient and marks it as resolved.

### Path Parameters

| Parameter | Type   | Required | Description                |
| --------- | ------ | -------- | -------------------------- |
| `smsId`   | string | Yes      | ID of the unrecognized SMS |

### Request Body

| Field       | Type   | Required | Description               |
| ----------- | ------ | -------- | ------------------------- |
| `patientId` | string | Yes      | ID of the patient to link |
| `status`    | string | Yes      | Must be `RESOLVED`        |

### Example Request

```bash
curl -X PATCH "https://api.welkinhealth.com/acme/live/unrecognized-sms/usms_a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{"patientId": "pt_7f3a9b2c-1d4e-4f8a-b5c6-d7e8f9a0b1c2", "status": "RESOLVED"}'
```

### Example Response

```json
{
  "id": "usms_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "fromNumber": "+15559991234",
  "toNumber": "+18005551000",
  "body": "Hello, I would like to schedule an appointment",
  "receivedAt": "2026-03-19T09:30:00Z",
  "status": "RESOLVED",
  "resolvedBy": "usr_1a2b3c4d-5e6f-7890-abcd-ef1234567890",
  "patientId": "pt_7f3a9b2c-1d4e-4f8a-b5c6-d7e8f9a0b1c2"
}
```


---

# Agent Instructions: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
