Skip to main content
POST
Create a saved-query context item

Authorizations

Authorization
string
header
required

A Modus personal access token (modus_<orgUuid>_<prefix>_<secret>) or an OAuth 2.1 access token, sent as Authorization: Bearer <token>.

Body

application/json
name
string
required

Display name for the saved query.

Example:

"Top customers Q3"

connectionId
string
required

Data connection id this query targets. Must reference an existing integration connection in the org.

Example:

"00000000-0000-4000-a000-000000000111"

query
string

SQL text. Stored in tenant S3 + context_items. May be omitted or empty when creating a placeholder saved query.

Example:

"SELECT customer_id, SUM(amount) FROM orders GROUP BY 1 ORDER BY 2 DESC LIMIT 10"

description
string

Optional one-line description shown in the SPA list.

Example:

"Quarterly cohort by amount."

path
string[]

Optional hierarchical path identifying the data scope (e.g. ["database", "schema"] for Snowflake; ["dataset"] for BigQuery).

Example:
access
object

Response

contextItemId
string
required

UUID of the newly-created context item. Use it on subsequent GET / PATCH / DELETE calls.

Example:

"7a3f9d2c-1111-4000-a000-000000000abc"

kind
enum<string>
required

Kind of context item created.

Available options:
note,
saved_query,
link
Example:

"note"

s3Key
string | null

Tenant S3 key for the raw content blob (notes, saved queries, links). Null for kinds without S3 backing.

Example:

"context_notes/7a3f9d2c.../Q3_churn_analysis.md"

title
string | null

Resolved title for the created item. Null for kinds without a title field.

Example:

"Q3 churn analysis"