Skip to content

Generate a magic login portal link for a subscription

POST
/api/subscriptions/{id}/portal-link
curl --request POST \
--url https://api.usegro.co/api/subscriptions/example/portal-link \
--header 'Content-Type: application/json' \
--data '{ "expiry_days": 1, "short_link": true, "tab": "example" }'

Generates links that sign the subscription owner in to the customer portal on this subscription. Returns a customer link and a staff “open as customer” link. Pass expiry_days (max 21, default 7) to set how long the customer link stays valid. The staff link must be opened within an hour and gives a 3 hour session. Pass short_link: true to also receive a branded gro1.io short link for the customer link (short_portal_link); the staff link is never shortened. Pass tab to open a specific tab.

id
required
string
Media typeapplication/json
object
expiry_days
number
<= 21
short_link
boolean
tab
string
<= 50 characters

Example generated

{
"expiry_days": 1,
"short_link": true,
"tab": "example"
}

Magic portal links generated successfully

Media typeapplication/json
object
portal_link
required

Customer link that signs them in to the portal on this subscription

string
admin_portal_link
required

Staff “open as customer” link (records the dashboard user as the actor in portal activity). Open within an hour

string
admin_portal_link_expires_at

ISO 8601 timestamp after which the staff link can no longer be opened

string format: date-time
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 customer link expires

string format: date-time

Example generated

{
"portal_link": "example",
"admin_portal_link": "example",
"admin_portal_link_expires_at": "2026-04-15T12:00:00Z",
"short_portal_link": "example",
"expires_at": "2026-04-15T12:00:00Z"
}

Subscription has no associated profile or account is not connected to Shopify

Media typeapplication/json

Example

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