---
updatedAt: 2026-04-27T13:23:27.000Z
agentTools:
  projectIndex: https://developers.karte.io/llms.txt
---

# Create a content

Craft Cross CMSのコンテンツを作成します。

#### Required Scope
APIの実行に必要なScopeです。
```
beta.cms.content.create
```

#### Required Role
管理画面でScopeを追加する際に必要な権限です。
```
Craft Cross CMS > CMSの編集
```


# OpenAPI definition

````json
{
  "openapi": "3.0.0",
  "servers": [
    {
      "url": "https://api.karte.io",
      "description": "Production server"
    },
    {
      "url": "https://api-jp.karte.io",
      "description": "Production JP server. リージョン固定オプションのプロジェクトはこちらのエンドポイントを利用してください."
    }
  ],
  "info": {
    "version": "2.0.0",
    "title": "CMS Management"
  },
  "paths": {
    "/v2beta/cms/content/create": {
      "post": {
        "tags": [
          "Contents"
        ],
        "summary": "Create a content",
        "description": "Craft Cross CMSのコンテンツを作成します。\n\n#### Required Scope\nAPIの実行に必要なScopeです。\n```\nbeta.cms.content.create\n```\n\n#### Required Role\n管理画面でScopeを追加する際に必要な権限です。\n```\nCraft Cross CMS > CMSの編集\n```\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "modelId": {
                    "type": "string",
                    "description": "コンテンツが所属するモデルのID",
                    "example": "6347f05d5d18d4536af5f336"
                  },
                  "data": {
                    "type": "object",
                    "description": "コンテンツの内容を指定します。モデルで定義したフィールドに従って、コンテンツの内容を指定してください。\n\n### リッチテキストフィールドの指定方法\n\nリッチテキストフィールドの値は `json` 要素のみ有効です。 `text` および `html` は無視されます。\n\n例: ID `richtext` のリッチテキストフィールドに、 `<h1>RichText</h1>` という内容を指定する場合、次のように指定します。\n\n```json\n\"richtext\": {\n  \"json\": {\n    \"type\": \"doc\",\n    \"content\": [\n      {\n        \"type\": \"heading\",\n        \"attrs\": {\n          \"level\": 1\n        },\n        \"content\": [\n          {\n            \"type\": \"text\",\n            \"text\": \"RichText\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n### 画像フィールドの指定方法\n\n画像フィールドの値は、メディアライブラリの画像のIDを文字列として指定してください。\n\n例：`image` というIDの画像フィールドに、`6347f05d5d18d4536af5f336` というIDの画像を指定する場合、次のように指定します。\n\n```json\n\"image\": \"6347f05d5d18d4536af5f336\"\n```\n",
                    "additionalProperties": {
                      "nullable": true,
                      "example": {
                        "title": "title1"
                      }
                    }
                  },
                  "kickHookV2": {
                    "type": "boolean",
                    "example": true,
                    "default": false,
                    "description": "この操作でHook V2のトリガーを発火するかどうか。（[参照](https://developers.karte.io/reference/hook-v2-karte-craft-channel)）"
                  }
                },
                "required": [
                  "modelId",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Content"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. CMS Management API 400 responses include a non-empty detail.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CmsBadRequestProblemDetail"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content. CMS model or custom field type structure validation failed.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CmsUnprocessableProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-karte-api",
            "schema": {
              "type": "string"
            },
            "description": "今後利用する可能性のある予約語です。現在は設定不要です。"
          },
          {
            "in": "header",
            "name": "authorization",
            "schema": {
              "type": "string"
            },
            "description": "認証情報を含むトークンです。\"Authorization\" ヘッダーに `Bearer <token>` の形式で設定してください。"
          },
          {
            "in": "header",
            "name": "content-type",
            "schema": {
              "type": "string"
            },
            "description": "リクエストのコンテンツタイプを指定します。通常は `application/json` を使用してください。"
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "Content": {
        "allOf": [
          {
            "type": "object",
            "description": "コンテンツの情報を表します。\n",
            "properties": {
              "id": {
                "description": "コンテンツのIDです。",
                "type": "string",
                "example": "6109f05d5d18d6006af5f385"
              },
              "sys": {
                "$ref": "#/components/schemas/SysData"
              }
            },
            "required": [
              "id"
            ]
          },
          {
            "type": "object",
            "additionalProperties": {
              "nullable": true
            }
          }
        ],
        "example": {
          "id": "6109f05d5d18d6006af5f385",
          "title": "title1",
          "body": {
            "text": "Rich Text",
            "html": "<h1>Rich Text</h1>",
            "json": {
              "type": "doc",
              "content": [
                {
                  "type": "heading",
                  "attrs": {
                    "level": 1
                  },
                  "content": [
                    {
                      "type": "text",
                      "text": "RichText"
                    }
                  ]
                }
              ]
            }
          },
          "sys": {
            "customOrder": 15,
            "modelId": "6347f05d5d18d4536af5f336",
            "raw": {
              "createdAt": "2025-04-06T00:18:26.810Z",
              "createdBy": "6757a6444bf949f948348941",
              "updatedAt": "2025-04-06T08:39:45.628Z",
              "updatedBy": "6757a6444bf949f948348941",
              "firstPublishedAt": "2025-04-06T00:18:26.810Z",
              "publishedAt": "2025-04-06T08:39:45.628Z",
              "contentId": "6109f05d5d18d6006af5f385",
              "revisionId": "67ce733b3640300ad776d80e",
              "publishedRevisionId": "67ce733b3640300ad776d80e"
            }
          }
        }
      },
      "SysData": {
        "type": "object",
        "description": "システム側で自動で設定された情報が入ります。\nsys.customOrderには、管理画面にてコンテンツの手動並び替えを行った際の順序値（Number型）が入ります。\n",
        "additionalProperties": false,
        "properties": {
          "customOrder": {
            "type": "integer",
            "minimum": 0,
            "example": 15
          },
          "modelId": {
            "type": "string",
            "example": "6347f05d5d18d4536af5f336"
          },
          "ownerId": {
            "type": "string",
            "example": "6757a6444bf949f948348941"
          },
          "raw": {
            "$ref": "#/components/schemas/RawData"
          }
        }
      },
      "RawData": {
        "type": "object",
        "description": "コンテンツの生データを表します。\n",
        "additionalProperties": false,
        "properties": {
          "createdAt": {
            "type": "string",
            "description": "コンテンツの作成日時です。",
            "example": "2025-04-05T05:29:09.614Z"
          },
          "createdBy": {
            "type": "string",
            "description": "コンテンツの作成者です。",
            "example": "6757a6444bf949f948348941"
          },
          "updatedAt": {
            "type": "string",
            "description": "コンテンツの更新日時です。",
            "example": "2025-04-06T08:39:45.628Z"
          },
          "updatedBy": {
            "type": "string",
            "description": "コンテンツの更新者です。",
            "example": "6757a6444bf949f948348941"
          },
          "firstPublishedAt": {
            "type": "string",
            "description": "コンテンツの初回公開日時です。",
            "nullable": true,
            "example": "2025-04-06T00:18:26.810Z"
          },
          "publishedAt": {
            "type": "string",
            "description": "コンテンツの公開日時です。",
            "nullable": true,
            "example": "2025-04-06T08:39:45.628Z"
          },
          "contentId": {
            "type": "string",
            "description": "コンテンツのIDです。",
            "example": "6109f05d5d18d6006af5f385"
          },
          "revisionId": {
            "type": "string",
            "description": "コンテンツのリビジョンIDです。",
            "example": "67ce733b3640300ad776d80e"
          },
          "publishedRevisionId": {
            "type": "string",
            "nullable": true,
            "description": "コンテンツの公開済リビジョンIDです。",
            "example": "67ce733b3640300ad776d80e"
          }
        }
      },
      "CmsBadRequestProblemDetail": {
        "description": "RFC 9457 Problem Details returned when the CMS request is invalid.",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "https://api.karte.io/errors/bad-request"
            ]
          },
          "title": {
            "type": "string",
            "enum": [
              "Bad Request"
            ]
          },
          "status": {
            "type": "integer",
            "enum": [
              400
            ]
          },
          "detail": {
            "type": "string",
            "minLength": 1
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "field",
                "message"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "additionalProperties": false
      },
      "CmsUnprocessableProblemDetail": {
        "description": "RFC 9457 Problem Details returned when a CMS model or custom field type structure is invalid.",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "https://api.karte.io/errors/unprocessable-content"
            ]
          },
          "title": {
            "type": "string",
            "enum": [
              "Unprocessable Content"
            ]
          },
          "status": {
            "type": "integer",
            "enum": [
              422
            ]
          },
          "detail": {
            "type": "string",
            "minLength": 1
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "field",
                "message"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "additionalProperties": false
      }
    }
  },
  "x-explorer-enabled": false
}
````