---
title: "Get Schema"
method: GET
path: "/api/v1/resources/{resource_id}/schema"
tags: ["resource-schema"]
---

# Get Schema

`GET /api/v1/resources/{resource_id}/schema`

## Request

- Base URL: `https://memory.kagura-ai.com` (the document declares no server; this is the origin it was published from)
- URL: `https://memory.kagura-ai.com/api/v1/resources/{resource_id}/schema`
- Auth: none declared

Get resource schema (latest or specific version).

Owner-only (#389): ``WorkspaceOwner`` rejects non-owners with 403;
``resolve_resource_by_slug`` returns 404 on cross-workspace probes.

Example:
    GET /api/v1/resources/ec_products/schema
    GET /api/v1/resources/ec_products/schema?schema_version=2

## Path parameters

- `resource_id` string, required

## Query parameters

- `schema_version` integer, nullable

## Headers

- `authorization` string, nullable

## Response `200`

Successful Response

- SchemaResponse: Response with resource schema.
  - `resource_id` string, required
  - `schema_version` integer, required
  - `field_definitions` FieldDefinition[], required
    - `name` string, required: Field name in JSONB payload
    - `type` string, required: Field data type
    - `description` string, required: Human-readable description
    - `classification` string: Data classification for access control
    - `index_hint` string: Indexing hints: fulltext, vector, sort, facet, metadata
    - `unit` string, nullable: Unit of measurement (e.g., JPY, kg)
    - `enum_values` string[], nullable: Allowed values for categorical fields
    - `example` string, nullable: Example value
    - `required` boolean: Whether field is required
  - `created_at` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud.md) · [All operations](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud/llms.txt) · [OpenAPI document](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud/revisions/09f17f5ada29?raw)
