---
title: "Bind a patient to an Eli Lilly link session and register it back"
method: POST
path: "/webhooks/eli-lilly/link/complete"
tags: ["webhook"]
---

# Bind a patient to an Eli Lilly link session and register it back

`POST /webhooks/eli-lilly/link/complete`

Called server-to-server by the signup application once the patient exists. Binds the link session to that patient, records consent, and registers the RxFood patient id with Eli Lilly as their externalUserId.
A session can only ever bind to one patient. Retrying with the same patient_id is safe; a different one is rejected with 409.

## Request body

- EliLillyLinkCompleteRequest
  - `link_session_token` string, required
  - `patient_id` integer, required — Patient returned by the signup webhook

## Response `200`

Patient linked and registered with Eli Lilly

- EliLillyLinkCompleteResponse
  - `patient_id` integer, required
  - `status` 'linked', required — Terminal state of the link

## Other responses

- `400` — Malformed request
- `401` — Invalid or missing webhook credentials
- `409` — Link session is already bound to a different patient
- `410` — Link session expired
- `501` — Eli Lilly account linking is not enabled
- `502` — Registration delivery was ambiguous; retry with the same patient_id

---

[API](https://skmtc.dev/rxfoodapp/apis/inneranalytics-mnt-server.md) · [All operations](https://skmtc.dev/rxfoodapp/apis/inneranalytics-mnt-server/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/rxfoodapp/inneranalytics-mnt-server/revisions/0703cbbbefe8/schema)
