Generate a magic login portal link for a subscription
const url = 'https://api.usegro.co/api/subscriptions/example/portal-link';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"expiry_days":1,"short_link":true,"tab":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Body
Section titled “Request Body”object
Example generated
{ "expiry_days": 1, "short_link": true, "tab": "example"}Responses
Section titled “Responses”Magic portal links generated successfully
object
Customer link that signs them in to the portal on this subscription
Staff “open as customer” link (records the dashboard user as the actor in portal activity). Open within an hour
ISO 8601 timestamp after which the staff link can no longer be opened
Branded gro1.io short link that redirects to portal_link. Only present when short_link=true was requested
ISO 8601 timestamp at which the customer link expires
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
Example
{ "error": "Subscription has no associated profile"}