---
title: "Update a content"
method: POST
path: "/v2beta/cms/content/update"
tags: ["Contents"]
---

# Update a content

`POST /v2beta/cms/content/update`

## Request

- Base URL: `https://api.karte.io`
- URL: `https://api.karte.io/v2beta/cms/content/update`
- Auth: HTTP bearer

Craft Cross CMSのコンテンツを更新します。

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

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

## Headers

- `x-karte-api` string
- `authorization` string
- `content-type` string

## Request body

- object
  - `modelId` string, required: コンテンツが所属するモデルのID
  - `contentId` string, required: 更新するコンテンツのID
  - `data` object, required: コンテンツの内容を指定します。モデルで定義したフィールドに従って、コンテンツの内容を指定してください。 ### リッチテキストフィールドの指定方法 リッチテキストフィールドの値は `json` 要素のみ有効です。 `text` および `html` は無視されます。 例: ID `richtext` のリッチテキストフィールドに、 `<h1>RichText</h1>` という内容を指定する場合、次のように指定します。 ```json "richtext": { "json": { "type": "doc", "content": [ { "type": "heading", "attrs": { "level": 1 }, "content": [ { "type": "text", "text": "RichText" } ] } ] } } ``` ### 画像フィールドの指定方法 画像フィールドの値は、メディアライブラリの画像のIDを文字列として指定してください。 例：`image` というIDの画像フィールドに、`6347f05d5d18d4536af5f336` というIDの画像を指定する場合、次のように指定します。 ```json "image": "6347f05d5d18d4536af5f336" ```
  - `kickHookV2` boolean: この操作でHook V2のトリガーを発火するかどうか。（[参照](https://developers.karte.io/reference/hook-v2-karte-craft-channel)）

## Response `200`

A successful response.

- Content: コンテンツの情報を表します。
  - `id` string, required: コンテンツのIDです。
  - `sys` SysData: システム側で自動で設定された情報が入ります。 sys.customOrderには、管理画面にてコンテンツの手動並び替えを行った際の順序値（Number型）が入ります。
    - `customOrder` integer
    - `modelId` string
    - `ownerId` string
    - `raw` RawData: コンテンツの生データを表します。
      - `createdAt` string: コンテンツの作成日時です。
      - `createdBy` string: コンテンツの作成者です。
      - `updatedAt` string: コンテンツの更新日時です。
      - `updatedBy` string: コンテンツの更新者です。
      - `firstPublishedAt` string, nullable: コンテンツの初回公開日時です。
      - `publishedAt` string, nullable: コンテンツの公開日時です。
      - `contentId` string: コンテンツのIDです。
      - `revisionId` string: コンテンツのリビジョンIDです。
      - `publishedRevisionId` string, nullable: コンテンツの公開済リビジョンIDです。

## Other responses

- `400`: Bad Request. CMS Management API 400 responses include a non-empty detail.
- `422`: Unprocessable Content. CMS model or custom field type structure validation failed.

---

[API](https://skmtc.dev/karte/apis/cms-management.md) - [All operations](https://skmtc.dev/karte/apis/cms-management/llms.txt) - [OpenAPI document](https://skmtc.dev/karte/apis/cms-management/revisions/275f2d6496ec?raw)
