identity99 عملية

Identity API

Accounts, authentication (OTP, passkey, password), sessions, roles, and saved locations.

Queries

QUERY

account

#

Get account by ID Requires permission: Platform admin, tenant admin, or querying own account

الوسائط

  • id!
يُرجع
QUERY

adminBlogAuthors

#

Authors for the admin picker.

الوسائط

  • tenantIdID
  • pagination
يُرجع!
QUERY

adminListTenantAccounts

#

List a tenant's staff accounts (owner + admins) with their config-lock state (platform-admin only). Backs the tenant Staff view where each row has a per-account config-lock toggle.

الوسائط

  • tenantId!
يُرجع[!]!
QUERY

adminTenantsLastStaffActivity

#

Most recent admin-panel activity per tenant, across each tenant's owner/admin staff, batched over tenant_ids (platform-admin only). Powers the "Last activity" column on the tenant list; tenants with no panel session are omitted from the result.

الوسائط

  • tenantIds[!]!
يُرجع[!]!
QUERY

exportAccounts

#

The accounts listAccounts returns for the same input, as a CSV file: every page at once, up to 5,000 rows. input.pagination is ignored. truncated says when more matched than the file holds. Email and phone are masked exactly as the list masks them. # Authorization Requires TenantAdmin or PlatformAdmin role. A staff seat needs both View users and Export data; the owner needs no grant.

الوسائط

  • input
  • details
يُرجع!
QUERY

formDraft

#

The caller's saved draft for a form, or null when there is none or it expired. Only ever reads the caller's own drafts.

الوسائط

  • formKeyString!
  • scopeKeyString

    افتراضي

    ""
يُرجع
QUERY

listAccountAddresses

#

List saved addresses for a specific account as admin.

الوسائط

  • input!
يُرجع!
QUERY

listAccountRoles

#

List all roles for a specific account

الوسائط

  • input!
يُرجع[!]!
QUERY

listAccounts

#

List accounts for tenant admin panel. Supports filtering by role (customer, driver, vendor, operator), account status, and search term. Results are paginated. # Authorization Requires TenantAdmin or PlatformAdmin role.

الوسائط

  • input
  • details
يُرجع!
QUERY

listSessionsAdmin

#

List sessions with optional filters (admin only). Requires TenantAdmin or PlatformAdmin role.

الوسائط

  • input!
يُرجع!
QUERY

me

#
يُرجع!
QUERY

myCommandRecents

#

The caller's command-palette history: pinned entries first, then the rest, each most recently used first; at most 70. Only ever reads the caller's own entries.

يُرجع[!]!
QUERY

myConsolePreferences

#

The caller's preferences for the current console. Never null: a caller who never saved one gets every field null, and the console shows its defaults. Preferences are kept per account and console, so an impersonating platform admin sees their own preferences for that tenant, never the owner's.

يُرجع!
QUERY

myLinkedAccounts

#

The providers connected to the signed-in account.

يُرجع[!]!
QUERY

myPartnerships

#

List all partnerships the current user has access to. Returns partnerships where the user has been granted a role with entity_kind = Partnership. This is used by the client to show a partnership switcher UI.

يُرجع!
QUERY

myPasskeys

#

List the authenticated account's registered passkeys.

يُرجع[!]!
QUERY

myPinnedRecords

#

The records the caller pinned in the current console, in the caller's order; at most 50. Pins are kept per account, console and role, so an impersonating platform admin sees their own pins for that tenant, never the owner's.

يُرجع[!]!
QUERY

mySavedLocations

#
يُرجع!
QUERY

mySessions

#

الوسائط

  • pagination!
  • sort

    Orders the whole list before it is paged. Omitted, most recently active first.

يُرجع!
QUERY

oauthProviderConfigs

مهجور#

سبب الإهمال: Use oauthProviderConfigsWithValues; BET-205

الوسائط

  • ownership
يُرجع[!]!
QUERY

oauthProviderConfigsWithValues

#

List the OAuth app credentials configured for the given owner scope. Secrets are never returned — each row exposes only has_secret. Platform scope requires a platform admin; tenant scope is the caller's own tenant.

الوسائط

  • ownership
يُرجع[!]!
QUERY

partnerStaff

#

List staff members of a partnership. Returns all accounts that have been granted roles scoped to the specified partnership. Useful for viewing and managing partnership staff. Requires: TenantAdmin, PlatformAdmin, or operating in the partnership context.

الوسائط

  • input!
يُرجع!
QUERY

permissionSet

#

Get a permission set by ID. Another tenant's set reads as null.

الوسائط

  • idID!
يُرجع
QUERY

permissionSets

#

List permission sets by context. Uses the tenant from the request context.

الوسائط

  • roleKind
  • app
يُرجع[!]!
QUERY

savedLocation

#

الوسائط

  • input!
يُرجع!
QUERY

signInAttempts

#

Who signed in to this workspace's console and who tried, newest first. Covers the last 90 days of console sign-ins only; the customer and driver apps are not part of it. The owner's to read: a staff seat is refused whatever its grants.

الوسائط

  • input!
يُرجع!
QUERY

socialLoginReadiness

#

Whether each social sign-in provider is actually usable for the calling tenant, combining the two settings that have to agree: the tenant's AuthPolicy (which decides whether apps show the button) and the tenant's OAuth credentials (which decide whether pressing it works). Both admin console pages read this so each can warn about the half the admin isn't currently looking at. Exposes no secret material — only which credential *fields* are missing.

يُرجع[!]!
QUERY

staffSessions

#

Every console session of this workspace, across the owner and all staff, most recently active first. Session.account says whose each one is, and Session.impersonated marks a support session opened on the owner's behalf. The owner's to read: a staff seat is refused whatever its grants. listSessionsAdmin remains the read for one account's sessions.

الوسائط

  • input!
يُرجع!
QUERY

viewerSession

#

The signed-in session of this request, or null when anonymous. Never errors, so a console can call it to learn whether it is signed in at all.

يُرجع

Mutations

MUTATION

adminChangeStaffEmail

#

Change a tenant staff account's email address (platform-admin only). The new address is applied immediately. markVerified decides whether it is trusted straight away or marked unverified with a verification code sent to it. Every session on the account is revoked either way, because email is a login identifier. Requires a fresh step-up elevation token — see adminResetStaffPassword.

الوسائط

  • input!
يُرجع!
MUTATION

adminEndImpersonation

#

End the current impersonation session (revoke it). Only meaningful when called from within an impersonation session; writes a tenant_impersonation_ended audit row attributed to the platform admin behind the session.

يُرجعBoolean!
MUTATION

adminImpersonateTenant

#

Start a platform-admin impersonation session for a customer tenant. Restricted to PlatformAdmin and gated on a fresh step-up token (X-Elevation), exactly like ownership transfer. On success the caller receives an act-as token pair scoped to the target tenant's owner; the platform admin behind it is recorded on the session and in the act claim, and a tenant_impersonation_started audit row is written with the supplied reason.

الوسائط

  • input!
يُرجع!
MUTATION

adminResetPassword

#

Reset an account's password as admin. If the account has an existing password credential, the hash is updated. If no password credential exists, one is created. Requires an admin-tier role. The owner's password is reset only by a platform admin, and another admin's only by the owner or a platform admin (FORBIDDEN otherwise).

الوسائط

  • input!
يُرجع!
MUTATION

adminResetStaffPassword

#

Reset a tenant staff account's password (platform-admin only). Two modes. SET_PASSWORD applies an admin-supplied password immediately and revokes every session on the account. SEND_RESET_EMAIL dispatches the ordinary self-service reset link so the user picks their own password; sessions survive until they complete it. Requires a fresh step-up elevation token: call requestStepUp(password) and attach the result as X-Elevation: <token>. Without it the mutation returns STEP_UP_REQUIRED. The target must be a live TenantOwner or TenantAdmin of tenantId, otherwise TARGET_NOT_TENANT_ADMIN.

الوسائط

  • input!
يُرجع!
MUTATION

adminSetAccountConfigLocked

#

Lock or unlock configuration editing for a tenant account (platform-admin only). A locked account keeps its Owner/Admin role for navigation but is barred from persisting tenant config & danger-zone changes. Used by the platform-admin tenant Staff view. Takes effect on the account's next access-token refresh.

الوسائط

  • tenantId!
  • accountId!
  • configLockedBoolean!
يُرجعBoolean!
MUTATION

cancelAccountDeletion

مهجور#

سبب الإهمال: Use cancelAccountDeletionResult; BET-205

الوسائط

  • input!
يُرجع!
MUTATION

cancelAccountDeletionResult

#

Cancel a pending account deletion request

الوسائط

  • input!
يُرجع!
MUTATION

completeAppleNativeLogin

#

Finish a native "Sign in with Apple": verify the OS-minted id-token and return the same AuthFlowResponse union as every other login path.

الوسائط

  • input!
يُرجع!
MUTATION

completeOauthLogin

#

Finish "Continue with Google/Apple": exchanges the code, resolves the account (existing link → verified-email auto-link → sign-up/deny), and returns the same AuthFlowResponse union as password/passkey login.

الوسائط

  • input
  • details
يُرجع!
MUTATION

completePasskeyAuthentication

#

الوسائط

  • input!
يُرجع!
MUTATION

completePasskeyRegistration

#

الوسائط

  • input!
يُرجع!
MUTATION

confirmPasswordReset

#

Confirm a password reset by submitting either the 4-digit code or the opaque URL token, plus the new password. Revokes all active sessions for the account on success.

الوسائط

  • input!
يُرجع!
MUTATION

createAccount

#

Create a new account as admin.

الوسائط

  • input!
يُرجع!
MUTATION

createPermissionSet

#

Create a new permission set.

الوسائط

  • input!
يُرجع!
MUTATION

createSavedLocation

مهجور#

سبب الإهمال: Use createSavedLocationResult; BET-205

الوسائط

  • input!
يُرجع!
MUTATION

createSavedLocationResult

#

الوسائط

  • input!
يُرجع!
MUTATION

deleteAccount

#

Delete the current user's account based on their account type policy

الوسائط

  • input!
يُرجع!
MUTATION

deleteOauthProviderConfig

مهجور#

سبب الإهمال: Use deleteOauthProviderConfigWithValues; BET-205

الوسائط

  • ownership!
  • provider!
  • clientKind
يُرجعBoolean!
MUTATION

deleteOauthProviderConfigWithValues

#

Remove an OAuth app credential for a provider within the given scope.

الوسائط

  • ownership!
  • provider!
  • clientKind
يُرجعBoolean!
MUTATION

deletePasskey

#

الوسائط

  • idID!
يُرجعBoolean!
MUTATION

deletePermissionSet

#

Delete a permission set by ID.

الوسائط

  • idString!
يُرجعBoolean!
MUTATION

deleteSavedLocation

#

الوسائط

  • input!
يُرجع!
MUTATION

discardFormDraft

#

Delete the caller's draft for a form. Idempotent: returns true whether or not a draft existed, meaning none remains.

الوسائط

  • formKeyString!
  • scopeKeyString

    افتراضي

    ""
يُرجعBoolean!
MUTATION

grantPartnerStaff

#

Grant staff access to a partnership. This allows adding staff members to a partnership. The staff member will be able to switch to this partnership context and perform operations based on their assigned role. Requires: TenantAdmin, PlatformAdmin, PartnershipOwner, or PartnershipManager role.

الوسائط

  • input!
يُرجع!
MUTATION

grantRole

#

Grant a role to an account

الوسائط

  • input!
يُرجع!
MUTATION

loginWithPassword

#

الوسائط

  • input!
يُرجع!
MUTATION

logout

مهجور#

سبب الإهمال: Use logoutResult; BET-205

الوسائط

  • input!
يُرجع!
MUTATION

logoutResult

#

الوسائط

  • input!
يُرجع!
MUTATION

pinRecord

#

Pin a record in the current console. A new pin goes last; pinning an already pinned record refreshes its label and href and keeps its place. Tenants can be pinned on the platform admin console; customers, drivers and orders on the tenant dashboard. Errors (extensions.code): PINNED_RECORD_KIND_NOT_ALLOWED for a kind the current console can't pin, PINNED_RECORD_LIMIT_REACHED when 50 records are already pinned, VALIDATION_ERROR.

الوسائط

  • input!
يُرجع!
MUTATION

recordCommandUse

#

Record that the caller ran a command-palette entry: adds it to their history or bumps its useCount, refreshing label, href and lastUsedAt. Keeps the 20 most recent unpinned entries. Errors (extensions.code): VALIDATION_ERROR.

الوسائط

  • input!
يُرجع!
MUTATION

refreshToken

#

الوسائط

  • input!
يُرجع!
MUTATION

removeCommandRecent

#

Remove an entry from the caller's command-palette history, pinned or not. Idempotent: returns true whether or not it existed, meaning none remains.

الوسائط

  • commandIdString!
يُرجعBoolean!
MUTATION

renamePasskey

#

الوسائط

  • input!
يُرجع!
MUTATION

reorderPinnedRecords

#

Put the caller's pins in the order of ids, first to last, and return them in their new order. Ids that aren't the caller's pins are ignored; the caller's pins missing from ids keep their relative order after the listed ones. Errors (extensions.code): VALIDATION_ERROR when ids repeats a pin or lists more than 50.

الوسائط

  • ids[!]!
يُرجع[!]!
MUTATION

requestPasswordReset

#

Start a self-service password reset by email. Always returns success regardless of whether the email matches an account — clients should always proceed to the confirm screen and rely on confirmPasswordReset to validate the code or token.

الوسائط

  • input!
يُرجع!
MUTATION

requestStepUp

#

Mint a single-shot elevation token after re-verifying the caller's password. Attach the returned token to the danger-zone mutation as X-Elevation: <token>. The token expires after 5 minutes or on first successful use, whichever comes sooner.

الوسائط

  • input!
يُرجع!
MUTATION

revokeOtherSessions

#

Sign out every other session of the calling account, keeping the one making this request. Config-locked accounts get CONFIG_LOCKED.

يُرجع!
MUTATION

revokePartnerStaff

#

Revoke staff access from a partnership. This removes a staff member's role for the partnership. They will no longer be able to switch to this partnership context. Requires: TenantAdmin, PlatformAdmin, PartnershipOwner, or PartnershipManager role.

الوسائط

  • input!
يُرجعBoolean!
MUTATION

revokeRole

#

Revoke a role from an account

الوسائط

  • input!
يُرجعBoolean!
MUTATION

revokeSession

مهجور#

سبب الإهمال: Use revokeSessionResult; BET-205

الوسائط

  • input!
يُرجع!
MUTATION

revokeSessionResult

#

الوسائط

  • input!
يُرجع!
MUTATION

saveBlogAuthor

#

الوسائط

  • input!
يُرجع!
MUTATION

saveFormDraft

#

Create or overwrite the caller's draft for a form. Every save bumps revision and pushes expiresAt to 30 days out. Errors (extensions.code): FORM_DRAFT_CONFLICT (with extensions.currentRevision) when baseRevision is stale, FORM_DRAFT_PAYLOAD_TOO_LARGE, FORM_DRAFT_LIMIT_REACHED, VALIDATION_ERROR.

الوسائط

  • input!
يُرجع!
MUTATION

setCommandPinned

#

Pin or unpin an entry in the caller's command-palette history. Errors (extensions.code): COMMAND_RECENT_NOT_FOUND when the caller has no entry with this id, COMMAND_RECENT_PIN_LIMIT_REACHED when 50 entries are already pinned, COMMAND_RECENT_NOT_PINNABLE for a record entry (tenant:<uuid>) — records are pinned with pinRecord — VALIDATION_ERROR.

الوسائط

  • commandIdString!
  • pinnedBoolean!
يُرجع!
MUTATION

setMyDispatchRoomLayout

#

Remember which layout the taxi Dispatch Room shows for the caller in the current console. Saving the same layout again is harmless. Returns the caller's preferences after the save.

الوسائط

  • layout!

    The layout to show from now on.

يُرجع!
MUTATION

setPassword

#

الوسائط

  • input!
يُرجع!
MUTATION

startAppleNativeLogin

#

Begin a native "Sign in with Apple" (the iOS system sheet). Returns the raw nonce the client SHA-256 hashes into its ASAuthorization request, and the state it echoes back on completion. No browser round-trip.

الوسائط

  • input!
يُرجع!
MUTATION

startEmailLogin

#

Begin a passwordless email-OTP login. The supplied email must belong to an existing, phone-registered, email-verified account in the resolved tenant — anything else returns a typed error (EMAIL_NOT_REGISTERED / EMAIL_NOT_VERIFIED) and the client should route the user back to phone-based registration.

الوسائط

  • input!
يُرجع!
MUTATION

startEmailVerification

#

Start email verification by sending an OTP code to the provided email. Requires authentication.

الوسائط

  • input!
يُرجع!
MUTATION

startOauthLogin

#

Begin "Continue with Google/Apple": returns the provider authorize URL and the state the website must store and echo on the callback.

الوسائط

  • input!
يُرجع!
MUTATION

startPasskeyAuthentication

#

الوسائط

  • input!
يُرجع!
MUTATION

startPasskeyRegistration

#

Begin enrolling a passkey for the authenticated account.

الوسائط

  • input!
يُرجع!
MUTATION

startPhoneVerification

#

الوسائط

  • input!
يُرجع!
MUTATION

switchPartnership

#

Switch to a different partnership context or clear partnership context. When switching to a partnership, the system verifies the user has a role with entity_kind=Partnership and entity_id=partnershipId. If authorized, new tokens are issued with the partnership context embedded. Pass null partnershipId to clear partnership context and return to personal account mode.

الوسائط

  • input!
يُرجع!
MUTATION

transferTenantOwnership

#

Transfer the TenantOwner role from the calling account to another account in the same tenant. Requires a fresh step-up elevation token (Phase 3). The client first calls requestStepUp(password) to mint a 5-minute single-shot JWT, then attaches it as X-Elevation: <token> on this mutation. If the header is missing, malformed, or the token has already been consumed, the mutation returns STEP_UP_REQUIRED so the client can prompt for re-auth. The token is only spent once the caller and target have been validated, so a refused target (for example TARGET_NOT_TENANT_ADMIN) leaves it usable for a retry. Both accounts' live console sessions are moved onto their new roles in the same transaction, so the next token refresh issues the new claims. Access tokens already issued keep their claims until they expire; clients should refresh after this mutation.

الوسائط

  • input!
يُرجع!
MUTATION

unlinkOauthAccount

#

Disconnect a provider from the signed-in account. Refuses to remove the account's last remaining sign-in method.

الوسائط

  • provider!
يُرجعBoolean!
MUTATION

unpinRecord

#

Unpin a record in the current console. Idempotent: returns true whether or not it was pinned, meaning it isn't now.

الوسائط

  • kind!
  • recordId!
يُرجعBoolean!
MUTATION

updateAccountAdmin

#

Update an account's profile fields as admin.

الوسائط

  • input!
يُرجع!
MUTATION

updateAccountStatus

#

Update an account's status (Active/Blocked) as admin.

الوسائط

  • input!
يُرجع!
MUTATION

updateMyPassword

#

الوسائط

  • input!
يُرجع!
MUTATION

updatePermissionSet

#

Update an existing permission set.

الوسائط

  • input!
يُرجع!
MUTATION

updateProfile

#

الوسائط

  • input!
يُرجع!
MUTATION

updateSavedLocation

مهجور#

سبب الإهمال: Use updateSavedLocationResult; BET-205

الوسائط

  • input!
يُرجع!
MUTATION

updateSavedLocationResult

#

الوسائط

  • input!
يُرجع!
MUTATION

upsertOauthProviderConfig

#

Create or replace an OAuth app credential (Google/Apple). Platform configs require a platform admin; tenant configs are scoped to the caller's tenant. Secrets are write-only — omit to keep the stored value.

الوسائط

  • input
  • details
يُرجع!
MUTATION

verifyEmailLogin

#

Verify the OTP from startEmailLogin and mint a session. Returns the same AuthFlowResponse shape as verifyOtp, so the client can dispatch on AuthSuccess / RestoreAccountRequired without branching on which channel sent the code.

الوسائط

  • input!
يُرجع!
MUTATION

verifyEmailOtp

#

Verify an email OTP code to confirm the email address. Requires authentication.

الوسائط

  • input!
يُرجع!
MUTATION

verifyOtp

#

الوسائط

  • input!
يُرجع!