K

Gateway & Connectors

External data connector and guarded gateway session/query commands

This page is for safely reaching the external data registered to your company (DBs, REST APIs, Google Drive) through the gateway. The flow is always the same — check which connectors your grants reach with connectors mine, open a session with gateway session start, then call query · invoke · document-invoke · file-invoke. Every call passes through the guards of the presets and access policies bound to your grant. The full picture of connector setup and its safeguards is covered in the Connect company data with a connector.

axhub connectors

Browse accessible gateway connectors and their discovered resources.

axhub connectors discover

Trigger immediate connector resource discovery (admin).

FlagTypeDescriptionDefault
<connector_id>string (positional)
--dry-runbooleanPreview the operation without applying state changes.true
--executebooleanApply the state-changing operation instead of previewing it.
--tenantstringTenant slug or ID used to scope the command.

axhub connectors app-db

Expose an axhub app's dedicated database as a connector (spec 130).

axhub connectors app-db eligible

List apps whose DB can be exposed as a connector (read-only).

FlagTypeDescriptionDefault
--tenantstringTenant id/slug/name override. Defaults to the active tenant membership
--limitintegerBackend page size for this request
--cursorstringCursor from a previous page's next_cursor

axhub connectors app-db create

Expose one app's database as a connector.

FlagTypeDescriptionDefault
--appstringApp id or slug to expose
--tenantstringTenant slug or ID used to scope the command.
--dry-runbooleanPreview the operation without applying state changes.true
--executebooleanApply the state-changing operation instead of previewing it.

axhub connectors google

Google Drive OAuth helper routes for connector setup.

axhub connectors google finalize

Finalize Google Drive OAuth and create the connector.

FlagTypeDescriptionDefault
--descriptionstringHuman-readable description for the resource.
--drive-idstring
--dry-runbooleanPreview the operation without applying state changes.true
--executebooleanApply the state-changing operation instead of previewing it.
--namestringResource display name.
--statestring
--tenantstringTenant slug or ID used to scope the command.

axhub connectors google start

Start Google Drive OAuth and print the authorization URL.

FlagTypeDescriptionDefault
--return-tostring
--tenantstringTenant slug or ID used to scope the command.

axhub connectors mine

List connectors the caller can access through an active grant.

FlagTypeDescriptionDefault
--tenantstringTenant slug or ID used to scope the command.

axhub connectors resources

Show the discovered resource tree for an accessible connector.

FlagTypeDescriptionDefault
<connector_id>string (positional)
--adminboolean
--limitintegerPagination control for list output.
--offsetintegerPagination control for list output.
--qstringSearch query string.
--tenantstringTenant slug or ID used to scope the command.

axhub gateway

Gateway access: sessions, guarded SQL query, and REST invoke (DAC spec 013).

axhub gateway document-invoke

Invoke a document-store op through the gateway (free-form passthrough; requires an active session).

FlagTypeDescriptionDefault
--body-jsonstringFull op body as one JSON object. Optional — the body can be built from the typed flags below alone. Individual flags override matching keys. The CLI always injects session_id and op last
--collectionstringTarget collection name
--databasestringTarget database name
--documentstringSingle document as a JSON value
--documentsstringMultiple documents as a JSON array
--dry-runbooleanPreview the operation without applying state changes.true
--executebooleanApply the state-changing operation instead of previewing it.
--fieldstringTarget field name
--filterstringQuery filter as a JSON value
--limitintegerResult limit
--opstringDocument-store op. Free-form: the backend SDK is the source of truth and validates supported ops, so new ops work without a CLI change
--pipelinestringAggregation pipeline as a JSON array
--projectionstringProjection as a JSON value
--session-idstringActive gateway session id (from axhub gateway session start)
--skipstringResult skip/offset
--sortstringSort spec as a JSON value
--tenantstringTenant slug or ID used to scope the command.
--updatestringUpdate spec as a JSON value

axhub gateway file-invoke

Invoke Google Drive/file-storage actions through the gateway.

FlagTypeDescriptionDefault
--actionstring
--dry-runbooleanPreview the operation without applying state changes.true
--executebooleanApply the state-changing operation instead of previewing it.
--file-idstring
--parent-folder-idstring
--qstringSearch query string.
--session-idstring
--tenantstringTenant slug or ID used to scope the command.

axhub gateway invoke

Invoke a REST connector endpoint through the gateway (requires an active session).

FlagTypeDescriptionDefault
--bodystringRaw request body. The CLI base64-encodes it per the gateway wire contract
--body-filestringRead the raw request body from a file
--dry-runbooleanPreview the operation without applying state changes.true
--executebooleanApply the state-changing operation instead of previewing it.
--headerstringRepeatable request header in Name: Value form
--methodstring
--pathstringConnector-relative request path (e.g. /api/v1/users)
--session-idstringActive gateway session id (from axhub gateway session start)
--tenantstringTenant slug or ID used to scope the command.

axhub gateway query

Run SQL through the guarded gateway pipeline (requires an active session).

FlagTypeDescriptionDefault
--actionstringOverride the inferred SQL action (db preset vocabulary, e.g. SELECT or INSERT)
--allow-non-selectbooleanAllow statements other than SELECT/WITH (the preset must still allow the action)
--dry-runbooleanPreview the operation without applying state changes.true
--executebooleanApply the state-changing operation instead of previewing it.
--params-jsonstringJSON array of positional query parameters
--session-idstringActive gateway session id (from axhub gateway session start)
--sqlstring
--sql-filestring
--tenantstringTenant slug or ID used to scope the command.

The DB preset action vocabulary also includes EXPLAIN, classified as read-only (spec 168) — "SQL is SELECT/WITH only" is no longer an accurate statement. Since an EXPLAIN statement isn't SELECT/WITH, run it with --allow-non-select while the preset allows EXPLAIN.

When a grant has a scope (scope_resource_paths) set, free-form SQL (gateway query) is rejected (spec 172) — 403 scope_requires_target, and access to resources outside the scope fails with 403 scope_out_of_range.

axhub gateway session

Manage gateway access sessions (8h TTL, snapshots the active grant).

axhub gateway session end

End an active session.

FlagTypeDescriptionDefault
<session_id>string (positional)
--tenantstringTenant slug or ID used to scope the command.

axhub gateway session start

Start a session against an accessible connector.

FlagTypeDescriptionDefault
--connector-idstring
--mfa-verifiedbooleanMark the session as MFA-verified
--tenantstringTenant slug or ID used to scope the command.