---
title: "Verify an Eli Lilly member and open a link session"
method: POST
path: "/webhooks/eli-lilly/link/profile"
tags: ["webhook"]
---

# Verify an Eli Lilly member and open a link session

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

Called server-to-server by the signup application after the member accepts the consent bullets and enters their email. Retrieves the member's profile from Eli Lilly using the correlation ID, verifies the submitted email matches it, and returns an opaque link-session token plus prefill fields.
`clinic_id` names which Eli Lilly environment the member came from. Their dev, qa and staging gateways run in parallel and each is provisioned as its own clinic under its own hospital, so the clinic is what resolves the gateway to call. Omitting it falls back to the configured clinic.
Returns 422 when the emails differ; the member-facing wording lives in the signup application.

## Request body

- EliLillyLinkProfileRequest
  - `clinic_id` integer, nullable — Which Eli Lilly environment this link belongs to, named by the clinic the member will join. Eli Lilly run several gateways in parallel (dev, qa, staging) and each is provisioned as its own clinic under its own hospital, so the clinic resolves the gateway to call. Optional: when omitted the configured ELI_LILLY_CLINIC_ID is used, which keeps existing callers working. The link session records the resolved programme, so /link/complete does not repeat it.
  - `consent` EliLillyConsent
    - `items` EliLillyConsentItem[], required — One entry per accepted document. At least one is required: the endpoint documents a 400 when consent is missing, and without minItems an empty array satisfies the schema, so a generated client could construct a consent payload that records no consent at all.
      - `document_key` string, required — Stable identifier for the accepted document
      - `document_version` string, required — Version of that document as shown to the member
    - `locale` string, required — Locale the consent copy was rendered in
  - `correlation_id` string, required — Correlation ID issued by Eli Lilly, held server-side by signup
  - `email` string, required — Email the member typed; verified against the Eli Lilly profile

## Response `200`

Member verified; link session opened

- EliLillyLinkProfileResponse
  - `is_existing_member` boolean, required — True when this email already has an RxFood account, so signup can show the existing-member confirmation rather than the new-account one
  - `link_session_token` string, required — Opaque handle to the server-side link session
  - `profile` EliLillyLinkProfile, required
    - `email` string, required — Authoritative email; the patient is created or matched on this
    - `first_name` string, nullable
    - `last_name` string, nullable
    - `phone_number` string, nullable

## Other responses

- `400` — Malformed correlation ID or missing consent items
- `401` — Invalid or missing webhook credentials
- `410` — Correlation ID expired or unknown
- `422` — Submitted email does not match the Eli Lilly account
- `501` — Eli Lilly account linking is not enabled
- `502` — Eli Lilly unavailable

---

[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)
