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

# Execute Snippet Endpoint

`POST /public/snippets/execute`

## Request

- Base URL: `https://api.myaltimate.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.myaltimate.com/public/snippets/execute`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

> **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.dev/myaltimate/apis/myaltimate-api.md) - [All operations](https://skmtc.dev/myaltimate/apis/myaltimate-api/llms.txt) - [OpenAPI document](https://skmtc.dev/myaltimate/apis/myaltimate-api/revisions/727657ce54e9?raw)
