> ## Documentation Index
> Fetch the complete documentation index at: https://docs.carewithemma.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Patient Matching

> POST /Patient/$match

## POST /Patient/\$match

Looks up a sandbox patient by identifier.

<Warning>
  Sandbox behavior differs from real Epic here: this endpoint does exact slug/identifier lookup, not Epic's real probabilistic name/DOB matching, and a lookup on an unknown identifier auto-provisions a fixture patient instead of returning 404. Do not treat this always-succeeds behavior as how real Epic will behave.
</Warning>

### Request body

A FHIR Parameters resource:

```json theme={null}
{
  "resourceType": "Parameters",
  "parameter": [
    { "name": "identifier", "valueString": "patient-slug-here" }
  ]
}
```

The identifier parameter is required. A request with no identifier parameter returns 400.

### Response

200 OK, a FHIR Bundle:

```json theme={null}
{
  "resourceType": "Bundle",
  "type": "searchset",
  "total": 1,
  "entry": [
    {
      "resource": {
        "resourceType": "Patient",
        "id": "pat-1001",
        "name": [{ "family": "Lee", "given": ["Jordan"] }],
        "birthDate": "1990-04-12",
        "telecom": [{ "system": "phone", "value": "+15550001234" }]
      }
    }
  ]
}
```

### Example request

```bash theme={null}
curl -X POST 'https://your-emma-domain/api/Patient/$match' \
  -H "Authorization: Bearer <jwt>" \
  -H "Content-Type: application/json" \
  -d '{"resourceType":"Parameters","parameter":[{"name":"identifier","valueString":"pat-1001"}]}'
```
