Skip to content
LogoLogo

Cms models schema

See Management API schema for every domain, the endpoint and authentication.

Queries

contentModels

Lists the models in a workspace. Scope: ORGANIZATION_WORKSPACE_READ.

contentModels(
  workspaceId: ID!
  """The role to filter by. Omit it for every model."""
  category: ContentModelCategory
  first: Int
  after: String
  last: Int
  before: String
  """Text that the model name contains, ignoring case."""
  search: String
  sortKey: ContentModelSortKeys = NAME
  """Whether to reverse the order of `sortKey`."""
  reverse: Boolean = false
): ContentModelConnection! @auth

contentModel

Reads a model. Scope: ORGANIZATION_WORKSPACE_READ.

contentModel(id: ID!): ContentModel @auth

contentBlocks

Lists the blocks in a workspace. Scope: ORGANIZATION_WORKSPACE_READ.

contentBlocks(
  workspaceId: ID!
  """The role to filter by. Omit it for every block."""
  category: ContentBlockCategory
  first: Int
  after: String
  last: Int
  before: String
  """Text that the block name contains, ignoring case."""
  search: String
  sortKey: ContentBlockSortKeys = NAME
  """Whether to reverse the order of `sortKey`."""
  reverse: Boolean = false
): ContentBlockConnection! @auth

contentBlock

Reads a block. Scope: ORGANIZATION_WORKSPACE_READ.

contentBlock(id: ID!): ContentBlock @auth

contentEntries

Lists the content entries in a workspace. Scope: ORGANIZATION_WORKSPACE_READ.

contentEntries(
  workspaceId: ID!
  """The ID of the model to filter by. Omit it for every content entry."""
  contentModelId: ID
  first: Int
  after: String
  last: Int
  before: String
  sortKey: ContentEntrySortKeys = CREATED_AT
  """Whether to reverse the order of `sortKey`."""
  reverse: Boolean = false
): ContentEntryConnection! @auth

contentEntry

Reads a content entry. Scope: ORGANIZATION_WORKSPACE_READ.

contentEntry(id: ID!): ContentEntry @auth

assets

Lists the assets in a project, newest first by default. Scope: ORGANIZATION_PROJECTS_READ.

assets(
  projectId: ID!
  first: Int
  after: String
  last: Int
  before: String
  """Text that the file name contains, ignoring case."""
  search: String
  """The media type group to filter by."""
  kind: AssetKind
  """
  The MIME types to filter by. An entry such as `image/*` matches every subtype.
  """
  acceptedMimeTypes: [String!]
  sortKey: AssetSortKeys = CREATED_AT
  """Whether to reverse the order of `sortKey`."""
  reverse: Boolean = true
): AssetConnection! @auth

asset

Reads an asset. Scope: ORGANIZATION_PROJECTS_READ.

asset(id: ID!): Asset @auth

workspaceContentEntryValidation

Verifies each content entry in a workspace against its model's schema, including embedded blocks. It changes no data. Scope: ORGANIZATION_WORKSPACE_READ.

workspaceContentEntryValidation(
  workspaceId: ID!
  """The ID of a model, to check only its content entries."""
  contentModelId: ID
): WorkspaceContentEntryValidationPayload! @auth

Mutations

contentModelCreate

Creates a model. Scope: ORGANIZATION_WORKSPACE_UPDATE.

contentModelCreate(input: ContentModelCreateInput!): ContentModelCreatePayload! @auth

contentModelUpdate

Updates a model. A schema change migrates the data of its content entries and lists each removed value in migrationWarnings. Scope: ORGANIZATION_WORKSPACE_UPDATE.

contentModelUpdate(input: ContentModelUpdateInput!): ContentModelUpdatePayload! @auth

contentModelDelete

Deletes a model. Fails with CONFLICT while content entries use it, or while another schema's reference field targets it. Scope: ORGANIZATION_WORKSPACE_UPDATE.

contentModelDelete(input: ContentModelDeleteInput!): ContentModelDeletePayload! @auth

contentBlockCreate

Creates a block. Scope: ORGANIZATION_WORKSPACE_UPDATE.

contentBlockCreate(input: ContentBlockCreateInput!): ContentBlockCreatePayload! @auth

contentBlockUpdate

Updates a block. A schema change does not migrate the content entries that embed it. Scope: ORGANIZATION_WORKSPACE_UPDATE.

contentBlockUpdate(input: ContentBlockUpdateInput!): ContentBlockUpdatePayload! @auth

contentBlockDelete

Deletes a block. Scope: ORGANIZATION_WORKSPACE_UPDATE.

contentBlockDelete(input: ContentBlockDeleteInput!): ContentBlockDeletePayload! @auth

contentEntryCreate

Creates a content entry of a model. Each asset reference without a version is pinned to the asset's current version. Scope: ORGANIZATION_WORKSPACE_UPDATE.

contentEntryCreate(input: ContentEntryCreateInput!): ContentEntryCreatePayload! @auth

contentEntryUpdate

Updates the data of a content entry. Each asset reference without a version is pinned to the asset's current version. Scope: ORGANIZATION_WORKSPACE_UPDATE.

contentEntryUpdate(input: ContentEntryUpdateInput!): ContentEntryUpdatePayload! @auth

contentEntryDelete

Deletes a content entry. Fails with CONFLICT while a step uses it as its layout, or while another content entry references it. Scope: ORGANIZATION_WORKSPACE_UPDATE.

contentEntryDelete(input: ContentEntryDeleteInput!): ContentEntryDeletePayload! @auth

assetUploadInit

Starts an asset upload and returns a pre-signed URL to PUT the bytes to. Nothing is stored until assetCommit. Scope: ORGANIZATION_PROJECTS_UPDATE.

assetUploadInit(input: AssetUploadInitInput!): AssetUploadInitPayload! @auth

assetCommit

Commits an uploaded file as the asset's current version, recording its size, MIME type and image dimensions. Fails when the bytes do not match the claimed content type. Scope: ORGANIZATION_PROJECTS_UPDATE.

assetCommit(input: AssetCommitInput!): AssetCommitPayload! @auth

assetDelete

Deletes an asset and its stored files. Fails with CONFLICT once a publish uses any of its versions; content entries that reference it are not checked. Scope: ORGANIZATION_PROJECTS_UPDATE.

assetDelete(input: AssetDeleteInput!): AssetDeletePayload! @auth

Types

ContentModelCategory

"""The role of a model, which decides what its entries lay out."""
enum ContentModelCategory {
  """The layout of one step inside a flow."""
  STEP_LAYOUT
  """The layout of a page."""
  PAGE_LAYOUT
}

ContentBlockCategory

"""The role of a block, which decides which block fields accept it."""
enum ContentBlockCategory {
  """A page section, such as a hero, a feature list or a testimonial."""
  SECTION
}

MigrationWarningType

"""What a model schema change did to the data of one content entry."""
enum MigrationWarningType {
  """The field left the schema, and its value was removed."""
  FIELD_REMOVED
  """
  The field changed type, and its value could not be converted, so it was removed.
  """
  TYPE_CHANGE
  """The field was renamed, and its value needs moving by hand."""
  RENAME_REQUIRED
}

ContentModel

"""
A reusable schema that sets which fields a content entry can hold. Changing its schema migrates
the data of its entries.
"""
type ContentModel {
  """The ID of the model."""
  id: ID!
  """The workspace that holds the model."""
  workspace: Workspace!
  """
  The role of the model. Null for general content, which has no layout role.
  """
  category: ContentModelCategory
  """The name of the model."""
  name: String!
  """The description of the model. Null when it has none."""
  description: String
  """The stable identifier of the model. It cannot change."""
  key: String!
  """The fields that the model's entries hold."""
  schema: ContentSchema!
  """The content entries of the model."""
  contentEntries(first: Int, after: String, last: Int, before: String): ContentEntryConnection!
  """When the model was created."""
  createdAt: DateTime!
  """When the model last changed."""
  updatedAt: DateTime!
}

ContentModelEdge

"""A model in a page of results."""
type ContentModelEdge {
  """The cursor of this edge."""
  cursor: String!
  """The model."""
  node: ContentModel!
}

ContentModelConnection

"""A page of models."""
type ContentModelConnection {
  """The edges in this page."""
  edges: [ContentModelEdge!]!
  """The models in this page."""
  nodes: [ContentModel!]!
  """Where this page sits in the list."""
  pageInfo: PageInfo!
  """
  The number of models that match `category`. `search` does not narrow it.
  """
  totalCount: Int!
}

ContentBlock

"""
A reusable schema fragment that you put inside one or more models. Changing its schema does not
migrate the content entries that embed it; `workspaceContentEntryValidation` finds the entries
that do not match.
"""
type ContentBlock {
  """The ID of the block."""
  id: ID!
  """The workspace that holds the block."""
  workspace: Workspace!
  """
  The role of the block. Null for general content, which has no layout role.
  """
  category: ContentBlockCategory
  """The name of the block."""
  name: String!
  """The description of the block. Null when it has none."""
  description: String
  """The stable identifier of the block. It cannot change."""
  key: String!
  """The fields that each instance of the block holds."""
  schema: ContentSchema!
  """When the block was created."""
  createdAt: DateTime!
  """When the block last changed."""
  updatedAt: DateTime!
}

ContentBlockEdge

"""A block in a page of results."""
type ContentBlockEdge {
  """The cursor of this edge."""
  cursor: String!
  """The block."""
  node: ContentBlock!
}

ContentBlockConnection

"""A page of blocks."""
type ContentBlockConnection {
  """The edges in this page."""
  edges: [ContentBlockEdge!]!
  """The blocks in this page."""
  nodes: [ContentBlock!]!
  """Where this page sits in the list."""
  pageInfo: PageInfo!
  """
  The number of blocks that match `category`. `search` does not narrow it.
  """
  totalCount: Int!
}

ContentEntry

"""One instance of a model, filled with real values."""
type ContentEntry {
  """The ID of the content entry."""
  id: ID!
  """The workspace that holds the content entry."""
  workspace: Workspace!
  """The model that the content entry is an instance of."""
  contentModel: ContentModel!
  """
  The name that the entries list shows: the first filled single-line text field, or `Untitled`
  when there is none.
  """
  title: String!
  """The values of the content entry, typed by its model's schema."""
  data: ContentEntryData!
  """When the content entry was created."""
  createdAt: DateTime!
  """When the content entry last changed."""
  updatedAt: DateTime!
}

ContentEntryEdge

"""A content entry in a page of results."""
type ContentEntryEdge {
  """The cursor of this edge."""
  cursor: String!
  """The content entry."""
  node: ContentEntry!
}

ContentEntryConnection

"""A page of content entries."""
type ContentEntryConnection {
  """The edges in this page."""
  edges: [ContentEntryEdge!]!
  """The content entries in this page."""
  nodes: [ContentEntry!]!
  """Where this page sits in the list."""
  pageInfo: PageInfo!
  """The number of content entries that match the filters."""
  totalCount: Int!
}

Asset

"""
A file that your content points at: an image, a video, a document, or HTML. It belongs to a
project, and each upload of new bytes makes or replaces an asset version.
"""
type Asset {
  """The ID of the asset."""
  id: ID!
  """The project that holds the asset."""
  project: Project!
  """The file name given at upload."""
  fileName: String!
  """
  The workbench that owns the asset. Null for an asset in the project's asset library.
  """
  owner: AssetOwner
  """The MIME type of the current version."""
  mimeType: String!
  """The size of the current version, in bytes."""
  sizeBytes: Int!
  """
  The width of the current version, in pixels. Null when it is not an image.
  """
  width: Int
  """
  The height of the current version, in pixels. Null when it is not an image.
  """
  height: Int
  """
  The storage path of the current version: `<project>/<asset>/<version>/<file name>`.
  """
  storagePath: String!
  """The public URL of the current version's file."""
  url: String!
  """
  The version whose bytes `url`, `mimeType`, `sizeBytes`, `width` and `height` describe.
  """
  currentVersion: AssetVersion!
  """Every version of the asset, oldest first."""
  versions: [AssetVersion!]!
  """When the asset was created."""
  createdAt: DateTime!
}

AssetVersion

"""
One file that somebody uploaded for an asset. Once a publish uses a version, the version never
changes, and the next upload makes a new version.
"""
type AssetVersion {
  """The ID of the asset version."""
  id: ID!
  """The MIME type of the file."""
  mimeType: String!
  """The size of the file, in bytes."""
  sizeBytes: Int!
  """The width of the file, in pixels. Null when it is not an image."""
  width: Int
  """The height of the file, in pixels. Null when it is not an image."""
  height: Int
  """Whether a publish uses the version, so that it never changes."""
  isImmutable: Boolean!
  """
  The lowercase hex SHA-256 of the stored bytes. Null when no hash was recorded, and while an
  upload that replaces this version is not committed.
  """
  sha256: String
  """The public URL of the version's file."""
  url: String!
  """When the version was created."""
  createdAt: DateTime!
}

AssetOwner

"""The workbench that owns an asset."""
type AssetOwner {
  """The kind of owner. Always `"workbench"`."""
  type: String!
  """The ID of the workbench."""
  id: String!
}

AssetEdge

"""An asset in a page of results."""
type AssetEdge {
  """The cursor of this edge."""
  cursor: String!
  """The asset."""
  node: Asset!
}

AssetConnection

"""A page of assets."""
type AssetConnection {
  """The edges in this page."""
  edges: [AssetEdge!]!
  """The assets in this page."""
  nodes: [Asset!]!
  """Where this page sits in the list."""
  pageInfo: PageInfo!
  """The number of assets that match the filters."""
  totalCount: Int!
}

MigrationWarning

"""
A change that a model schema update made to the data of one content entry.
"""
type MigrationWarning {
  """The ID of the content entry whose data changed."""
  contentEntryId: ID!
  """The path of the field in the entry data, such as `$.title`."""
  fieldPath: String!
  """What happened to the value."""
  warningType: MigrationWarningType!
  """
  The value before the change, cut to 80 characters. Null when the value was null.
  """
  oldValue: String
}

WorkspaceContentEntryValidationPayload

"""
The result of `workspaceContentEntryValidation`. It checks each content entry against its model's
schema, including embedded blocks.
"""
type WorkspaceContentEntryValidationPayload {
  """The number of content entries checked."""
  totalCount: Int!
  """The number of content entries that match their schema."""
  validCount: Int!
  """The number of content entries with at least one validation error."""
  invalidCount: Int!
  """The outcome for each content entry, oldest first."""
  outcomes: [ContentEntryValidationOutcome!]!
}

ContentEntryValidationOutcome

"""The validation outcome of one content entry."""
type ContentEntryValidationOutcome {
  """The ID of the content entry."""
  contentEntryId: ID!
  """The ID of the content entry's model."""
  contentModelId: ID!
  """The content entry. Null when it was deleted during the check."""
  contentEntry: ContentEntry
  """The content entry's model. Null when it was deleted during the check."""
  contentModel: ContentModel
  """
  The name of the model at the time of the check, or `(unknown)` when the model is missing.
  """
  contentModelName: String!
  """Whether the content entry matches its model's schema."""
  valid: Boolean!
  """The validation errors. Empty when `valid` is true."""
  errors: [ContentEntryValidationError!]!
}

ContentEntryValidationError

"""A report that one field in a content entry does not match its schema."""
type ContentEntryValidationError {
  """
  The path of the field in the entry data, such as `$.sections[0].headline`.
  """
  path: String!
  """A human-readable description of the error."""
  message: String!
}

ContentModelCreateInput

"""The input of `contentModelCreate`."""
input ContentModelCreateInput {
  """The ID of the workspace to create the model in."""
  workspaceId: ID!
  """
  The role of the model. Omit it for general content. It cannot change later.
  """
  category: ContentModelCategory
  """The name of the model. It must not be blank."""
  name: String!
  """The description of the model."""
  description: String
  """The stable identifier of the model. It cannot change later."""
  key: String!
  """The fields that the model's entries hold."""
  schema: ContentSchemaInput!
}

ContentModelCreatePayload

"""The result of `contentModelCreate`."""
type ContentModelCreatePayload {
  """The created model."""
  contentModel: ContentModel
}

ContentModelUpdateInput

"""The input of `contentModelUpdate`. Omit a field to keep its value."""
input ContentModelUpdateInput {
  """The ID of the model. Required."""
  id: ID!
  """The new name. It must not be blank."""
  name: String
  """The new description."""
  description: String
  """The new schema. The data of the model's entries migrates to it."""
  schema: ContentSchemaInput
}

ContentModelUpdatePayload

"""The result of `contentModelUpdate`."""
type ContentModelUpdatePayload {
  """The updated model."""
  contentModel: ContentModel
  """
  The values that the schema change removed from content entries. Empty when none.
  """
  migrationWarnings: [MigrationWarning!]!
}

ContentModelDeleteInput

"""The input of `contentModelDelete`."""
input ContentModelDeleteInput {
  """The ID of the model."""
  id: ID!
}

ContentModelDeletePayload

"""The result of `contentModelDelete`."""
type ContentModelDeletePayload {
  """The ID of the deleted model."""
  contentModelId: ID
}

ContentBlockCreateInput

"""The input of `contentBlockCreate`."""
input ContentBlockCreateInput {
  """The ID of the workspace to create the block in."""
  workspaceId: ID!
  """
  The role of the block. Omit it for general content. It cannot change later.
  """
  category: ContentBlockCategory
  """The name of the block. It must not be blank."""
  name: String!
  """The description of the block."""
  description: String
  """The stable identifier of the block. It cannot change later."""
  key: String!
  """The fields that each instance of the block holds."""
  schema: ContentSchemaInput!
}

ContentBlockCreatePayload

"""The result of `contentBlockCreate`."""
type ContentBlockCreatePayload {
  """The created block."""
  contentBlock: ContentBlock
}

ContentBlockUpdateInput

"""The input of `contentBlockUpdate`. Omit a field to keep its value."""
input ContentBlockUpdateInput {
  """The ID of the block. Required."""
  id: ID!
  """The new name. It must not be blank."""
  name: String
  """The new description."""
  description: String
  """
  The new schema. The data of content entries that embed the block does not migrate.
  """
  schema: ContentSchemaInput
}

ContentBlockUpdatePayload

"""The result of `contentBlockUpdate`."""
type ContentBlockUpdatePayload {
  """The updated block."""
  contentBlock: ContentBlock
}

ContentBlockDeleteInput

"""The input of `contentBlockDelete`."""
input ContentBlockDeleteInput {
  """The ID of the block."""
  id: ID!
}

ContentBlockDeletePayload

"""The result of `contentBlockDelete`."""
type ContentBlockDeletePayload {
  """The ID of the deleted block."""
  contentBlockId: ID
}

ContentEntryCreateInput

"""The input of `contentEntryCreate`."""
input ContentEntryCreateInput {
  """The ID of the model whose schema the data must match."""
  contentModelId: ID!
  """
  The values of the content entry. Empty data makes an empty entry; data with any value must hold
  every required field.
  """
  data: ContentEntryDataInput!
}

ContentEntryCreatePayload

"""The result of `contentEntryCreate`."""
type ContentEntryCreatePayload {
  """The created content entry."""
  contentEntry: ContentEntry
}

ContentEntryUpdateInput

"""The input of `contentEntryUpdate`. Every field is required."""
input ContentEntryUpdateInput {
  """The ID of the content entry."""
  id: ID!
  """
  The new values of the content entry. They replace all of its data and must hold every required
  field.
  """
  data: ContentEntryDataInput!
}

ContentEntryUpdatePayload

"""The result of `contentEntryUpdate`."""
type ContentEntryUpdatePayload {
  """The updated content entry."""
  contentEntry: ContentEntry
}

ContentEntryDeleteInput

"""The input of `contentEntryDelete`."""
input ContentEntryDeleteInput {
  """The ID of the content entry."""
  id: ID!
}

ContentEntryDeletePayload

"""The result of `contentEntryDelete`."""
type ContentEntryDeletePayload {
  """The ID of the deleted content entry."""
  contentEntryId: ID
}

AssetUploadInitInput

"""
The input of `assetUploadInit`. With `assetId`, the upload replaces the current version while no
publish uses it, and makes a new version once one does.
"""
input AssetUploadInitInput {
  """The ID of the project to upload the asset into."""
  projectId: ID!
  """
  The file name. It must not contain `/` or `\`. Ignored when `path` is given.
  """
  fileName: String!
  """The MIME type of the bytes to upload."""
  contentType: String!
  """
  The ID of an existing asset to upload new bytes for. Omit it to create an asset.
  """
  assetId: ID
  """
  The ID of the workbench the upload belongs to. It must be in the same project.
  """
  workbenchId: ID
  """
  The path of the file in the workbench, such as `drafts/outline-v1.md`. The file name is the part
  after the last `/`.
  """
  path: String
  """
  The hex SHA-256 of the bytes to upload, 64 characters in either case. On a new upload with no
  `assetId` and no `workbenchId`, an asset-library asset that already holds these bytes is
  returned.
  """
  sha256: String
}

AssetUploadInitPayload

"""
The result of `assetUploadInit`. When `deduplicated` is false, PUT the bytes to `uploadUrl`, then
call `assetCommit`; when it is true, the existing version holds the bytes and needs no upload or
commit.
"""
type AssetUploadInitPayload {
  """
  The pre-signed URL to PUT the bytes to. Null when `deduplicated` is true.
  """
  uploadUrl: String
  """
  The ID of the asset: a new ID, the `assetId` given, or the asset that holds matching bytes.
  """
  assetId: ID!
  """
  The ID of the version that the upload writes, or of the existing version that matches.
  """
  versionId: ID!
  """
  The storage path that the upload writes to, or the path of the matching version.
  """
  storagePath: String!
  """
  Whether the project already holds the bytes, so nothing needs uploading.
  """
  deduplicated: Boolean!
}

AssetCommitInput

"""The input of `assetCommit`."""
input AssetCommitInput {
  """The ID of the project that holds the asset."""
  projectId: ID!
  """The ID of the asset that `assetUploadInit` returned."""
  assetId: ID!
  """The ID of the version that `assetUploadInit` returned."""
  versionId: ID!
  """The file name given to `assetUploadInit`."""
  fileName: String!
  """The storage path that `assetUploadInit` returned."""
  storagePath: String!
  """
  The ID of the workbench the upload belongs to. It becomes the owner of a new asset only.
  """
  workbenchId: ID
  """
  The path of the file in the workbench, such as `drafts/outline-v1.md`. It applies only with
  `workbenchId`.
  """
  path: String
  """
  The hex SHA-256 given to `assetUploadInit`. Bytes that hash differently fail the commit.
  """
  sha256: String
}

AssetCommitPayload

"""The result of `assetCommit`."""
type AssetCommitPayload {
  """The committed asset. Null when the commit failed with a user error."""
  asset: Asset
  """The errors that stopped the commit. Empty on success."""
  userErrors: [AssetCommitUserError!]!
}

AssetCommitErrorCode

"""The reason an `assetCommit` failed."""
enum AssetCommitErrorCode {
  """The stored bytes do not hash to the `sha256` in the input."""
  HASH_MISMATCH
}

AssetCommitUserError

"""An error that stopped an `assetCommit`."""
type AssetCommitUserError {
  """
  The path to the input field that caused the error. Null when no field did.
  """
  field: [String!]
  """A human-readable description of the error."""
  message: String!
  """The reason for the error."""
  code: AssetCommitErrorCode!
}

AssetDeleteInput

"""The input of `assetDelete`."""
input AssetDeleteInput {
  """The ID of the asset."""
  id: ID!
}

AssetDeletePayload

"""The result of `assetDelete`."""
type AssetDeletePayload {
  """The ID of the deleted asset."""
  assetId: ID
}

ContentBlockSortKeys

"""The order of `contentBlocks`."""
enum ContentBlockSortKeys {
  """By name, A to Z."""
  NAME
  """By creation time, oldest first."""
  CREATED_AT
  """By last change, oldest first."""
  UPDATED_AT
}

ContentModelSortKeys

"""The order of `contentModels`."""
enum ContentModelSortKeys {
  """By name, A to Z."""
  NAME
  """By creation time, oldest first."""
  CREATED_AT
  """By last change, oldest first."""
  UPDATED_AT
}

ContentEntrySortKeys

"""The order of `contentEntries`."""
enum ContentEntrySortKeys {
  """By creation time, oldest first."""
  CREATED_AT
  """By last change, oldest first."""
  UPDATED_AT
}

AssetSortKeys

"""The order of `assets`."""
enum AssetSortKeys {
  """By file name, A to Z."""
  NAME
  """By upload time, oldest first."""
  CREATED_AT
}

AssetKind

"""
A media type group of assets, matched against the MIME type of the current version.
"""
enum AssetKind {
  """`image/*`."""
  IMAGE
  """`video/*`."""
  VIDEO
  """`audio/*`."""
  AUDIO
  """Any file that is not an image, video, audio or archive."""
  DOCUMENT
  """An archive: zip, rar, gzip, 7z or tar."""
  ARCHIVE
}