Skip to content

CreateCustomerSSOCode

Endpoint

POST /sso/customer/code

Description

Creates a one-time sign-in link for an existing enabled customer. The server returns the terminal URL for the customer's brand and preferred language. The link contains an opaque 64-character lowercase hexadecimal code and expires after 60 seconds. It can be redeemed only once, and only for the brand to which it was issued.

Codes are held in bounded process memory as hashes. They are invalidated if the server restarts, and the code is consumed by any redemption attempt, including one with a different brand.

Authorization

Send a manager session JWT in Authorization. The caller must have an enabled staff account and visibility to the target customer. The normal grant requires both access_crm = 1 and the explicit create_customer_sso = 1 permission. Only a global super admin (super_admin = 1) bypasses those two grant checks; a brand admin does not receive this permission automatically. CRM desk and brand visibility, target enablement, licensed API admission, and terminal access approval for the brand's configured terminal host are checked by the server. API admission alone does not approve the terminal host.

Body Parameters

{
  "customer_id": 1042
}
Field Type Required Description
customer_id integer Yes Positive ID of the enabled customer to sign in. The customer must be visible in the caller's current CRM brand/assignment/desk scope.

Success response

HTTP 200:

{
  "login_url": "https://terminal.example/en/platform?sso_code=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
  "expires_in": 60
}
Field Type Description
login_url string Complete terminal URL with the one-time sso_code query parameter. The path language comes from the customer's preferred language, falling back to the brand default and then en.
expires_in integer Code lifetime in seconds.

The response contains only these two fields. Do not treat the URL as a durable login link; request a new one after expiration or a failed redemption.

Errors

HTTP Error Description
400 INVALID_DATA customer_id is missing, is not an integer, or is not positive.
403 RET_NOT_ENOUGH_RIGHTS Router permission check rejected the staff session before the handler ran.
403 SSO_ACCESS_DENIED Caller is disabled, lacks the required grant/scope, or the customer is unavailable or outside current CRM visibility.
503 SSO_CONFIGURATION_INVALID The brand terminal URL or language could not be used to construct a safe link.
503 SSO_CODE_UNAVAILABLE Code generation failed or the bounded code store is full.
503 LICENSE_NOT_ACTIVE The required license lease is not active.