Skip to content

Integration

Customer API Request and Response Contract

Start Customer API integration with console credentials, token-scoped requests, management client credentials, request fields, response fields, and public endpoint coverage.

Choose this when

Use this page when your product backend needs to call Lamba public customer APIs for profile, memberships, authorization, admin runtime operations, domains, webhooks, or SMS add-ons.

The public surface is split by host:

HostUse for
https://test.id.uselamba.com / https://id.uselamba.comAuth, OIDC, tokens, refresh, logout, session context
https://test.api.uselamba.com / https://api.uselamba.comCustomer self-service and admin runtime APIs

Before you start

Decide which token model your request uses:

Token modelUse forCan call
Customer session tokenActions by a signed-in customer/v1/me/* and allowed /v1/admin/* routes
Management client tokenServer-side automation without a human session/v1/admin/* only

Customer self-service routes under /v1/me/* require a customer user session. Management clients are for admin automation and must stay server-side.

Get credentials from Console

Credentials and configuration values
ValueConsole sourceEnv varUsed for
Workspace IDTop Workspace selectorLAMBA_WORKSPACE_IDSession context and management client binding
Project IDTop Project selectorLAMBA_PROJECT_IDProject runtime scope for auth, roles, admin routes, domains, and webhooks
EnvironmentConsole environment badgeLAMBA_ENVKeeps sandbox and production auth/API data separate
App Client IDIntegration > App Clients > App clientLAMBA_CLIENT_IDHosted auth and OIDC Authorization Code + PKCE
Management Client IDIntegration > App Clients > Management clientLAMBA_MANAGEMENT_CLIENT_IDServer-side `client_credentials` automation
Management Client secretSecretIntegration > App Clients > Create or Rotate secretLAMBA_MANAGEMENT_CLIENT_SECRETServer-side `client_credentials` token exchange

Configure environment variables

LAMBA_CUSTOMER_AUTH_BASE=https://test.id.uselamba.com
LAMBA_CUSTOMER_API_BASE=https://test.api.uselamba.com
LAMBA_WORKSPACE_ID=<workspace-id>
LAMBA_PROJECT_ID=<project-id>
LAMBA_ENV=test
LAMBA_MANAGEMENT_CLIENT_ID=<management-client-id>
LAMBA_MANAGEMENT_CLIENT_SECRET=<management-client-secret>

Use production hosts only with production Workspace, Project, App Client, and webhook credentials.

Make the first request

For a signed-in customer, first get or refresh a customer session token from id.*, then call api.*.

GEThttps://test.api.uselamba.com/v1/me/context
Auth
Authorization: Bearer <customer-session-token>
Used for
Confirms the current user, Workspace, Project, environment, session, and roles
curl "$LAMBA_CUSTOMER_API_BASE/v1/me/context" \
  -H "Authorization: Bearer $CUSTOMER_SESSION_TOKEN" \
  -H "X-Correlation-Id: $(uuidgen)"

For server-side automation, create a management token:

POSThttps://test.id.uselamba.com/connect/token
Auth
Confidential management client credentials
Used for
Creates a short-lived token for `/v1/admin/*` automation
curl -fsS "$LAMBA_CUSTOMER_AUTH_BASE/connect/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials" \
  -d "client_id=$LAMBA_MANAGEMENT_CLIENT_ID" \
  -d "client_secret=$LAMBA_MANAGEMENT_CLIENT_SECRET" \
  -d "workspaceId=$LAMBA_WORKSPACE_ID" \
  -d "projectId=$LAMBA_PROJECT_ID" \
  -d "environment=$LAMBA_ENV" \
  -d "scope=customer.members.read customer.webhooks.read"

Then call admin routes:

curl "$LAMBA_CUSTOMER_API_BASE/v1/admin/members?limit=20" \
  -H "Authorization: Bearer $MANAGEMENT_ACCESS_TOKEN"

Request fields

Public customer API requests normally use bearer token scope:

Authorization: Bearer <customer-session-token-or-management-token>
X-Correlation-Id: <uuid-optional>

Do not send these internal console headers from customer apps:

X-Tenant-Id: ...
X-Project-Id: ...
X-Environment: ...

Management token request fields:

Request and response fields
FieldTypeRequiredMeaningNotes
grant_typestringRequiredOAuth grant for the token request.Use `client_credentials` for management clients.
client_idstringRequiredManagement Client ID from `Integration > App Clients`.-
client_secretstringRequiredManagement Client secret shown only when created or rotated.Keep server-side only.
workspaceIdstringRequiredWorkspace that owns the management request.-
projectIdstringRequiredProject runtime scope for admin operations.-
environmenttest | prodRequiredEnvironment for the scoped admin token.-
scopespace-separated stringOptionalRequested admin scopes.The issued token is still limited by the management client contract.

Profile update request fields:

Request and response fields
FieldTypeRequiredMeaningNotes
usernamestringOptionalCustomer-visible username.-
displayNamestringOptionalHuman-readable name shown in your product UI.-
biostringOptionalProfile biography.-
headlinestringOptionalShort profile headline.-
isPublicProfileEnabledbooleanOptionalWhether public profile visibility is enabled.-
linksobject | arrayOptionalCustomer profile links.At least one profile field is required in a PATCH body.

Response fields

Management token response:

Request and response fields
FieldTypeRequiredMeaningNotes
access_tokenstringRequiredBearer token for `/v1/admin/*` automation.-
token_typestringRequiredToken type.Use as `Authorization: Bearer <access_token>`.
expires_innumberRequiredToken lifetime in seconds.-
scopestringOptionalIssued scope string.-
expires_atISO-8601 datetimeRequiredAbsolute token expiry timestamp.-

GET /v1/me/context response:

Request and response fields
FieldTypeRequiredMeaningNotes
userobjectRequiredSigned-in Lamba User.Includes `id`, `email`, `username`, `displayName`, verification fields, and avatar URL when available.
activeWorkspaceobject | nullOptionalWorkspace selected by the scoped session.-
activeProjectobject | nullOptionalProject and environment selected by the scoped session.-
membershipobject | nullOptionalCurrent Project membership context.-
roleKeysstring[]RequiredRuntime Project roles on the active session.-
sessionobjectRequiredCurrent session metadata such as session ID, last seen time, MFA state, and AMR.-

Self-service response surfaces:

EndpointResponse shapeUse for
GET /v1/me/memberships{ items, nextCursor }Workspace/Project membership list
GET /v1/me/authorization{ roleKeys, effectivePermissions, permissionSources, isProjectAdmin }Feature visibility and authorization checks
GET /v1/me/security{ emailVerified, phoneVerified, mfaRequired, mfaEnrolled, mfaSatisfied, availableFactors, lastLoginAt }Security settings and sign-in state
GET /v1/me/linked-identities{ password, magicLink, phone, socialProviders }Connected sign-in methods
GET /v1/me/profileprofile fieldsCustomer profile display
PATCH /v1/me/profileupdated profile fieldsCustomer profile edits

Admin response surfaces:

Endpoint familyResponse shapeUse for
/v1/admin/membersmember summaries with user, membership type, status, source, roles, timestampsRuntime member administration
/v1/admin/invitationsinvitations with email, role, status, invite URL, expiryProject invitation lifecycle
/v1/admin/applicationsApp Client and Management Client metadataClient list, updates, and secret rotation
/v1/admin/domainsdomain verification and binding recordsCustom auth/API host lifecycle
/v1/admin/webhooks/*endpoints, event catalog, deliveries, retry resultsWebhook operations
/v1/admin/billing/addons/sms/*SMS status, tiers, subscribe/cancel resultsSMS add-on lifecycle

Public endpoint coverage

SurfaceEndpoints
Auth/v1/auth/register, /v1/auth/login/password, /v1/auth/login/magic-link/request, /v1/auth/login/magic-link/verify, /v1/auth/login/phone/request, /v1/auth/login/phone/verify, /v1/auth/refresh, /v1/auth/logout
OIDC/.well-known/openid-configuration, /connect/authorize, /connect/token, /.well-known/jwks.json, /connect/userinfo
Session context/v1/sessions/switch-context
Self-service/v1/me/context, /v1/me/memberships, /v1/me/authorization, /v1/me/security, /v1/me/linked-identities, /v1/me/profile
Admin runtime/v1/admin/members, /v1/admin/invitations, /v1/admin/applications, /v1/admin/domains, /v1/admin/webhooks/*, /v1/admin/authorization/catalog, /v1/admin/roles, /v1/admin/permissions
SMS add-on/v1/admin/billing/addons/sms/status, /v1/admin/billing/addons/sms/tiers, /v1/admin/billing/addons/sms/subscribe, /v1/admin/billing/addons/sms/cancel

Done when

Done when

  • `GET /v1/me/context` returns the expected user, Workspace, Project, and environment.
  • `GET /v1/me/authorization` is used before showing privileged UI.
  • Management client tokens are created only on your server and used only for `/v1/admin/*`.
  • Profile PATCH sends at least one supported field and handles validation errors.
  • SMS, domains, and webhooks are wired only after the basic auth/session path works.

Troubleshooting

SymptomLikely causeFix
401Token missing, expired, revoked, or wrong hostRefresh once, then restart login or management token exchange
403Token is valid but lacks Project permissionRead /v1/me/authorization and adjust Project roles
400 customer_auth_context_binding_requiredworkspaceId or projectId missing on context/token requestUse the top console selectors and pass both values
409State conflict, duplicate identity, or stale editReload current state before retrying
402Plan or usage limit blocked the operationShow upgrade/contact-admin path and avoid blind retries
429Rate limitedHonor Retry-After and back off
  • API Overview: /docs/reference/api-overview
  • OpenAPI and Postman: /docs/reference/openapi-postman
  • Error Reference: /docs/reference/errors
  • Request Scoping: /docs/concepts/request-scoping
  • Webhooks Integration: /docs/quickstart/webhooks