---
title: "Create Workspace Schema"
method: POST
path: "/v1/workspaces/{workspace_id}:createSchema"
tags: ["workspace"]
---

# Create Workspace Schema

`POST /v1/workspaces/{workspace_id}:createSchema`

## Path parameters

- `workspace_id` string, required

## Request body

- BodyCreateWorkspaceSchemaV1WorkspacesWorkspaceIdCreateSchemaPost
  - `catalogId` string, required
  - `schemaId` string, required
  - `schema` SchemaInput, required — A SQL-visible schema owned by its parent catalog.
    - `name` string — Resource name in the form `workspaces/{workspace}/catalogs/{catalog}/schemas/{schema}`. The terminal resource ID is the SQL-visible schema name.
    - `spec` SchemaSpec, required — Optional source for a schema's complete child subtree. With no source, tables are ordinary child Table resources resolved through WorkspaceService. When a source is selected, it supplies the complete observed subtree and local Table children are forbidden.
      - `relational` RelationalSchemaSpec — One source schema selected through a relational connector.
        - `connector` string, required — Connector used to discover and query the source schema.
        - `sourceCatalog` string, required — Source catalog containing the schema.
        - `sourceSchema` string, required — Source schema selected through the connector.
        - `snapshot` RelationalSchemaSnapshot — The complete table subtree observed beneath one relational source schema. Child snapshots inherit the connector, source catalog, and source schema from the owning RelationalSchemaSpec.
          - `tables` object — All observed source tables, keyed by their names within the schema.
    - `createTime` string, date-time, nullable — Time at which the schema was created.
    - `updateTime` string, date-time, nullable — Time at which the schema was most recently updated.
    - `revision` integer — Monotonically increasing revision of this schema definition.
    - `revisionHash` string — Lowercase SHA-256 hash of the canonical stored schema definition.

## Response `201`

Successful Response

- SchemaOutput — A SQL-visible schema owned by its parent catalog.
  - `name` string, required — Resource name in the form `workspaces/{workspace}/catalogs/{catalog}/schemas/{schema}`. The terminal resource ID is the SQL-visible schema name.
  - `spec` SchemaSpec, required — Optional source for a schema's complete child subtree. With no source, tables are ordinary child Table resources resolved through WorkspaceService. When a source is selected, it supplies the complete observed subtree and local Table children are forbidden.
    - `relational` RelationalSchemaSpec — One source schema selected through a relational connector.
      - `connector` string, required — Connector used to discover and query the source schema.
      - `sourceCatalog` string, required — Source catalog containing the schema.
      - `sourceSchema` string, required — Source schema selected through the connector.
      - `snapshot` RelationalSchemaSnapshot — The complete table subtree observed beneath one relational source schema. Child snapshots inherit the connector, source catalog, and source schema from the owning RelationalSchemaSpec.
        - `tables` object — All observed source tables, keyed by their names within the schema.
  - `createTime` string, nullable — Time at which the schema was created.
  - `updateTime` string, nullable — Time at which the schema was most recently updated.
  - `revision` string — Monotonically increasing revision of this schema definition.
  - `revisionHash` string — Lowercase SHA-256 hash of the canonical stored schema definition.

## Other responses

- `422` — Validation Error

## Changes

- **2026-07-31** `6c6e81fb3282` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/outerproduct/apis/outerproduct-api/changes/v1/workspaces/:workspace_id:createSchema/post.md)

---

[API](https://skmtc.dev/outerproduct/apis/outerproduct-api.md) · [All operations](https://skmtc.dev/outerproduct/apis/outerproduct-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/outerproduct/outerproduct-api/revisions/6c6e81fb3282/schema)
