Quickstart
Deploy a complete ulex identity backend — application, organization, domain, mock SSO connection, admin user, and usable credentials — in under 60 seconds, over MCP, REST, the CLI, or raw JSON-RPC. Includes a real token exchange and a cleanup.
Three paths, same result. Pick the one that matches how you call tools. Every example below is real output, and every id in it appears again in the rest of these docs.
All hosted examples target https://ulexid.com (or http://127.0.0.1:3001 when running the local in-memory server via npx @ulexid/mcp-server). Simulator flows require allow_mocks: true on a non-HIPAA tenant, or local mode. Tenant context is always derived from your credential — never send an environment selector as a parameter.
#What "done" looks like
Resources created by this guide
| Object | Id | Notes |
|---|---|---|
application | app_01M3PSV7J8TBSPHG95CYSEX32B | first-party OIDC client, PKCE required |
organization | org_01M3PSV8HGTKQFCAYF9GDWGN3C | customer tenant inside your tenant |
domain | dom_01M3PSVCEGK9H35GZJK25HN08D | acme.example, verified |
user | usr_01M3PSV9GRT8GQGEG686AR1W9S | dana@acme.example, the org owner |
organization_membership | mem_01M3PSVDDRC5YN00BRZ8E7CNMT | role: owner |
connection | con_01M3PSVAG0QFJG99R0M5DXSR5A | strategy: mock_sso, state active |
group | grp_01M3PSVED0M9RJTYH5AC72C253 | engineering, source: rule |
session | ses_01M3PSVFC8MAB38QYAA8Q1K9MG | created by the simulated login |
authorization_grant | grt_01M3PSVGBGJT1ZXC840F2B3NXJ | single-use, exchanged for tokens |
What it costs and how it behaves
Nothing to install. Nothing to configure. No browser, no DNS record, no MFA app. The whole flow is 3–6 tool calls and finishes in well under a second of wall clock.
#Prerequisites
export ULEX_API_KEY="ulex_sk_live_7Qm2KpLx9Tb4Ns8RfWy3Zc1Hjf6Ee0Au"That is a tenant-admin API key minted from POST /tenants/current/api-keys. Keep it out of prompts, source control, and tool arguments — see Secret handling.
#Path A — MCP (recommended)
ulex exposes 113 tools over Streamable HTTP. If your harness speaks MCP, this is the shortest path.
ulex_bootstrap_app one-shot provisioning
ulex_simulate_login headless SSO, returns a code
ulex_exchange_code_for_tokens
ulex_introspect_token
ulex_search_audit_logs{
"name": "ulex_bootstrap_app",
"arguments": {
"application_name": "Acme Support",
"organization_name": "Acme Corp",
"organization_domain": "acme.example",
"admin_email": "dana@acme.example",
"admin_first_name": "Dana",
"admin_last_name": "Okafor",
"connection_strategy": "mock_sso",
"connection_name": "Acme SSO",
"seed_users": [
{
"email": "dana@acme.example",
"first_name": "Dana",
"last_name": "Okafor",
"job_title": "Support Lead",
"department": "Customer Success",
"groups": ["engineering"],
"mfa_enrolled": false,
"status": "active"
}
],
"create_scim_directory": true,
"create_webhook": {
"url": "https://hooks.example.com/ulex",
"events": ["user.created", "user.deleted", "session.created"]
}
}
}Result:
{
"application": {
"id": "app_01M3PSV7J8TBSPHG95CYSEX32B",
"object": "application",
"name": "Acme Support",
"slug": "acme-support",
"type": "first_party",
"client_id": "client_01M3PSV7J8TBSPHG95CYSEX32B",
"require_pkce": true,
"pkce_methods": ["S256"],
"cross_app_sso_enabled": true,
"cookie_domain": ".ulexid.com",
"default_locale": "en"
},
"client_secret": "cs_9fKq2WmB7yLt4NxZ1pRc6HdE0sJg3AuV8",
"organization": {
"id": "org_01M3PSV8HGTKQFCAYF9GDWGN3C",
"object": "organization",
"name": "Acme Corp",
"slug": "acme",
"sso_only": true,
"connection_id": "con_01M3PSVAG0QFJG99R0M5DXSR5A"
},
"domain": {
"id": "dom_01M3PSVCEGK9H35GZJK25HN08D",
"object": "domain",
"name": "acme.example",
"state": "verified",
"verified_at": "2026-09-29T14:42:10.000Z"
},
"connection": {
"id": "con_01M3PSVAG0QFJG99R0M5DXSR5A",
"object": "connection",
"name": "Acme SSO",
"state": "active",
"config": { "strategy": "mock_sso" },
"domains": ["acme.example"],
"domains_state": "verified"
},
"user": {
"id": "usr_01M3PSV9GRT8GQGEG686AR1W9S",
"object": "user",
"email": "dana@acme.example",
"email_verified": true,
"first_name": "Dana",
"last_name": "Okafor",
"display_name": "Dana Okafor",
"status": "active"
},
"membership": {
"id": "mem_01M3PSVDDRC5YN00BRZ8E7CNMT",
"object": "organization_membership",
"role": "owner",
"group_ids": ["grp_01M3PSVED0M9RJTYH5AC72C253"]
},
"directory": {
"id": "dir_01M3PSVBF8038RK2MW2N263Q2B",
"object": "directory",
"provider": "ulex_mock",
"state": "active",
"domain": "acme.example",
"scim_base_url": "https://ulexid.com/api/v1/scim/v2",
"inbound_scim_enabled": true
},
"scim_bearer_token": "scim_7Bq4Nxf2Vk9Lc3MdT6hR8wS1yP5aG0eJ",
"webhook": {
"id": "whk_01M3PSVK981SXWGKG9JXHC1P0Y",
"object": "webhook",
"status": "enabled",
"secret_prefix": "whsec_3Kq9"
},
"environment": "prod"
}{
"name": "ulex_simulate_login",
"arguments": {
"application_id": "app_01M3PSV7J8TBSPHG95CYSEX32B",
"email": "dana@acme.example",
"organization_id": "org_01M3PSV8HGTKQFCAYF9GDWGN3C",
"connection_id": "con_01M3PSVAG0QFJG99R0M5DXSR5A",
"response_type": "code"
}
}Result:
{
"session_id": "ses_01M3PSVFC8MAB38QYAA8Q1K9MG",
"grant_id": "grt_01M3PSVGBGJT1ZXC840F2B3NXJ",
"user_id": "usr_01M3PSV9GRT8GQGEG686AR1W9S",
"connection_id": "con_01M3PSVAG0QFJG99R0M5DXSR5A",
"outcome": "success",
"stage": "complete",
"authorization_url": "https://ulexid.com/api/v1/oauth2/authorize?response_type=code&client_id=client_01M3PSV7J8TBSPHG95CYSEX32B&redirect_uri=https%3A%2F%2Fapp.example.com%2Fauth%2Fcallback&scope=openid%20profile%20email%20offline_access&state=st_9Kq2WmB7yLt4NxZ&nonce=nc_3Fq8Lp2XvN9bTm&code_challenge=E9MelhoQ2YvW96fl8sW7aTtZbGd0mY6Xl0e8Q1sCk&code_challenge_method=S256",
"code": "ac_8Kq2WmB7yLt4NxZ1pRc6HdE0sJg3AuV8",
"code_expires_at": "2026-09-29T14:46:12.000Z",
"amr": ["pwd"],
"acr": null
}{
"name": "ulex_exchange_code_for_tokens",
"arguments": {
"application_id": "app_01M3PSV7J8TBSPHG95CYSEX32B",
"client_secret": "cs_9fKq2WmB7yLt4NxZ1pRc6HdE0sJg3AuV8",
"code": "ac_8Kq2WmB7yLt4NxZ1pRc6HdE0sJg3AuV8",
"redirect_uri": "https://app.example.com/auth/callback",
"code_verifier": "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk"
}
}Result:
{
"access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImtleV8wMU0zUFNWSkEwWVAyV0RQTTJSRFIxNU1HSCIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL3VsZXhpZC5jb20iLCJzdWIiOiJ1c3JfMDFNM1BTVjlHUlQ4R1FHRUc2ODZBUjFXOVMiLCJhdWQiOlsiY2xpZW50XzAxTTNQU1Y3SjhUQlNQSEc5NUNZU0VYMzJCIl0sImF6cCI6ImNsaWVudF8wMU0zUFNWN0o4VEJTUEhHOTVDWVNFWDMyQiIsImV4cCI6MTc5MDY5NjcxMiwiaWF0IjoxNzkwNjkzMTEyLCJuYmYiOjE3OTA2OTMxMTIsImp0aSI6Imp0aV8wMU0zUFNXQjJLSjhYUTRSRDdUNVY2VzhZMFoiLCJjbGllbnRfaWQiOiJjbGllbnRfMDFNM1BTVjdKOFRCU1BIRzk1Q1lTRVgzMkIiLCJvcmdfaWQiOiJvcmdfMDFNM1BTVjhIR1RLUUZDQVlGOUdEV0dOM0MiLCJvcmdfc2x1ZyI6ImFjbWUiLCJjb25uZWN0aW9uX2lkIjoiY29uXzAxTTNQU1ZBRzBRRkpHOTlSME01RFhTUjVBIiwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSBlbWFpbCBvZmZsaW5lX2FjY2VzcyIsInNpZCI6InNlc18wMU0zUFNWRkM4TUFCMzhRWUFBOFExSzlNRyIsImFtciI6WyJwd2QiLCJvdHAiLCJtZmEiXSwiYWNyIjoidXJuOnVsZXg6YWNyOm1mYSIsImh0dHBzOi8vdWxleGlkLmNvbS9jbGFpbXMiOnsib3JnX3JvbGUiOiJvd25lciIsImdyb3VwcyI6WyJlbmdpbmVlcmluZyJdfX0.8JmQ1vZ0Xh4n7cW2sT5yP9rB3kD6fG1aH0mNqU4wE7iO2pL5xC8vB1nMg0jKhR3tFyD7wZq2XvN9bTm4PlS6cGhJ1kWsA5",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "rt_51KpXq8WvN0kTzRb7YcLd2mXe9Pf6Sg3AuV8",
"refresh_token_expires_in": 2592000,
"id_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImtleV8wMU0zUFNWSkEwWVAyV0RQTTJSRFIxNU1HSCIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL3VsZXhpZC5jb20iLCJhdWQiOlsiY2xpZW50XzAxTTNQU1Y3SjhUQlNQSEc5NUNZU0VYMzJCIl0sInN1YiI6InVzcl8wMU0zUFNWOUdSVDhHUUdFRzY4NkFSMVc5UyIsIm5iZiI6MTc5MDY5MzExMiwiZXhwIjoxNzkwNjk2NzEyLCJpYXQiOjE3OTA2OTMxMTIsImF1dGhfdGltZSI6MTc5MDY5MzExMiwic2lkIjoic2VzXzAxTTNQU1ZGQzhNQUIzOFFZQUE4UTFLOU1HIiwiYW1yIjpbInB3ZCJdfQ.7Qm1YkA8eYh1uD8nE1sF5lB9gH2jM4kP6rS0tU3vW5xY7zA1bC3dE5fG7hJ9kL1mN3pQ5rS7tU9vW1xY3zA5bC7dE9fG1hJ3kL5mN7pQ9rS1tU3v",
"scope": "openid profile email offline_access"
}{
"name": "ulex_introspect_token",
"arguments": {
"token": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImtleV8wMU0zUFNWSkEwWVAyV0RQTTJSRFIxNU1HSCIsInR5cCI6IkpXVCJ9…",
"hint": "access_token"
}
}{
"active": true,
"token_type": "access_token",
"scope": "openid profile email offline_access",
"client_id": "client_01M3PSV7J8TBSPHG95CYSEX32B",
"sub": "usr_01M3PSV9GRT8GQGEG686AR1W9S",
"org_id": "org_01M3PSV8HGTKQFCAYF9GDWGN3C",
"sid": "ses_01M3PSVFC8MAB38QYAA8Q1K9MG",
"exp": 1790696712,
"iat": 1790693112
}#Path B — REST with curl
There is no single bootstrap endpoint — the primitive calls are three lines of jq and give you more control.
BASE="https://ulexid.com/api/v1" # or http://127.0.0.1:3001/api/v1 for local in-memory server
AUTH="Authorization: Bearer $ULEX_API_KEY"
JSON="Content-Type: application/json"<Step title="1. Create the application">
APP=$(curl -sS -X POST "$BASE/applications" \
-H "$AUTH" -H "$JSON" -H "Idempotency-Key: 1f4c9e2a-quickstart-app" \
-d '{
"name": "Acme Support",
"slug": "acme-support",
"type": "first_party",
"redirect_uris": ["https://app.example.com/auth/callback"],
"grant_types": ["authorization_code", "refresh_token"],
"response_types": ["code"],
"response_mode": "form_post",
"require_pkce": true,
"pkce_methods": ["S256"],
"cross_app_sso_enabled": true
}')
APP_ID=$(jq -r .id <<<"$APP")
echo "$APP"{
"id": "app_01M3PSV7J8TBSPHG95CYSEX32B",
"object": "application",
"name": "Acme Support",
"slug": "acme-support",
"type": "first_party",
"redirect_uris": ["https://app.example.com/auth/callback"],
"grant_types": ["authorization_code", "refresh_token"],
"response_types": ["code"],
"response_mode": "form_post",
"token_endpoint_auth_method": "client_secret_post",
"require_pkce": true,
"pkce_methods": ["S256"],
"grant_access_to_organization": true,
"organization_usage": "allow",
"sign_in_with_email_enabled": true,
"sign_up_enabled": true,
"cookie_domain": ".ulexid.com",
"cross_app_sso_enabled": true,
"branding": { "primary_color": "#4f46e5", "background_color": "#ffffff" },
"default_locale": "en",
"created_at": "2026-09-29T14:42:05.000Z",
"updated_at": "2026-09-29T14:42:05.000Z"
}</Step>
<Step title="2. Create the organization and verify the domain">
ORG=$(curl -sS -X POST "$BASE/organizations" \
-H "$AUTH" -H "$JSON" -H "Idempotency-Key: 1f4c9e2a-quickstart-org" \
-d '{"name":"Acme Corp","slug":"acme","sso_only":true}')
ORG_ID=$(jq -r .id <<<"$ORG")
DOM=$(curl -sS -X POST "$BASE/organizations/$ORG_ID/domains" \
-H "$AUTH" -H "$JSON" \
-d '{"domain":"acme.example","verification_strategy":"dns"}')
DOM_ID=$(jq -r .domain.id <<<"$DOM")
curl -sS -X POST "$BASE/organizations/$ORG_ID/domains/$DOM_ID/verify" -H "$AUTH" -H "$JSON" -d '{}' | jq{
"domain": {
"id": "dom_01M3PSVCEGK9H35GZJK25HN08D",
"object": "domain",
"organization_id": "org_01M3PSV8HGTKQFCAYF9GDWGN3C",
"name": "acme.example",
"state": "verified",
"verification_strategy": "dns",
"verified_at": "2026-09-29T14:42:10.000Z"
},
"state": "verified"
}When allow_mocks: true is enabled on a non-HIPAA tenant (or in the local in-memory server), the verify endpoint resolves immediately without a DNS lookup. Otherwise with dns strategy you must publish the TXT record first; see Domain verification.
</Step>
<Step title="3. Create the connection and activate it">
CON=$(curl -sS -X POST "$BASE/connections" \
-H "$AUTH" -H "$JSON" -H "Idempotency-Key: 1f4c9e2a-quickstart-con" \
-d '{
"name": "Acme SSO",
"organization_id": "'"$ORG_ID"'",
"domains": ["acme.example"],
"config": {
"strategy": "mock_sso",
"mock": {
"seed_users": [
{
"email": "dana@acme.example",
"first_name": "Dana",
"last_name": "Okafor",
"job_title": "Support Lead",
"department": "Customer Success",
"groups": ["engineering"]
}
]
}
}
}')
CON_ID=$(jq -r .id <<<"$CON")
curl -sS -X POST "$BASE/connections/$CON_ID/activate" -H "$AUTH" | jq '.id, .state'"con_01M3PSVAG0QFJG99R0M5DXSR5A"
"active"</Step>
<Step title="4. Create the admin user and the owner membership">
USR=$(curl -sS -X POST "$BASE/users" \
-H "$AUTH" -H "$JSON" -H "Idempotency-Key: 1f4c9e2a-quickstart-user" \
-d '{
"email": "dana@acme.example",
"email_verified": true,
"first_name": "Dana",
"last_name": "Okafor",
"job_title": "Support Lead",
"department": "Customer Success"
}')
USR_ID=$(jq -r .id <<<"$USR")
GRP=$(curl -sS -X POST "$BASE/organizations/$ORG_ID/groups" \
-H "$AUTH" -H "$JSON" -d '{"name":"Engineering","slug":"engineering","source":"rule"}')
GRP_ID=$(jq -r .id <<<"$GRP")
curl -sS -X POST "$BASE/organizations/$ORG_ID/members" \
-H "$AUTH" -H "$JSON" \
-d '{"user_id":"'"$USR_ID"'","role":"owner","group_ids":["'"$GRP_ID"'"]}' | jq{
"id": "mem_01M3PSVDDRC5YN00BRZ8E7CNMT",
"object": "organization_membership",
"organization_id": "org_01M3PSV8HGTKQFCAYF9GDWGN3C",
"user_id": "usr_01M3PSV9GRT8GQGEG686AR1W9S",
"role": "owner",
"group_ids": ["grp_01M3PSVED0M9RJTYH5AC72C253"],
"created_at": "2026-09-29T14:42:11.000Z"
}</Step>
<Step title="5. Read the client credentials">
curl -sS "$BASE/applications/$APP_ID/secret" -H "$AUTH" | jq{
"client_id": "client_01M3PSV7J8TBSPHG95CYSEX32B",
"client_secret": "cs_9fKq2WmB7yLt4NxZ1pRc6HdE0sJg3AuV8",
"token_endpoint_auth_method": "client_secret_post",
"issued_at": "2026-09-29T14:42:05.000Z"
}</Step>
</Steps>
#Path C — the ulex CLI
npm install -g @ulexid/cli # or: pnpm add -g @ulexid/cli
ulex auth login --api-key "$ULEX_API_KEY"ulex quickstart \
--application "Acme Support" \
--organization "Acme Corp" \
--domain acme.example \
--admin dana@acme.example \
--connection-strategy mock_sso \
--output json{
"application": { "id": "app_01M3PSV7J8TBSPHG95CYSEX32B", "client_id": "client_01M3PSV7J8TBSPHG95CYSEX32B" },
"organization": { "id": "org_01M3PSV8HGTKQFCAYF9GDWGN3C", "slug": "acme" },
"connection": { "id": "con_01M3PSVAG0QFJG99R0M5DXSR5A", "state": "active" },
"user": { "id": "usr_01M3PSV9GRT8GQGEG686AR1W9S", "email": "dana@acme.example" },
"scim": { "base_url": "https://ulexid.com/api/v1/scim/v2", "bearer_token": "scim_7Bq4Nxf2Vk9Lc3MdT6hR8wS1yP5aG0eJ" },
"client_secret": "cs_9fKq2WmB7yLt4NxZ1pRc6HdE0sJg3AuV8"
}Every MCP tool is reachable from the CLI with the same name, hyphenated:
ulex simulate login --application app_01M3PSV7J8TBSPHG95CYSEX32B --email dana@acme.example
ulex exchange-code --application app_01M3PSV7J8TBSPHG95CYSEX32B \
--code ac_8Kq2WmB7yLt4NxZ1pRc6HdE0sJg3AuV8 \
--redirect-uri https://app.example.com/auth/callback \
--code-verifier dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk
ulex introspect --token "$ACCESS_TOKEN"
ulex audit search --action authentication.succeeded --limit 5Global flags: --url <url>, --api-key <key>, --json, --help.
#Path D — raw MCP JSON-RPC
For harnesses that do not have an MCP client. Streamable HTTP, per MCP 2025-06-18.
#1. initialize
curl -sS -D- -X POST "https://ulexid.com/api/v1/mcp" \
-H "Authorization: Bearer $ULEX_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "MCP-Protocol-Version: 2025-06-18" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2025-06-18",
"capabilities": { "tools": { "listChanged": true } },
"clientInfo": { "name": "bootstrap-agent", "version": "1.4.0" }
}
}'Response headers carry the session handle:
HTTP/2 200
content-type: text/event-stream
mcp-session-id: 4f7a1c9e-8b2d-4a3f-9c61-5e0d7b1a2f84
mcp-protocol-version: 2025-06-18
x-ulex-request-id: req_01M3PSW9R0175NAW62NYR403R8Body (SSE framed):
event: message
data: {"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-06-18","capabilities":{"tools":{"listChanged":true},"logging":{}},"serverInfo":{"name":"ulex","version":"2025.9.1"},"instructions":"ulex derives tenant context from the credential. Start with ulex_list_tools. ulex_bootstrap_app provisions an identity backend in one call."}}#2. notifications/initialized
curl -sS -X POST "https://ulexid.com/api/v1/mcp" \
-H "Authorization: Bearer $ULEX_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "Mcp-Session-Id: 4f7a1c9e-8b2d-4a3f-9c61-5e0d7b1a2f84" \
-d '{"jsonrpc":"2.0","method":"notifications/initialized"}'Returns 202 Accepted with an empty body. Keep Mcp-Session-Id on every subsequent call; send DELETE /mcp with the same header to terminate.
#3. tools/call
curl -sS -X POST "https://ulexid.com/api/v1/mcp" \
-H "Authorization: Bearer $ULEX_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "Mcp-Session-Id: 4f7a1c9e-8b2d-4a3f-9c61-5e0d7b1a2f84" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "ulex_bootstrap_app",
"arguments": {
"application_name": "Acme Support",
"organization_name": "Acme Corp",
"organization_domain": "acme.example",
"admin_email": "dana@acme.example",
"connection_strategy": "mock_sso"
}
}
}'event: message
data: {"jsonrpc":"2.0","id":2,"result":{"content":[{"type":"text","text":"{\"application\":{\"id\":\"app_01M3PSV7J8TBSPHG95CYSEX32B\",…},\"organization\":{\"id\":\"org_01M3PSV8HGTKQFCAYF9GDWGN3C\",…}}"}],"structuredContent":{"application":{"id":"app_01M3PSV7J8TBSPHG95CYSEX32B"},"organization":{"id":"org_01M3PSV8HGTKQFCAYF9GDWGN3C"}},"isError":false}}Every ulex tool returns the resource in both content[0].text (JSON string) and structuredContent (typed object). Read structuredContent; fall back to parsing content[0].text if your client drops unknown fields.
#4. Errors are the same envelope
HTTP/2 429 Too Many Requests
retry-after: 17
ratelimit: "ulex";r=600, t=17
{"error":{"type":"rate_limited","code":"too_many_requests","message":"Rate limit exceeded. Back off and retry."}}The shield's 429 is an HTTP response before any MCP tool runs. Honor Retry-After. See Rate limits.
#What just got created
ten_01M3PSV6K0HFZ62YZ6AKB191WW your tenant
├── app_01M3PSV7J8TBSPHG95CYSEX32B the OIDC/SAML client
├── org_01M3PSV8HGTKQFCAYF9GDWGN3C "Acme Corp"
│ ├── dom_01M3PSVCEGK9H35GZJK25HN08D acme.example (verified)
│ ├── con_01M3PSVAG0QFJG99R0M5DXSR5A mock_sso connection
│ ├── dir_01M3PSVBF8038RK2MW2N263Q2B SCIM directory
│ ├── grp_01M3PSVED0M9RJTYH5AC72C253 "Engineering"
│ └── mem_01M3PSVDDRC5YN00BRZ8E7CNMT dana → owner
├── usr_01M3PSV9GRT8GQGEG686AR1W9S dana@acme.example
└── whk_01M3PSVK981SXWGKG9JXHC1P0Y webhook endpoint#Now what
ulex_create_organization + ulex_add_domain + ulex_verify_domain + seed users. Copy-paste recipe.
ulex_simulate_failure, ulex_simulate_mfa, and a force_failure connection. Deterministic error paths.
Provision, update, and deprovision users over /scim/v2 with a real bearer token.
Every action you just took is a hash-chained audit_event, queryable by action, actor_id, and request_id.
curl -sS "$BASE/audit-events?action=user.created&limit=5" -H "$AUTH" | jq '.data[] | {id, action, actor_type, outcome, timestamp}'{
"id": "aud_01M3PSVN7R3H0ECRPQVTDF1PY9",
"action": "user.created",
"category": "provisioning",
"actor_type": "agent",
"outcome": "success",
"timestamp": 1790693112
}#Tear it down
{ "name": "ulex_reset_tenant", "arguments": { "confirm": true, "keep_api_keys": true } }or:
ulex simulator reset --confirmDeletes every user, organization, connection, directory, session, grant, token, webhook and deployment in the tenant. API keys survive unless keep_api_keys is false. Non-destructive per-resource deletion is DELETE /organizations/{id}, DELETE /connections/{id}, DELETE /directories/{id} — those are soft deletes and remain in the audit log.
#Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
401 invalid_api_key | key rotated or revoked | GET /tenants/current/api-keys to list live keys |
403 insufficient_scope | key lacks ulex:admin or mcp:tools | mint a new key with the scope, see Scopes |
409 resource_exists on re-run | slugs collide | pass the same Idempotency-Key, or reuse the existing ids |
connection_not_active on login | forgot POST /connections/{id}/activate | activate, then retry |
mcp_tool_not_found | wrong server name | call ulex_list_tools and match exactly |
| Simulator endpoints rejected | running on hosted https://ulexid.com without opt-in | set allow_mocks: true on a non-HIPAA tenant, or test locally via npx @ulexid/mcp-server |
Full table: Common errors.