SkillhabitDocs

Create a User and Sign-In Link

Provision a Skillhabit user over the External API, then open the product with a pre-signed login link.

What This Is For

Your portal or middleware already knows who the person is. You create (or reuse) their Skillhabit account, then hand them a pre-signed sign-in link so they land in the product without Magic Links.

Who This Is For

Integration developers building partner portals, HR tools, or custom launchers. Admins need an API key enabled for the workspace.

Outcome

  1. A Skillhabit userId for that person.
  2. A time-limited preSignedInLink you open (or redirect to) in the browser.

Steps

Replace {BASE} with https://customer-api.baloolearning.com/v1 (or your provided host). Replace the bearer token with your credential.

1. Create the User

POST {BASE}/users
Authorization: Bearer {your-api-credential}
Content-Type: application/json
{
  "email": "alex@example.com",
  "firstName": "Alex",
  "lastName": "Learner",
  "language": "EN",
  "sendWelcomeEmail": false
}

Example response (201):

{
  "userId": "7f9c2a1e-4b8d-4f6a-9c2e-1d3b5a7e9c01",
  "newUser": true
}

If the email already exists, Skillhabit still returns a userId and newUser is false—safe to call again from a portal.

No mailbox? Use a unique address on @noemail.skillhabit.com (for example partner-48291@noemail.skillhabit.com). Skillhabit never sends system email there. Those users cannot use Magic Links—plan this sign-in link (or SSO) instead. See Users Without a Real Email.

POST {BASE}/auth?redirectUri=https%3A%2F%2Fyourworkspace.skillhabit.com%2Flearn
Authorization: Bearer {your-api-credential}
Content-Type: application/json
{
  "userId": "7f9c2a1e-4b8d-4f6a-9c2e-1d3b5a7e9c01"
}

You can send email instead of userId. If both are present, userId wins.

redirectUri is a query parameter (URL-encoded). After verification, Skillhabit continues to that URL when you supply one.

Example response (200):

{
  "preSignedInLink": "https://yourworkspace.skillhabit.com/auth/verify?secret=…&loginId=…&customerId=…&redirectUri=…",
  "expiresAt": 1700000000000
}

expiresAt is epoch milliseconds (UTC). Open preSignedInLink before it expires.

3. (Optional) Grant App Access

Learners often only need Learn. App ids on the API use these enum values:

API applicationIdProduct app
LEARNLearn
CREATECreate
ANALYSEAnalyze
FOLLOW_UPFollow Up
ACHIEVEMENTSCertificates
POST {BASE}/users/7f9c2a1e-4b8d-4f6a-9c2e-1d3b5a7e9c01/access/ADD
Authorization: Bearer {your-api-credential}
Content-Type: application/json
{
  "applicationId": "LEARN"
}

Use …/access/REMOVE with the same body to revoke.

curl Skeleton

BASE="https://customer-api.baloolearning.com/v1"
TOKEN="YOUR_API_CREDENTIAL"

USER_JSON=$(curl -sS -X POST "$BASE/users" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"email":"alex@example.com","firstName":"Alex","lastName":"Learner","language":"EN","sendWelcomeEmail":false}')

USER_ID=$(printf '%s' "$USER_JSON" | python3 -c 'import sys,json; print(json.load(sys.stdin)["userId"])')

curl -sS -X POST "$BASE/auth?redirectUri=https%3A%2F%2Fyourworkspace.skillhabit.com%2Flearn" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"userId\":\"$USER_ID\"}"