> ## Documentation Index
> Fetch the complete documentation index at: https://docs.drpn.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Service catalog

> Verified backend facade services exposed through Darpan JSON-RPC.

Every method below is a verified backend facade service defined in `service/facade/*.xml` in the Darpan backend component (or a named integration component) and called as the JSON-RPC `method` value.

All methods require an authenticated session unless noted. Login, logout, and session-info methods accept anonymous calls so the UI can establish or end a session.

## Auth (`facade.AuthFacadeServices`)

| Method                   | Purpose                                                                                                                                                          |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `login#Session`          | Create an authenticated session from username/password and return the login-key token. Anonymous.                                                                |
| `logout#Session`         | End the current session. Anonymous-safe.                                                                                                                         |
| `logout#AllSessions`     | Invalidate every session for the current user.                                                                                                                   |
| `get#SessionInfo`        | Return current session, user, and active-tenant context. Anonymous-safe.                                                                                         |
| `save#ActiveTenant`      | Switch the active tenant for the session.                                                                                                                        |
| `save#UserSettings`      | Save per-user settings, including display name and preferred display timezone (IANA id; empty string clears the preference). Returns refreshed session metadata. |
| `verify#OwnPassword`     | Re-verify the current user's password.                                                                                                                           |
| `change#OwnPassword`     | Change the current user's password.                                                                                                                              |
| `change#ExpiredPassword` | Change the password of an account that cannot sign in until it is changed, without a session. Requires the account's current password.                           |

## Settings (`facade.SettingsFacadeServices`)

| Method                                                                      | Purpose                                                                                                                                                   |
| --------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `list#EnumOptions`                                                          | List enumeration options for settings surfaces.                                                                                                           |
| `get#LlmSettings` / `save#LlmSettings`                                      | Read and save AI provider settings.                                                                                                                       |
| `get#TenantSettings` / `save#TenantSettings`                                | Read and save tenant-level settings such as timezone.                                                                                                     |
| `list#TenantChatSpaces` / `save#TenantChatSpace` / `delete#TenantChatSpace` | Manage the tenant's registry of named Google Chat spaces. Webhook URLs are write-only and never returned. `delete` succeeds only for unreferenced spaces. |
| `get#UserNotificationDefault` / `save#UserNotificationDefault`              | Read and set the caller's own default chat space for the active tenant. Personal preference — no tenant write access required.                            |
| `test#SourceConnection`                                                     | Run a connectivity probe against a configured source.                                                                                                     |
| `list#SftpServers` / `save#SftpServer`                                      | List and save SFTP server records.                                                                                                                        |
| `list#NsAuthConfigs` / `save#NsAuthConfig`                                  | List and save NetSuite auth configurations.                                                                                                               |
| `list#NsRestletConfigs` / `save#NsRestletConfig`                            | List and save NetSuite RESTlet endpoint configurations.                                                                                                   |

## Schemas (`facade.JsonSchemaFacadeServices`)

| Method                           | Purpose                                                                                                        |
| -------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `list#JsonSchemas`               | List schemas visible in the active tenant.                                                                     |
| `get#JsonSchema`                 | Open one schema record.                                                                                        |
| `save#JsonSchemaText`            | Create or update a schema from schema text.                                                                    |
| `save#RefinedSchema`             | Save a schema refined through the verification flow.                                                           |
| `infer#JsonSchemaFromText`       | Infer a schema from a sample payload.                                                                          |
| `infer#JsonSchemaFromCsvText`    | Infer a flat schema from a CSV header row. Takes the sample text and whether that sample is the complete file. |
| `validate#JsonTextAgainstSchema` | Validate a JSON payload against a schema.                                                                      |
| `flatten#JsonSchema`             | Flatten a schema for field selection.                                                                          |
| `delete#JsonSchema`              | Delete a schema record.                                                                                        |

## Reconciliation (`facade.ReconciliationFacadeServices`)

| Method                                                                          | Purpose                                                                                                                                                                                                                                                                 |
| ------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `create#RuleSetRun` / `save#RuleSetRun`                                         | Create and update RuleSet-backed saved runs.                                                                                                                                                                                                                            |
| `create#CsvRun`                                                                 | Create a CSV-based saved run.                                                                                                                                                                                                                                           |
| `list#SavedRuns` / `save#SavedRunName` / `delete#SavedRun`                      | Manage saved runs.                                                                                                                                                                                                                                                      |
| `run#SavedRunDiff`                                                              | Execute a saved run.                                                                                                                                                                                                                                                    |
| `run#GenericDiff`                                                               | Execute an ad hoc compare from uploaded or text payloads.                                                                                                                                                                                                               |
| `list#Mappings` / `get#Mapping` / `create#Mapping` / `save#Mapping`             | Manage legacy reconciliation mappings.                                                                                                                                                                                                                                  |
| `save#DashboardPinnedMappings` / `save#DashboardPinnedSavedRuns`                | Save dashboard pin preferences.                                                                                                                                                                                                                                         |
| `list#Automations` / `get#Automation` / `save#Automation` / `delete#Automation` | Manage automations.                                                                                                                                                                                                                                                     |
| `pause#Automation` / `resume#Automation` / `run#AutomationNow`                  | Control automation execution.                                                                                                                                                                                                                                           |
| `list#AutomationExecutions`                                                     | List automation execution history.                                                                                                                                                                                                                                      |
| `reprocess#AutomationExecution`                                                 | Re-run a failed or dead-lettered automation execution.                                                                                                                                                                                                                  |
| `list#AutomationSourceOptions`                                                  | List configured source options for automation setup.                                                                                                                                                                                                                    |
| `list#GeneratedOutputs` / `get#GeneratedOutput` / `delete#GeneratedOutput`      | Manage generated reconciliation outputs.                                                                                                                                                                                                                                |
| `get#GeneratedOutputDifferences`                                                | Page through the difference rows of one generated output.                                                                                                                                                                                                               |
| `get#ReconciliationRunStatus`                                                   | Live status and per-stage timeline for one run. Tenant-gated.                                                                                                                                                                                                           |
| `cancel#ReconciliationRun`                                                      | Request that a running reconciliation stop. Cooperative — the run ends at its next checkpoint, so it may still report as running briefly.                                                                                                                               |
| `subscribe#RunNotification` / `unsubscribe#RunNotification`                     | Subscribe the caller to completion notification for one active run, snapshotting their default chat space, or remove that subscription.                                                                                                                                 |
| `sync#Automation`                                                               | Re-derive an automation's snapshot from its saved run. Overwrites compare scope, input mode, source definitions and exclusion filters; preserves name, schedule, window, chat space, active status and SFTP details. Never re-points the automation at a different run. |

## Slack (`facade.SlackFacadeServices`)

Connecting a Slack workspace to the active tenant. The bot token is never an output of any method here.

| Method                      | Purpose                                                                                                                                                                 |
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `begin#SlackInstall`        | Mint a single-use state token and return the Slack authorize URL to send the browser to. Does not contact Slack. Requires Slack app credentials on the deployment.      |
| `save#SlackBotToken`        | Connect a workspace from a pasted bot user OAuth token (`xoxb-`). The token is verified with Slack before storage, and workspace identity is taken from Slack's answer. |
| `get#SlackInstall`          | The active tenant's connected workspaces, with granted scopes. Reports `oauthAvailable` separately from whether Slack is usable at all.                                 |
| `list#SlackChannels`        | One page of channels from a connected workspace, for the channel picker. Reports when a workspace holds more channels than are listed.                                  |
| `disconnect#SlackWorkspace` | Deactivate a connected workspace. Refused while chat spaces still post through it, naming them.                                                                         |

## Config sharing (`facade.ConfigSharingFacadeServices`)

Sharing one API source configuration across tenants.

| Method                      | Purpose                                                                                                                                     |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `grant#ConfigTenantAccess`  | Add a tenant to a shared config's peer group. Requires tenant-admin rights on the target tenant and on a tenant already in the group.       |
| `revoke#ConfigTenantAccess` | Remove a tenant from the peer group by end-dating its grant. Never deletes the row, so the record of who could reach a credential survives. |
| `list#ConfigTenantAccess`   | Sharing state for one config: owning tenant, peer tenants, affected-tenant count, and whether the caller may manage the group.              |

## Source endpoints (`facade.SourceEndpointFacadeServices`)

Which endpoints of a connected system a given source configuration may read.

| Method                             | Purpose                                                                                                                                                               |
| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `list#SourceConfigEndpoints`       | Endpoints registered for a config type with their current enablement. The catalog comes from the connector registry; access rows supply only whether each is enabled. |
| `store#SourceConfigEndpointAccess` | Replace a config's endpoint enablement. Endpoints omitted from the list are explicitly disabled.                                                                      |

## Search (`facade.SearchFacadeServices`)

| Method                     | Purpose                                                                                                                 |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `search#NavigationTargets` | Power Ask Darpan search over schemas, saved runs, run results, SFTP servers, and NetSuite auth/endpoint configurations. |

## Integration components

Source-system facades ship in sibling Moqui components and follow the same JSON-RPC envelope:

| Component        | Facade                           | Methods                                                                                                  |
| ---------------- | -------------------------------- | -------------------------------------------------------------------------------------------------------- |
| `shopify-darpan` | `facade.ShopifyFacadeServices`   | `list#ShopifyAuthConfigs`, `get#ShopifyAuthConfig`, `save#ShopifyAuthConfig`, `delete#ShopifyAuthConfig` |
| `darpan-hotwax`  | `facade.HotWaxOmsFacadeServices` | `list#HotWaxOmsRestSourceConfigs`, `save#HotWaxOmsRestSourceConfig`, `delete#HotWaxOmsRestSourceConfig`  |

## Administration

The methods below are **not** part of the tenant product API. They serve the operator admin application and are reachable only by a super-admin: a caller must pass the `DARPAN_ADMIN_API` artifact fence and a super-admin content gate. A non-super-admin caller is denied before the service body runs.

### Tenants (`admin.TenantAdminServices`)

| Method              | Purpose                                                                                   |
| ------------------- | ----------------------------------------------------------------------------------------- |
| `create#Tenant`     | Create a tenant: the user group and its tenant settings in one transaction.               |
| `update#Tenant`     | Rename a tenant, change its timezone, or both.                                            |
| `deactivate#Tenant` | Hide a tenant from the tenant app and from active-tenant selection. A flag, not a delete. |
| `reactivate#Tenant` | Re-enable a deactivated tenant.                                                           |
| `get#TenantList`    | All tenants, including deactivated ones, with member counts.                              |
| `get#TenantDetail`  | One tenant with its settings and active members.                                          |

### Users (`admin.UserAdminServices`)

| Method                | Purpose                                                                                                       |
| --------------------- | ------------------------------------------------------------------------------------------------------------- |
| `create#UserAccount`  | Create a user with a temporary password, forced to change at first login. Credentials are shared out of band. |
| `update#UserAccount`  | Update a user's display name, email, or both.                                                                 |
| `disable#UserAccount` | Disable a user and revoke their live login keys. Disabling yourself is refused.                               |
| `enable#UserAccount`  | Re-enable a disabled user.                                                                                    |
| `reset#Password`      | Set a temporary password, forced to change at next login, and revoke live login keys.                         |
| `get#UserList`        | Paged search over username, email and display name.                                                           |
| `get#UserDetail`      | One user with account state and active tenant memberships.                                                    |

### Membership (`admin.MembershipAdminServices`)

| Method                    | Purpose                                                                                                                          |
| ------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `add#TenantMember`        | Add a user to a tenant with a tenant-scoped role. Both membership records are written together or not at all.                    |
| `update#TenantMemberRole` | Change a member's tenant role by end-dating the old permission row and creating the new one.                                     |
| `remove#TenantMember`     | Remove a user from a tenant by end-dating both membership records, and clear their active-tenant preference if it pointed there. |

### Migrations (`admin.MigrationAdminServices`)

| Method                     | Purpose                                                                                                                                      |
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `get#MigrationStatus`      | Registry and ledger state for every registered migration on the installation, in sequence order, with the most recent attempt's detail.      |
| `get#MigrationHistory`     | Every recorded attempt at one migration, newest first, each with its own sanitized failure detail.                                           |
| `run#PendingMigrations`    | Run every registered migration with no success recorded, in sequence order. Idempotent — a second call applies nothing.                      |
| `dryRun#PendingMigrations` | Preview what running the pending migrations would do. Writes dry-run ledger rows only, which never satisfy the already-applied check.        |
| `run#Migration`            | Run one named migration for targeted remediation. Parked migrations are refused, prerequisites enforced, already-applied migrations skipped. |
| `dryRun#Migration`         | Preview one named migration.                                                                                                                 |
| `set#MigrationEnabled`     | Park or unpark a migration. Parking lets the rest of a sweep proceed when one migration is broken, rather than stranding all of them.        |

### Admin session (`admin.ObserveAdminServices`)

| Method                 | Purpose                                                                                                                                   |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `get#AdminSessionInfo` | Fence probe and admin route guard: returns the operator identity when the caller clears both the artifact fence and the super-admin gate. |

## Per-method reference

The machine-readable contract for every method above lives in the
[generated OpenAPI reference](/api-reference/openapi.json), regenerated from the backend
facade XML (`./gradlew :runtime:component:darpan:generateApiContract`) and drift-checked
against this catalog in CI. How to read it:

* Each method has four schemas in `components.schemas`, named from its verb#noun:
  `<VerbNoun>Params` (request parameters, with `required` markers), `<VerbNoun>Result`
  (the response payload the hand-written UI types model), and the `...Request`/`...Response`
  JSON-RPC envelopes around them.
* Parameter and field descriptions come straight from the service definitions.
* Error behavior is uniform — see [JSON-RPC](/api-reference/json-rpc): protocol/dispatch
  failures use the `JsonRpcError` codes; business validation returns `result.ok=false`
  with `result.errors[]`.

For the transport contract used by all methods above, see [JSON-RPC transport](/api-reference/json-rpc).
