Skip to content
Join our SlackContact usGet started

Create Customer Portal Session

post/customer-portal/sessions

Create Customer Portal Session

Body ParametersExpand Collapse
return_url: string

The URL to redirect customers to if they click the back button on the customer portal.

subject_id: string

The ID or external ID of the subject to create the customer portal session for.

ReturnsExpand Collapse
expires_at: string

The date and time the customer portal session expires.

formatdate-time
subject_id: string

The ID of the subject for the customer portal session.

url: string

The URL to redirect to the customer portal session.

Create Customer Portal Session
curl https://api.uselark.ai/customer-portal/sessions \
    -H 'Content-Type: application/json' \
    -H "X-API-Key: $LARK_API_KEY" \
    -d '{
          "return_url": "https://example.com/dashboard",
          "subject_id": "subj_VyX6Q96h5avMho8O7QWlKeXE"
        }'
{
  "expires_at": "2025-11-01T16:50:13.177983+00:00",
  "subject_id": "subj_VyX6Q96h5avMho8O7QWlKeXE",
  "url": "https://billing.uselark.ai/?session_id=cps_PVkgykTxbGx686bwD9Bvt8wGcyNCzxIXgQJyN1sa5SZBcRcRskrNJDOiPpRoooBKg6NiZKBrn1IMZoCT6oZOise48dqQG3Ps"
}
Returns Examples
{
  "expires_at": "2025-11-01T16:50:13.177983+00:00",
  "subject_id": "subj_VyX6Q96h5avMho8O7QWlKeXE",
  "url": "https://billing.uselark.ai/?session_id=cps_PVkgykTxbGx686bwD9Bvt8wGcyNCzxIXgQJyN1sa5SZBcRcRskrNJDOiPpRoooBKg6NiZKBrn1IMZoCT6oZOise48dqQG3Ps"
}