Skip to main content
Generated from the same public contract that feeds the Monaco editor. Declaration-marked deprecated compatibility methods are intentionally excluded. Do not edit this page manually.
This page contains 75 methods. Search the docs for an exact method name, or use this index:

api.createDatabase()

Creates a logical database. The server assigns databaseId, version, and timestamps; never generate or send those values. A normal database needs at least one definition. Notes:
  • Unavailable with readOnly: true (throws an error).

Signature

Example

api.cloneDatabase()

Clones a logical database by name. Notes:
  • Unavailable with readOnly: true (throws an error).
  • By default waits for the clone and returns cloned database metadata.
  • Set { async: true } to start a backend clone task and return immediately with an accepted response.
  • Omit name to use the backend default source-name plus _Clone.

Signature

Example

api.exportDatabase()

Exports a logical table, saved view, or materialized view by name directly into Storage as CSV, TSV, NDJSON, or XLSX. The root and every structured join may independently target any of these relation types. Notes:
  • Unavailable with readOnly: true (throws an error).
  • By default waits for the export, final compose, and storage entry persistence.
  • CSV is the default and its dialect, headers, and byte map are indexed during upload.
  • XLSX streams directly from the database through the native Storage writer into the final resumable upload, preserves database value types where Excel supports them, and runs a server-side COUNT(*) before starting. A failed export is discarded and can be retried by its job; a header row leaves 1,048,575 data rows available.
  • By default the call completes synchronously in its current runtime. Set async: true to queue it on Processor and receive a jobId.
  • Omit storageDestination for private user storage, use ROOT for Explorer root, or provide an accessible Explorer folder storageEntryId.

Signature

Example

api.startDatabaseOperation()

Explicitly starts an UPDATE, DELETE, reviewed view mutation, or TRUNCATE in Operations. Existing mutation methods remain synchronous. This call cannot join transactionDatabase. System messages are suppressed by default; set skipNotification: false to opt in. Retry resumes the remaining durable workset without repeating committed batches.

Signature

Example

api.importDatabase()

Validates a Storage file and creates an import operation; System messages default off.

Signature

api.updateDatabaseImportMapping()

Revalidates a corrected source-to-target mapping.

Signature

api.commitDatabaseImport()

Starts the transactional write after a reviewed preview.

Signature

api.updateDatabase()

Updates selected logical-database fields by name. The public contract requires the current version for optimistic locking; send only the fields that should change. Do not copy server-owned databaseId, timestamps, or size into this payload. Notes:
  • Unavailable with readOnly: true (throws an error).

Signature

Example

api.deleteDatabase()

Soft-deletes a logical database and its active partition subtree by name. Notes:
  • Unavailable with readOnly: true (throws an error).

Signature

Example

api.restoreDatabase()

Restores a deleted logical database by its original name. The name must identify exactly one accessible deleted database; for ambiguous names select the database by ID through REST or the UI. Strings always mean names. Notes:
  • Unavailable with readOnly: true (throws an error).

Signature

Example

api.truncateDatabase()

Removes all rows from a logical database selected by name. Notes:
  • Unavailable with readOnly: true (throws an error).
  • TRUNCATE does not create row audit events, even when database audit is enabled.
  • Use an ordinary filtered delete, such as primary key IS NOT NULL, to preserve row audit events.
  • Identity counters are preserved by default.
  • Set restartIdentity only when generated key reuse is explicitly intended.

Signature

Example

api.transactionDatabase()

Runs database-data operations inside a short-lived transaction. Notes:
  • Commits automatically when the callback resolves.
  • Rolls back automatically when the callback throws.
  • The default timeout is 15,000 ms.
  • Use { flexTimeout: true } when the transaction intentionally needs the enclosing execution’s remaining timeout budget.
  • Long transactions reserve a database connection and may retain locks; keep waits and remote side effects outside the callback when possible.
  • SERIALIZABLE is the default isolation level.
  • Parallel tx.* operations are rejected; await each tx.* call sequentially.

Signature

Example

api.getDatabaseData()

Reads rows from a database, view, or materialized view using the structured query shape. Notes:
  • This is the canonical read API.
  • Pass take: null for a bounded 2,000-row page without a warning.
  • Omitting take also uses 2,000 rows and logs one warning per execution.

Signature

Example

api.getDatabaseDataRow()

Reads one matching row from a database, view, or materialized view in a single operation, returning null when absent. The query supports fields, filter, joins and sort but not take, skip or count. Specify sort when choosing among multiple matching rows matters. Example: const customer = await api.getDatabaseDataRow(‘customers’, { filter: { field: ‘customerId’, op: ‘eq’, value: customerId } });

Signature

api.countDatabase()

Counts matching rows in a database, view, or materialized view with one query.

Signature

api.walkDatabaseData()

Processes a large database, view, or materialized-view result in sequential, awaited batches without collecting all rows in the isolate. Specify query.take or options.fullScan:true. Every non-final batch has exactly batchSize rows when available (default 10,000). The callback may await writes; do not accumulate batches in an array.

Signature

Example

api.getDatabaseAudit()

Reads newest-first audit events. Prefer narrow fields and changed/filter over a full snapshot.* or changes.* payload. Missing requested paths return null.

Signature

api.insertDatabaseData()

Inserts rows. Pass options to control the response: return defaults to true and onlyKeys returns only primary-key fields. Insert always validates the complete row required for creation; patch is not an insert option. Notes:
  • Low-code mutations execute atomically in one transaction within the remaining execution memory/time budget. An explicit caller transaction retains its configured timeout.
  • REST/public SDK requests retain the 100,000-row limit per request.
  • return defaults to true and includes full rows. return: false omits data; onlyKeys returns primary keys only. Returning full rows has a higher response-memory cost.
  • Unavailable with readOnly: true (throws an error).

Signature

Example

api.upsertDatabaseData()

Creates missing rows and PATCHes only properties present in each conflicting row. This is the default: omit unrelated properties rather than reading a full row first. A present null clears a nullable property; an omitted or undefined property is unchanged. For a non-nullable property, null uses its declared database default; without a default it fails. Pass { patch: false } only for the legacy full-replacement conflict behavior. Pass { return: false } to skip returned rows, or { onlyKeys: true } for keys only. Notes:
  • Low-code mutations execute atomically in one transaction within the remaining execution memory/time budget. An explicit caller transaction retains its configured timeout.
  • REST/public SDK requests retain the 100,000-row limit per request.
  • return defaults to true and includes full rows. return: false omits data; onlyKeys returns primary keys only. Returning full rows has a higher response-memory cost.
  • Unavailable with readOnly: true (throws an error).

Signature

Example

api.updateDatabaseData()

PATCHes the row identified by its primary-key oldObject. newObject contains only properties to change; omitted or undefined properties are unchanged, while null explicitly clears a nullable property. Use updateDatabaseDataRequest for a structured-filter bulk PATCH. Notes:
  • Unavailable with readOnly: true (throws an error).

Signature

Example

api.deleteDatabaseData()

Deletes an explicit list of rows identified by primary key. Notes:
  • Low-code mutations execute atomically in one transaction within the remaining execution memory/time budget. An explicit caller transaction retains its configured timeout.
  • REST/public SDK requests retain the 100,000-row limit per request.
  • Prefer deleteDatabaseDataRequest() when the rows can be described by a filter; it avoids loading and transferring every matching primary key to the runtime.
  • Managed database structured reads and mutations accept up to 65,535 bound parameters per compiled statement, with no separate filter-node or array-value count limit. Application guards still enforce 8 MiB of serialized query input and 16 nested filter levels.
  • Unavailable with readOnly: true (throws an error).

Signature

Example

api.updateDatabaseDataRequest()

Bulk-updates rows matched by an advanced structured filter. Notes:
  • Unavailable with readOnly: true (throws an error).

Signature

Example

api.deleteDatabaseDataRequest()

Bulk-deletes rows matched by an advanced structured filter. Notes:
  • Unavailable with readOnly: true (throws an error).

Signature

Example

api.queryDatabase()

Executes raw SELECT/WITH SQL when the structured helpers are not enough. Do not use this for writes; use insert/upsert/update/delete helpers or transactionDatabase for write flows. Requires current INSTANCE_ADMIN membership on the effective execution account. Saved endpoint/Job policies select that account; direct Sandbox/MCP execution uses the authenticated caller. api.currentUser() follows the configured identity mode and does not grant execution permissions. Always runs exactly one SELECT/WITH in a READ ONLY database transaction. Mutating CTEs and multiple statements are rejected. Use parameters for values. Typed data and ORM helpers retain their own resource permissions.

Signature

Example

api.currentUser()

Returns the business current user synchronously. Saved Endpoints default to the invoking user, including end users without platform access. The instance or Endpoint currentUser policy can select EXECUTION_ACCOUNT instead. Jobs return their captured execution account. Permission checks follow the saved execution policy independently of this presentation setting. avatar is the Storage entry ID, not a signed download URL.

Signature

Example

api.isDebug()

Returns true when this execution restricts platform writes (readOnly: true).

Signature

Example

api.getCache()

Reads execution-scoped in-memory cache. Returns a detached mutable copy by default, or the same value when written with { reference: true }. Missing keys return undefined. Entries never cross execution boundaries.

Signature

Example

api.setCache()

Writes execution-scoped in-memory cache. Copies the value by default. { reference: true } retains the same object: later mutations of the input or returned value change the cached value. Use only for intentional reuse within this execution; refresh or overwrite after a write to the source.

Signature

Example

api.getContext()

Returns the current execution context.

Signature

Example

api.getErrors()

Returns a snapshot of error logs collected so far in this execution. Each call reads the current host collection; modifying the returned array does not clear host errors.

Signature

Example

api.getExecutionId()

Returns the UUID that identifies the current low-code execution. For durable jobs this is the job id. Endpoint and Sandbox executions receive an independent execution UUID while retaining their operation id for distributed request tracing.

Signature

Example

api.getOperationId()

Returns the current operation id.

Signature

Example

api.executeComponent()

Executes another active component in the managed RevoEngine runtime and returns its execution result. Notes:
  • Supports CODE_JS, CODE_TS, and CUSTOM_NODEJS components.
  • CODE_JS and CODE_TS run in a fresh isolated execution on the current host by default.
  • Set options.executionHost to “remote” to use the separate Sandbox host.
  • CUSTOM_NODEJS runs in its governed RevoEngine component environment.
  • If timeoutMs is omitted, the child receives the parent execution’s remaining timeout budget.
  • A larger timeoutMs is clamped to that remaining budget.
  • Nesting is limited to five levels across local, remote and custom component calls.
  • At least 1 second of parent budget is required for remote Sandbox calls.
  • Promise.all() starts independent child component executions.

Signature

Example

api.input()

Returns the current execution payload. Notes:
  • In endpoint context this usually includes body, query, headers, params, path, and method.
  • In event or job context it commonly includes type and message.
  • Passing a name returns a single top-level property.

Signature

Example

api.log()

Adds a log entry. Limits:
  • Endpoint executions accept at most 100 api.log calls per execution.
  • Processor and non-streaming Sandbox executions accept at most 10,000 calls.
  • Streaming Sandbox executions emit logs only to the active SSE stream; this count limit is not applied there, but the stream remains protected by its backpressure queue limit.
  • Calls after the applicable limit are ignored. Other API methods do not consume this limit.

Signature

Example

api.exit()

Stops execution early without marking it as a sandbox failure.

Signature

Example

api.throw()

Stores an HTTP-style response and aborts execution. Notes:
  • Reserved 502 and 503 codes are not allowed from Endpoint user code.

Signature

Example

api.getCurrentInstance()

Returns the current instance id.

Signature

Example

api.getInstanceData()

Reads data from platform-managed sources.

Signature

Example

api.getInstanceDetails()

Returns public instance metadata.

Signature

Example

api.publishMessage()

Publishes a realtime message. Notes:
  • Unavailable with readOnly: true (throws an error).
  • Currently only the ‘ALL’ channel is supported.

Signature

Example

api.getInstanceCache()

Reads instance-scoped cache.

Signature

Example

api.setInstanceCache()

Writes instance-scoped cache. Notes:
  • Unavailable with readOnly: true (throws an error).

Signature

Example

api.setInstanceCacheIfNotExists()

Writes instance-scoped cache only when the key does not exist. Notes:
  • Unavailable with readOnly: true (throws an error).

Signature

Example

api.getOrSetInstanceCache()

Reads a cache key or stores the fallback value atomically if it is missing.

Signature

Example

api.removeInstanceCache()

Removes cache keys. Notes:
  • Unavailable with readOnly: true (throws an error).

Signature

Example

api.existsInstanceCache()

Checks whether an instance cache key exists.

Signature

Example

api.persistInstanceCache()

Makes a cache key persistent. Notes:
  • Unavailable with readOnly: true (throws an error).

Signature

Example

api.expireInstanceCache()

Sets cache TTL in seconds. Notes:
  • Unavailable with readOnly: true (throws an error).

Signature

Example

api.getExpireInstanceCache()

Returns cache TTL in seconds, 0 for no expiry, or null when the key does not exist.

Signature

Example

api.listInstanceCache()

Lists instance cache keys by prefix or pattern.

Signature

Example

api.incrementInstanceCache()

Atomically increments an integer cache key. Notes:
  • Unavailable with readOnly: true (throws an error).
  • ‘by’ must be an integer.

Signature

Example

api.decrementInstanceCache()

Atomically decrements an integer cache key. Notes:
  • Unavailable with readOnly: true (throws an error).
  • ‘by’ must be an integer.

Signature

Example

api.compareAndSetInstanceCache()

Atomically updates a cache key only when the current value matches ‘expected’. Notes:
  • Unavailable with readOnly: true (throws an error).

Signature

Example

api.acquireIdempotencyKey()

Acquires a durable instance-scoped idempotency key. Notes:
  • Cache outages do not remove duplicate protection; durable storage failure rejects admission.
  • Unavailable with readOnly: true; throws READ_ONLY_OPERATION_FORBIDDEN.

Signature

Example

api.getIdempotencyKey()

Reads stored idempotency metadata.

Signature

Example

api.releaseIdempotencyKey()

Deletes an idempotency key unconditionally, allowing another attempt to acquire it. Notes:
  • This does not roll back business effects and does not check an ownership token.
  • Release for retry only when no business effect occurred (or rollback is confirmed), and the key still belongs to this attempt. Retain it when the outcome is uncertain.
  • Never release in a generic catch/finally merely because processing threw or timed out: a partial effect or committed operation could then be executed twice.
  • A late cleanup after TTL expiry may delete a key acquired by another worker.
  • Unavailable with readOnly: true (throws an error).

Signature

Example

api.concurrencyLimit()

Acquires an instance-scoped concurrency token. Notes:
  • Returns whether admission succeeded; ttl is in seconds.
  • Each successful admission acquires one slot. Release it exactly once with releaseConcurrencyLimit.
  • Stored durably per instance with a separate owner and expiry for each admitted slot.
  • Without leaseOwnerId, release through the same runtime invocation that acquired the slot.
  • For separate SDK requests, pass a unique leaseOwnerId for this execution to acquisition and release. Reusing that owner renews neither its TTL nor business idempotency. Finish before TTL.
  • Durable storage unavailability throws before admission; an optional cache is not required.
  • Unavailable with readOnly: true (throws an error).

Signature

Example

api.rateLimit()

Acquires an instance-scoped rate-limit token. Notes:
  • Unavailable with readOnly: true (throws an error).

Signature

Example

api.releaseRateLimit()

Resets the entire rate-limit key, including all consumed tokens. Notes:
  • Unavailable with readOnly: true (throws an error).

Signature

Example

api.releaseConcurrencyLimit()

Atomically releases one acquired concurrency slot, preserving slots held by other workers. Notes:
  • Releases only a slot acquired by this runtime invocation; a missing local ownership token is a no-op.
  • For a slot acquired with leaseOwnerId, pass that same owner to release it from another SDK request.
  • Call exactly once after a successful admission; do not release after admission returned false.
  • Owner fencing prevents late cleanup from releasing a slot acquired by another invocation.
  • Each invocation may acquire several slots; each release consumes one of its own tokens.
  • Unavailable with readOnly: true (throws an error).

Signature

Example

api.triggerEvent()

Schedules a custom event. Matches active definitions by custom: true and the uppercase event type. No implicit CUSTOM_ prefix is added. Native events can only be replayed from history. Returns an event ID after its immutable publication intent is persisted. Queue delivery recovers asynchronously after provider/process failures; this receipt does not mean that Event History or target execution has finished. Notes:
  • Use the options object’s scheduleFor; legacy delay properties are ignored.
  • New code should use scheduleFor with a Date, ISO 8601 date-time, or Unix timestamp in milliseconds.
  • The absolute time cannot be in the past or more than 30 days ahead.
  • Unavailable with readOnly: true (throws an error).

Signature

Example

api.triggerTarget()

Schedules generic execution against a normalized target. Notes:
  • Use JOB_TEMPLATE for legacy template execution or AGENT for agent-native dispatch.
  • Pass { scheduleFor }; the maximum horizon is 30 days.
  • Retired positional date and relative-delay arguments are ignored.
  • Unavailable with readOnly: true (throws an error).
  • For JOB_TEMPLATE, targetId accepts an exact active template ID or unique name. The third argument is copied directly into the target job’s flat api.input().templateInputs. It is shallow-spread over template defaults, retaining non-colliding defaults and overwriting only matching keys; it is never nested below another input property.

Signature

Example

api.triggerJob()

Schedules an active job template by its exact ID or exact unique name. Notes:
  • Unavailable with readOnly: true (throws an error).
  • Convenience wrapper for api.triggerTarget('JOB_TEMPLATE', templateIdOrName, ...).
  • The input argument is copied directly into the target job’s flat api.input().templateInputs, shallow-spread over template defaults. Non-colliding defaults remain and matching keys are overwritten; it is not nested under templateInputs.input or exposed at top level.
  • Pass { scheduleFor }; the maximum horizon is 30 days.
  • Retired positional date and relative-delay arguments are ignored.

Signature

Example

api.triggerWebhook()

Schedules a webhook delivery. Notes:
  • Pass { scheduleFor }; the maximum horizon is 30 days.
  • Retired positional date and relative-delay arguments are ignored.
  • Unavailable with readOnly: true (throws an error).

Signature

Example

api.cancelJobs()

Cancel by jobIds OR a non-empty platform filter. Unavailable with readOnly: true (throws an error). Returns a durable operation over frozen IDs; counters describe requests processed, not downstream completion.

Signature

Example

api.retryJobs()

Retry ERROR/CANCELLED jobs by jobIds OR a non-empty platform filter. Creates new attempts from saved inputs. Unavailable with readOnly: true (throws an error).

Signature

Example

api.deleteJobs()

Delete by jobIds OR a non-empty platform filter. Unavailable with readOnly: true (throws an error). Returns a durable operation with progress and per-item outcomes.

Signature

Example

api.cancelWebhooks()

Cancel by webhookIds OR a non-empty platform filter. Unavailable with readOnly: true (throws an error). Returns a durable operation with progress and per-item outcomes.

Signature

Example

api.retryWebhooks()

Retry ERROR/CANCELLED webhooks by webhookIds OR a non-empty platform filter. requestPatch supplies replacements; masked original values are unavailable. Unavailable with readOnly: true (throws an error).

Signature

Example

api.deleteWebhooks()

Delete by webhookIds OR a non-empty platform filter. Unavailable with readOnly: true (throws an error). Returns a durable operation with progress and per-item outcomes.

Signature

Example

api.previewAutomationOperation()

Preview is advisory; submit freezes a fresh selection. No request bodies are returned.

Signature

api.getAutomationOperation()

Read the durable operation and its progress. Counters describe requests processed, not downstream completion.

Signature

Example

api.getAutomationOperationItems()

Read a page of safe per-item outcomes without saved request bodies. Pass nextCursor as after to read the next page.

Signature

Example

api.httpCall()

Performs an outbound HTTP request. Notes:
  • External HTTP calls execute in both modes; non-GET requests to Revo hosts require readOnly: false.
  • Saving an HTTP response to a Storage target requires readOnly: false and fails before transport in restricted mode.
  • Supports proxy mode, form-data, Storage streaming, and optional current credentials.
  • Proxy mode supports JSON/text requests, Storage sources/targets, and json/text/buffer/base64buffer/storage responses. Public stream/SSE, document responses, multipart and currentCredentials remain unsupported through proxy. Check response.status explicitly; upstream HTTP error statuses do not throw, while proxy transport failures do.
  • Use source: { storageEntryId } when streaming an Explorer Storage file into an HTTP request.
  • Use target: { name, ... } or target: { storageEntryId, replace: true } when streaming an HTTP response into Explorer Storage.
  • source and target may be used together to stream a Storage entry through an external conversion API and save its response into Storage.
  • For multipart requests, put formData on the first config argument. Use one empty part with source, or put storageEntryId directly on each binary formData part.
  • With proxy: true, Go calls the provider through the dedicated egress network and uploads successful response bytes directly to a authorized Storage upload URL. Runtime verifies upload metadata and finalizes; file bytes do not pass through runtime.
  • HTTP Storage targets use one managed direct upload and are finalized automatically. Use storage.createUploadSession plus storage.uploadPart for resumable/chunked session workflows.
  • Use requestType: 'storage' for a Storage source and responseType: 'storage' for a Storage target. These formats are independent.
  • target: { storageUploadSessionId } fills and finalizes an existing active empty direct session, preserving its stored settings.
  • Only 2xx responses are saved; other statuses return at most 64 KiB of diagnostic text. Legacy Files and nested Storage references are rejected.
  • Revo responses expose revo.sameInstance. The runtime compares SHA-256(“revo-instance:v1:” + current instance id) internally; x-revo-oid is returned only when revo.sameInstance is true. Cross-instance or unconfirmed Revo headers are removed from the public response.
  • response.data is undefined when the response is stored; use response.storage.entry after successful finalization.
  • For text files, prefer computeStats: 'sync' on the storage target so line stats are immediately available after finalize.
  • JSON is the default request and response format. Explicit requestType: 'json' is valid for every supported HTTP method and, without proxy, may be combined with any supported response type because it does not declare a request body.

Overloads

Example

Last modified on October 14, 2026