Affiliate SSO Link

POST /a/affiliates/sso-link

Mint a single-use link that signs an affiliate into the affiliate portal without a password — for embedding the portal in your own app (webview). Available on request: contact support to have it enabled for your account. Then turn it on under Settings → Customize → Security → Portal Embedding → Sign-in from your app; until then every call returns 403 sso_not_enabled. Call it from your server after your app has authenticated the user, then open the returned login_url. The link expires after 120 seconds and works once. Identify the affiliate by your own external_id, our affiliate_id, or email; external_id is linked on first match so later calls can send it alone. With create=true an affiliate that does not exist yet is created on the spot (just-in-time provisioning) — first_name and email are then required; such affiliates get no welcome e-mail and are app-only unless you send password_login=true. password_login=false makes any affiliate app-only (no password sign-in, no password-reset e-mail); true allows it again. Captcha is skipped; an affiliate who has set up two-factor authentication is asked for their code once per sign-in unless you turn off Ask for the 2FA code on app sign-ins under Settings → Customize → Security → Portal Embedding. If your affiliates use the portal on your own white-label domain, send it as host. To open the link in an <iframe> on your website instead of a webview, first add that site under Settings → Customize → Security → Portal Embedding.

Authentication

Domain ID — your network's tenant ID (header: X-Domain-Id)

API Key (header: X-Api-Key)

Secret Key (header: X-Api-Secret)

No API key yet? Start a 14-day free trial and generate a key from your dashboard's security settings. No credit card required.

Request Body *

Send at least one identifier: external_id, affiliate_id or email. With create=true, email and first_name are required as well.

Content-Type: application/json

FieldTypeRequiredDescription
external_idstringOne ofYour app's id for this user. Linked to the affiliate on first match, so later calls can send it alone.
affiliate_idintegerOne ofOur affiliate id.
emailstringOne ofAffiliate e-mail. Required when create=true.
createbooleanNoCreate the affiliate if no match is found.
first_namestringNoRequired when create=true.
last_namestringNo
companystringNo
phonestringNo
statusstring (ACTIVE | PENDING)NoStatus for a newly created affiliate. PENDING creates the account but returns no link until you approve it.
redirect_tostringNoOptional portal path to land on after login (must start with "/"). Defaults to the dashboard.
chromestring (full | minimal | none)NoHow much portal navigation to show. full (default): the normal top bar and sidebar. minimal: a compact bar with a menu drawer — best for a webview. none: page content only, for apps that drive navigation themselves by loading portal URLs. Within the session, any portal URL can switch it with ?chrome=full|minimal|none.
hoststringNoPortal host the link opens on — send it when your affiliates use the portal on your own white-label domain, since a sign-in holds only on the host it happened on. Must be your platform subdomain or one of your active, verified white-label portal domains. Defaults to your platform subdomain.
password_loginbooleanNoWhether this affiliate may also sign in with a password. false makes the account SSO-only: the login form, forgot-password mail and affiliate-login API refuse it. Affiliates created by this call default to false; existing affiliates keep their setting unless you send it.

Responses

StatusDescription
200Link minted
409external_id and affiliate_id/email point to different affiliates (identity_conflict), or another request is creating the same affiliate — retry (provisioning_in_progress)
403Sign-in from your app is turned off in Settings (sso_not_enabled), the affiliate is pending, suspended or deleted (account_not_active), or creating it would exceed your plan's affiliate limit (plan_limit_reached)
404Affiliate not found on this account
422Validation error — for example, no identifier sent (external_id, affiliate_id and email all missing), or a host that is not one of your portal domains