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

# Link members

> Capture rewards consent and connect your app accounts to Hydra members.

Once you have [set up backend access](https://docs.usehydra.co.za/integrations/app-rewards/setup.md), link each consenting app account to a member.

Offer rewards enrollment to the signed-in user. Your app must already have
verified that account's phone number. Capture their explicit agreement to join
this business's rewards program, using the merchant's consent wording. Save the
wording identifier and the time they consented before sending the request.

Rewards consent is separate from marketing consent. New app-created memberships
are excluded from direct marketing; existing preferences and STOP choices stay
unchanged. Linking earns no check-in points and does not request a membership pass
or send an ordinary welcome.

Use an immutable app account reference as `external_member_id`. Use an opaque ID,
not a phone number or email address. The reference is case-sensitive, 1–128
characters, with no leading/trailing whitespace.

Save this as `member.json`, using your verified test identity and actual consent
timestamp:

```json theme={null}
{
  "external_member_id": "account_4821",
  "name": "Ada Example",
  "phone": "+27820000000",
  "consent": true,
  "consented_at": "2026-10-19T10:00:00Z",
  "consent_version": "rewards-v1"
}
```

```sh theme={null}
curl --silent --show-error \
  --request POST "$HYDRA_BASE_URL/integration/members" \
  --header "Authorization: Bearer $HYDRA_TOKEN" \
  --header "Content-Type: application/json" \
  --data @member.json
```

All six fields are required. Send the phone in international format. `consent`
must be true, `consented_at` must be a nonfuture RFC3339 timestamp, and
`consent_version` must be nonblank and at most 80 characters. The version identifies
the consent wording you recorded.

A new link returns `201`; an existing matching link returns `200`. Both return:

```json theme={null}
{
  "member_id": "7b9b1e00-1100-4000-8000-000000000001",
  "external_member_id": "account_4821",
  "status": "linked"
}
```

Save the returned member ID against the authenticated account on your backend.
The response does not disclose whether the person was already known to the business.

If a join response is lost, retry the same account reference and verified phone.
A replay returns the same link and preserves the original consent evidence; it
does not update the person's name, phone or consent wording. A new membership can
run existing join campaigns once, including a welcome gift if configured. Linking
an existing membership or replaying the join does not trigger another join award.

| Response | What your backend should do |
| - | - |
| `409 member_link_conflict` | Stop and check the app account/verified-phone records with Hydra support. The reference is linked to another phone, or the person already has a different account reference. |
| `403 forbidden` | The app link was withdrawn. Do not generate another account reference or silently join again. Contact Hydra for the appropriate resolution. |
| `400 invalid_body` | Correct the fields or actual consent record. Do not set consent true when it was not captured. |

Next: [Report activities](https://docs.usehydra.co.za/integrations/app-rewards/activities.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.