---
title: "Execute Snippet Endpoint"
method: POST
path: "/public/snippets/execute"
tags: ["PUBLIC_SNIPPETS"]
deprecated: true
---

# Execute Snippet Endpoint

`POST /public/snippets/execute`

> **Deprecated.**

Execute a SQL snippet against a tenant's datastore.

The target tenant is specified in the request body, allowing
PUBLIC_TENANT users to execute against any company's datastore.

## Request body

- ExecuteSnippetRequest — Request to execute a SQL snippet against a tenant's datastore
  - `tenant` string, required — Tenant name to execute against
  - `database_type` string, required — Database type to execute against (clickhouse or postgres)
  - `sql` string, required — SQL query to execute

## Response `200`

Successful Response

- ExecuteSnippetResponse — Response from executing a SQL snippet
  - `success` boolean, required — Whether the execution succeeded
  - `rows` object[] — Query result rows
  - `columns` string[] — Column names in the result
  - `row_count` integer — Number of rows returned
  - `error` string, nullable — Error message if execution failed
  - `execution_time_ms` integer — Execution time in milliseconds

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/myaltimate/apis/fastapi.md) · [All operations](https://skmtc.net/myaltimate/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/myaltimate/fastapi/versions/aab3fe5c9f05/schema)
