---
updatedAt: 2026-05-01T04:21:23.000Z
agentTools:
  projectIndex: https://developers.karte.io/llms.txt
---

# Get preview content


  プレビュー用のコンテンツを取得します。

  #### APIエンドポイント
  `{subdomain}` にはプロジェクト固有の値が入ります。KARTE管理画面の「CMS設定」>「APIエンドポイント」で確認できます。

  ⚠️ **注意**: Base URLの`{subdomain}`を編集しても、API Requestのコード例には反映されません。Shell/Node/Ruby等のExampleは反映されるのでそちらを使うか、API Requestを利用する場合は`devKarte.server()`で実際のエンドポイントURLを指定してください。

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

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

  #### レート制限
  プロジェクトごとに、1秒あたり20回までです。CDN API・Preview API は別々に数え、一覧取得と単体取得は合算します。超えると `429 Too Many Requests` を返します。`Retry-After` ヘッダーの秒数だけ待ってから再度リクエストしてください。
  

# OpenAPI definition

````json
{
  "openapi": "3.0.0",
  "info": {
    "title": "CMS Preview",
    "version": "2.0.0"
  },
  "tags": [
    {
      "name": "Preview",
      "description": "Preview related operations"
    }
  ],
  "x-explorer-enabled": false,
  "servers": [
    {
      "url": "https://{subdomain}.cdn-api.karte.io",
      "description": "Production Preview API server",
      "variables": {
        "subdomain": {
          "description": "Project specific subdomain",
          "default": "your-project-subdomain"
        }
      }
    }
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "karteError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "example": "The request was invalid."
          }
        },
        "required": [
          "error"
        ]
      }
    }
  },
  "paths": {
    "/beta/cms/content/preview/get": {
      "get": {
        "description": "\n  プレビュー用のコンテンツを取得します。\n\n  #### APIエンドポイント\n  `{subdomain}` にはプロジェクト固有の値が入ります。KARTE管理画面の「CMS設定」>「APIエンドポイント」で確認できます。\n\n  ⚠️ **注意**: Base URLの`{subdomain}`を編集しても、API Requestのコード例には反映されません。Shell/Node/Ruby等のExampleは反映されるのでそちらを使うか、API Requestを利用する場合は`devKarte.server()`で実際のエンドポイントURLを指定してください。\n\n  #### Required Scope\n  APIの実行に必要なScopeです。\n  ```\n  beta.cdn.cms.content.preview.get\n  ```\n\n  #### Required Role\n  管理画面でScopeを追加する際に必要な権限です。\n  ```\n  Craft > Craft 設定の編集\n  ```\n\n  #### レート制限\n  プロジェクトごとに、1秒あたり20回までです。CDN API・Preview API は別々に数え、一覧取得と単体取得は合算します。超えると `429 Too Many Requests` を返します。`Retry-After` ヘッダーの秒数だけ待ってから再度リクエストしてください。\n  ",
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get preview content",
        "tags": [
          "Preview"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "取得するコンテンツが所属するモデルのIDを指定します。",
              "example": "6347f05d5d18d4536af5f336"
            },
            "required": true,
            "description": "取得するコンテンツが所属するモデルのIDを指定します。",
            "name": "modelId",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "取得するコンテンツのIDを指定します。",
              "example": "610b77253adec80018727d57"
            },
            "required": true,
            "description": "取得するコンテンツのIDを指定します。",
            "name": "contentId",
            "in": "query"
          },
          {
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^[a-zA-Z]"
              },
              "default": [],
              "description": "取得するコンテンツが持つプロパティを指定できます。複数の値を指定できます。idは必ず含まれます。",
              "example": [
                "title",
                "slug"
              ]
            },
            "required": false,
            "description": "取得するコンテンツが持つプロパティを指定できます。複数の値を指定できます。idは必ず含まれます。",
            "name": "select",
            "in": "query",
            "style": "deepObject",
            "explode": true
          },
          {
            "schema": {
              "type": "string",
              "description": "今後利用する可能性のある予約語です。現在は設定不要です。"
            },
            "required": false,
            "description": "今後利用する可能性のある予約語です。現在は設定不要です。",
            "name": "x-karte-api",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "Success Response",
            "headers": {
              "x-ratelimit-limit": {
                "description": "1秒あたりに受け付けるリクエスト数の上限です。",
                "schema": {
                  "type": "integer",
                  "example": 20
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "コンテンツのIDです。",
                          "example": "6109f05d5d18d6006af5f385"
                        },
                        "sys": {
                          "type": "object",
                          "properties": {
                            "createdAt": {
                              "type": "string",
                              "description": "コンテンツの作成日時です。",
                              "example": "2025-04-06T00:18:26.810Z"
                            },
                            "updatedAt": {
                              "type": "string",
                              "description": "コンテンツの更新日時です。",
                              "example": "2025-04-06T08:39:45.628Z"
                            },
                            "modelId": {
                              "type": "string",
                              "description": "コンテンツが所属するモデルのIDです。",
                              "example": "6347f05d5d18d4536af5f336"
                            },
                            "customOrder": {
                              "type": "integer",
                              "minimum": 0,
                              "description": "カスタム順序の値です。",
                              "example": 15
                            },
                            "raw": {
                              "type": "object",
                              "properties": {
                                "createdAt": {
                                  "type": "string",
                                  "description": "コンテンツの作成日時（生データ）です。",
                                  "example": "2025-04-05T05:29:09.614Z"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "description": "コンテンツの更新日時（生データ）です。",
                                  "example": "2025-04-06T08:39:45.628Z"
                                },
                                "firstPublishedAt": {
                                  "type": "string",
                                  "nullable": true,
                                  "description": "コンテンツの初回公開日時です。",
                                  "example": "2025-04-06T00:18:26.810Z"
                                },
                                "publishedAt": {
                                  "type": "string",
                                  "nullable": true,
                                  "description": "コンテンツの最新公開日時です。",
                                  "example": "2025-04-06T08:39:45.628Z"
                                }
                              },
                              "description": "システム情報の生データです。"
                            }
                          },
                          "description": "システム側で自動で設定された情報が入ります。"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": {
                        "nullable": true
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "x-ratelimit-limit": {
                "description": "1秒あたりに受け付けるリクエスト数の上限です。",
                "schema": {
                  "type": "integer",
                  "example": 20
                }
              },
              "retry-after": {
                "description": "次にリクエストできるまでの秒数です。",
                "schema": {
                  "type": "integer",
                  "example": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/karteError"
                }
              }
            }
          },
          "default": {
            "description": "unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/karteError"
                }
              }
            }
          }
        }
      }
    }
  }
}
````