---
title: "Publish App Schema Version"
method: POST
path: "/apps/{app_id}/schema-versions"
tags: ["Apps"]
---

# Publish App Schema Version

`POST /apps/{app_id}/schema-versions`

## Request

- Base URL: `https://be.graph8.com/api/v1`
- URL: `https://be.graph8.com/api/v1/apps/{app_id}/schema-versions`
- Auth: HTTP bearer

Publish a declared object schema and materialize it across consented tenants.

422 with every validation problem at once, so a builder fixes their whole
schema in one round trip rather than one error per attempt.

A publish that resolves to an EXISTING version still returns 201 with
`created: false` -- the resource named by the response exists either way, and
the flag is what tells a caller nothing changed.

## Path parameters

- `app_id` string, required

## Headers

- `Authorization` string, nullable
- `X-Org-Id` string, nullable

## Request body

- PublishSchemaVersionRequest: A schema publish carries ONLY declared objects. Not a whole `graph8.app.yaml`: `frontend`/`backend` are deploy-time build config (M6-5) and have no bearing on what a tenant's `cb_*` tables receive. Accepting them here would let a Dockerfile edit re-materialize every tenant.
  - `objects` unknown[], required: Declared custom objects, in `graph8.app.yaml` `objects:` shape.
    - unknown

## Response `201`

Successful Response

- ApiResponsePublishSchemaVersionResponse
  - `data` PublishSchemaVersionResponse, required: The version, plus whether it was newly created and how the fan-out went.
    - `version` SchemaVersionResponse, required: One published (or draft) object-schema version.
      - `schema_version_id` string, required
      - `app_id` string, required
      - `version` integer, required: Human-facing ordinal. Nothing keys on it; the digest is the identity.
      - `digest` string, required: SHA-256 of the canonical schema. Re-publishing the same schema resolves here.
      - `status` string, required
      - `manifest` object: The stored canonical schema. Self-describing, so the version needs no other source.
      - `created_at` string, date-time, nullable
      - `published_at` string, date-time, nullable
      - `deprecated_at` string, date-time, nullable
    - `created` boolean, required: False when an identical schema was already published -- the retry no-op.
    - `materialization` MaterializationSummary, required: How the fan-out went, as counts. Never tenant ids -- see module docstring.
      - `total` integer
      - `ready` integer
      - `failed` integer
      - `skipped` integer: Tenants already materialized on this exact digest.
  - `pagination` PaginationMeta
    - `page` integer, required: Current page number (1-indexed)
    - `limit` integer, required: Items per page
    - `total` integer, required: Total number of items
    - `has_next` boolean, required: Whether there are more pages
    - `next_cursor` string, nullable: Opaque cursor for the next page; null when there are no more items. Pass it back as the `cursor` query param to fetch the following page without computing page numbers.
    - `total_available` integer, nullable: Search endpoints only: how many records really match, when known. Can be larger than `total`, which is capped at the 10,000 results that can be paged. For company search this is a distinct-company estimate. Null when unknown; absent outside search.
    - `total_is_lower_bound` boolean, nullable: Search endpoints only: true when more records match than `total` shows (the result set is larger than the 10,000 results that can be paged). Absent outside search.
    - `notes` string[], nullable: Search endpoints only: plain-language notes about the result, e.g. that more records match than can be paged, or that a reversed `between` range was put in order.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/graph8/apis/graph8-developer-api.md) · [All operations](https://skmtc.dev/graph8/apis/graph8-developer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/graph8/apis/graph8-developer-api/revisions/2e7cfa0ca921?raw)
