TenanciTenanci

Help centerAPI referenceCustomer portal

Customer portal

Access links for end customers to connect their domain and adjust branding.

Get the portal settings

GET/projects/{id}/portalprojects:read

What the end customer can do in the portal. Without settings, returns the default (off).

Parameters

  • idpath · stringrequired

    Resource id (prj_…, dom_…)

Request

cURL
curl "https://api.tenanci.com/v2/projects/prj_8f3k2m/portal" \
  -H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx"

Response 200

{
  "enabled": true,
  "domains": true,
  "brand": true,
  "analytics": true,
  "maxDomains": 1,
  "allowExtraCharge": false,
  "templateDomainId": "dom_4h7n1q",
  "exposeTenant": false,
  "supportEmail": "suporte@agendafacil.com",
  "welcome": "Conecte o domínio da sua barbearia e ajuste a marca."
}

Configure the portal

PUT/projects/{id}/portalprojects:writeGrowth+

Only the fields you send change. Returns the full settings. The template domain must belong to this project (invalid_template).

Parameters

  • idpath · stringrequired

    Resource id (prj_…, dom_…)

Body

  • enabledboolean

    Turns the portal on (required to create links).

  • domainsboolean

    The customer can connect their own domain.

  • brandboolean

    The customer can adjust their domain's logo, colors and favicon (published right away).

  • analyticsboolean

    The customer sees their own domain's analytics.

  • maxDomainsinteger≥ 1, ≤ 20

    Domains per customer (default 1).

  • allowExtraChargeboolean

    Lets the customer go over the plan's domain limit (the extra-domain charge is yours).

  • templateDomainIdstring | null

    Template domain of this project: its published TailorKit is copied to domains connected through the portal.

  • exposeTenantboolean

    Domains connected through the portal expose the customer's data as window.TENANCI.

  • supportEmailstring | null

    Support email shown in the portal.

  • welcomestring | null

    Welcome message at the top of the portal.

Request

cURL
curl -X PUT "https://api.tenanci.com/v2/projects/prj_8f3k2m/portal" \
  -H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"enabled":true,"maxDomains":1,"templateDomainId":"dom_4h7n1q","supportEmail":"suporte@agendafacil.com","welcome":"Conecte o domínio da sua barbearia e ajuste a marca."}'

Response 200

{
  "enabled": true,
  "domains": true,
  "brand": true,
  "analytics": true,
  "maxDomains": 1,
  "allowExtraCharge": false,
  "templateDomainId": "dom_4h7n1q",
  "exposeTenant": false,
  "supportEmail": "suporte@agendafacil.com",
  "welcome": "Conecte o domínio da sua barbearia e ajuste a marca."
}

Create a portal link for a customer

POST/projects/{id}/portal/sessionsdomains:writeGrowth+

Like Stripe's customer portal: call it from your backend and send the url to the customer (or redirect). The secret goes in the fragment (#), out of logs and the Referer, and is only shown in this response. The link lasts 60 min by default (up to 24 h) and the portal must be on (otherwise 400 portal_disabled). Domains the customer connects join the project with the tenantId already set.

Parameters

  • idpath · stringrequired

    Resource id (prj_…, dom_…)

Body

  • tenantIdstringrequiredmin 1, max 200

    Customer id in your system.

  • tenantDataRecord<string, string | number | boolean | null>

    Customer data (the name shows in the portal), sent to the origin on connected domains.

  • returnUrlstring | null

    https address for the back-to-your-app button.

  • emailstring | null

    Customer email (for the record).

  • ttlMinutesinteger≥ 5, ≤ 1440

    Link lifetime in minutes (default 60, up to 1440).

Request

cURL
curl -X POST "https://api.tenanci.com/v2/projects/prj_8f3k2m/portal/sessions" \
  -H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"tenantId":"barbearia-123","tenantData":{"name":"Barbearia do Zé","plan":"pro"},"returnUrl":"https://app.agendafacil.com/configuracoes","ttlMinutes":60}'

Response 201

{
  "id": "pss_01jb2x7k9m",
  "url": "https://app.tenanci.com/portal#pss_01jb2x7k9m.Yk3pQ9vT2mXc8LwR5nB7aZ1dF4gH6jK0",
  "expiresAt": "2026-10-14T13:00:00.000Z"
}