Skip to main content
POST
/
api
/
v1
/
subscriptions
/
portal
Create Portal Session
curl --request POST \
  --url https://api.entityml.com/api/v1/subscriptions/portal \
  --header 'Content-Type: application/json' \
  --data '
{
  "user_id": "<string>",
  "return_url": "<string>"
}
'
{
  "portal_url": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.entityml.com/llms.txt

Use this file to discover all available pages before exploring further.

Request

user_id
string
required
User ID whose subscription should be managed.
return_url
string
required
URL Stripe should redirect to after the portal session.

Response

portal_url
string
Stripe-hosted customer portal URL.

Example

from entityml import EntityMLClient

client = EntityMLClient()
portal = client.billing.create_portal_session(
    user_id="YOUR_USER_ID",
    return_url="https://entityml.com/dashboard",
)
print(portal["portal_url"])

Example response

{
  "portal_url": "https://billing.stripe.com/p/session/..."
}