---
title: "Get collection schema"
method: GET
path: "/api/v1/sites/{subdomain}/collections/{collectionId}"
tags: ["collections"]
---

# Get collection schema

`GET /api/v1/sites/{subdomain}/collections/{collectionId}`

## Request

- Base URL: `https://slatehut.com`
- URL: `https://slatehut.com/api/v1/sites/{subdomain}/collections/{collectionId}`
- Auth: HTTP bearer

## Response `200`

- object
  - `collection` CmsCollectionSchema, required
    - `id` string, required
    - `name` string, required
    - `slug` string, required
    - `fields` CmsFieldDef[], required
      - `id` string, required
      - `name` string, required
      - `type` 'text' | 'richText' | 'number' | 'boolean' | 'date' | 'image' | 'url' | 'select' | 'color' | 'gallery' | 'file' | 'reference' | 'multiReference', required
      - `required` boolean: Must be true for the field that matches the collection `slugField` id.
      - `options` string[]
      - `referenceCollectionId` string: Target collection id for reference / multiReference fields.
    - `titleField` string, required
    - `slugField` string, required
    - `slugBasedOn` string: Field id to derive URL slug from when slug field is empty; defaults to titleField.
    - `contentField` string
    - `imageField` string

## Other responses

- `404`: Resource not found

---

[API](https://skmtc.dev/slatehut/apis/slatehut-api.md) · [All operations](https://skmtc.dev/slatehut/apis/slatehut-api/llms.txt) · [OpenAPI document](https://skmtc.dev/slatehut/apis/slatehut-api/revisions/32dae277550c?raw)
