# patient_connection_request.expired

A pending PatientConnectionRequest expired after 30 days without a staff action.

Carebit delivers this required system event to every enabled webhook endpoint on the Project that created the request.

## Payload schema

- `object`
  - `api_version` (`any`)
  - `context` (`object`) - Present only when `source` is `api`. Identifies the acting project and API key.
    - `developer_platform_api_key_id` (`string | null`) - format: `uuid`
    - `developer_platform_project_id` (`string | null`) - format: `uuid`
  - `created_at` (`string`) - format: `date-time`; An ISO 8601 timestamp in UTC, with a `Z` suffix. For example, `2026-07-01T09:00:00Z`.
  - `data` (`object`)
    - `object` (`object`)
      - `available_actions` (`array`) - The actions the caller can take while this request is pending. The array is empty after resolution or expiry.
        - `items` (`string`) - enum: `connect_existing_patient`, `create_new_patient`, `deny`
      - `candidate` (`object | null`) - The strongest current match, or null when no match remains. Demographic, contact, and NHS number evidence determine the ranking; PatientConnection and Document counts break ties. Only matching demographic field names are disclosed. Existing values, contact and NHS number classifications, activity counts, alternative candidates, and Patient identifiers are not disclosed. POST `connect_existing_patient` to connect this recommendation.
        - `conflicting_fields` (`array`) - Reserved for compatibility. Carebit returns an empty array so the response cannot disclose whether a candidate has a particular contact or NHS number value.
          - `items` (`string`)
        - `matched_fields` (`array`) - The submitted demographic fields that match the recommended candidate. Contact and NHS number matches are not disclosed.
          - `items` (`string`)
        - `not_recorded_fields` (`array`) - Reserved for compatibility. Carebit returns an empty array so the response cannot disclose whether a candidate has a particular contact or NHS number value.
          - `items` (`string`)
      - `created_at` (`string`) - format: `date-time`; An ISO 8601 timestamp in UTC, with a `Z` suffix. For example, `2026-07-01T09:00:00Z`.
      - `expires_at` (`string`) - format: `date-time`; The time after which a pending PatientConnectionRequest expires if the Organization has not resolved it.
      - `id` (`string`) - format: `uuid`; The resource's unique identifier, formatted as an RFC 4122 version 4 UUID.
      - `links` (`object`) - URLs to related resources.
        - `dashboard` (`string`) - format: `uri`; The Carebit Admin URL listing Patient connection requests for the Organization. This is a Carebit UI URL, not a Developer Platform API URL. Carebit does not email staff when a request is created. Send this URL if you want someone to review pending requests.
        - `patient` (`string | null`) - format: `uri`; The Patient retrieve URL after an approved action. Null while the request is pending, denied, or expired.
      - `object` (`any`) - Discriminator value emitted at `object`.
      - `patient_id` (`string | null`) - format: `uuid`; The resulting Patient identifier after the Organization connects an existing Patient or creates a separate Patient. Null while pending, denied, or expired.
      - `resolved_outcome` (`string | null`) - enum: `connected_existing`, `created_new`, `denied`, `expired`, `null`; How the Organization resolved this request. Null while it is pending.
      - `status` (`string`) - enum: `pending`, `granted`, `denied`, `expired`; The lifecycle status of the PatientConnectionRequest. `granted` means a resulting PatientConnection exists.
      - `submitted` (`object`) - The Patient create payload that produced this request. Carebit echoes the fields you sent. It does not include existing-Patient fields you did not submit.
      - `updated_at` (`string`) - format: `date-time`; An ISO 8601 timestamp in UTC, with a `Z` suffix. For example, `2026-07-01T09:00:00Z`.
  - `developer_platform_project_id` (`string | null`) - format: `uuid`; The project ID whose credential caused the change. Null for `dashboard` events.
  - `id` (`string`) - Event identifier prefixed with `evt_`.
  - `livemode` (`boolean`) - `false` for test-event deliveries.
  - `object` (`any`)
  - `source` (`string`) - enum: `api`, `dashboard`; Origin of the change. `api` means a Developer Platform mutation; `dashboard` means a Carebit-initiated change.
  - `type` (`any`)

### Example payload

```json
{
  "id": "evt_00000000-0000-4000-8000-000000000012",
  "object": "event",
  "api_version": "v1",
  "created_at": "2026-01-01T09:00:00Z",
  "data": {
    "object": {
      "id": "00000000-0000-4000-8000-000000000041",
      "object": "patient_connection_request",
      "available_actions": [
        "connect_existing_patient",
        "create_new_patient",
        "deny"
      ],
      "candidate": {
        "conflicting_fields": [],
        "matched_fields": [
          "first_name",
          "last_name",
          "date_of_birth",
          "sex",
          "postcode"
        ],
        "not_recorded_fields": []
      },
      "created_at": "2026-01-01T09:00:00Z",
      "expires_at": "2026-01-31T09:00:00Z",
      "links": {
        "dashboard": "https://example.carebit.co/admin/patients/connection-requests",
        "patient": null
      },
      "patient_id": null,
      "resolved_outcome": null,
      "status": "expired",
      "submitted": {
        "date_of_birth": "1990-01-01",
        "first_name": "Alex",
        "last_name": "Morgan",
        "postcode": "SW1A 1AA",
        "sex": "female"
      },
      "updated_at": "2026-01-01T09:00:00Z"
    }
  },
  "developer_platform_project_id": null,
  "livemode": false,
  "source": "dashboard",
  "type": "patient_connection_request.expired"
}
```
