digital-identity-platform-docs
digital-identity-platform-docs / supabase/functions/link-existing-account
supabase/functions/link-existing-account
Fileoverview
Link Existing Account Edge Function
Allows agencies to link existing Qaxal clients to their agency. The linked client's parent_agency_id is updated, creating a relationship.
Cloudflare Architecture Context
| Attribute | Value |
|---|---|
| Classification | 🔵 BACKEND-ONLY |
| Position | App Backend (agency management) |
| Receives Public Traffic | No (authenticated agency admins only) |
| Latency Sensitive | No |
| Safe to Retry | No (modifies relationships) |
| Failure Behavior | Fail-closed (returns error) |
Endpoint
POST /link-existing-account
Auth
Required - JWT verified, must be agency admin/owner