Skip to content

Generate a magic login portal link for a subscription

POST
/api/subscriptions/{id}/portal-link

Generates a one-time magic login link that authenticates the subscription owner directly into the customer portal for the given subscription. Returns a customer-facing link and an admin-impersonation link. Pass expiry_days (max 21) to control how long the links stay valid; defaults to 7 days. Pass short_link: true to also receive a branded gro1.io short link for the customer-facing link (short_portal_link); omitted by default. The admin-impersonation link is never shortened. Pass tab to deep-link the portal to a specific tab (appended as &tab=<value>).

id
required
string
object
expiry_days
number
<= 21
short_link
boolean
tab
string
<= 50 characters

Magic portal links generated successfully

object
portal_link
required

Customer-facing magic login link to the subscription portal

string
admin_portal_link
required

Admin-impersonation magic login link (records the dashboard user as the actor in portal activity)

string
short_portal_link

Branded gro1.io short link that redirects to portal_link. Only present when short_link=true was requested

string
expires_at
required

ISO 8601 timestamp at which the generated links expire

string format: date-time

Subscription has no associated profile or account has no Shopify shop domain

Example
{
"error": "Subscription has no associated profile"
}