---
title: "Get Snippets"
method: GET
path: "/public/snippets"
tags: ["PUBLIC_SNIPPETS"]
---

# Get Snippets

`GET /public/snippets`

## 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`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

List all code snippets with pagination and filtering.

This endpoint is for service users (PUBLIC_TENANT) to retrieve
code snippets stored in Weaviate.

## Query parameters

- `page` integer: Page number (1-indexed)
- `page_size` integer: Items per page
- `database_type` string, nullable: Filter by database type (e.g., clickhouse, postgres)
- `tags` string[], nullable: Filter by tags (multiple allowed)
- `snippet_type` string, nullable: Filter by type (data_definition or sql_example)

## Response `200`

Successful Response

- SnippetsListResponse: Paginated list of snippets
  - `snippets` SnippetItem[], required: List of snippets
    - `id` string, required: Unique identifier for the snippet
    - `title` string, required: Title or name of the snippet
    - `description` string, required: Description of what the snippet does
    - `database_type` string, required: Database type (e.g., clickhouse, postgres)
    - `tags` string[]: Capability tags
    - `type` string, required: Snippet type: data_definition or sql_example
    - `full_content` object: Full snippet content
  - `page` integer, required: Current page number
  - `page_size` integer, required: Number of items per page
  - `has_more` boolean, required: Whether there are more pages
  - `total` integer, required: Total number of snippets matching filters

## 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)
