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

# Get Craft Sites content

Craft Sitesのコンテンツを取得します。

#### Required Scope
APIの実行に必要なScopeです。
```
beta.craft.sites.content.get
```

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


# 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": "Craft"
  },
  "paths": {
    "/v2beta/craft/sites/content/get": {
      "post": {
        "tags": [
          "Sites"
        ],
        "summary": "Get Craft Sites content",
        "description": "Craft Sitesのコンテンツを取得します。\n\n#### Required Scope\nAPIの実行に必要なScopeです。\n```\nbeta.craft.sites.content.get\n```\n\n#### Required Role\n管理画面でScopeを追加する際に必要な権限です。\n```\nCraft > Craft 設定の閲覧\n```\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "siteName",
                  "path"
                ],
                "properties": {
                  "siteName": {
                    "type": "string",
                    "example": "my-web-site",
                    "description": "サイト名"
                  },
                  "path": {
                    "type": "string",
                    "example": "/index.html",
                    "pattern": "^/.*$",
                    "description": "コンテンツのパス。`/` から始まるパスを指定します。"
                  }
                },
                "type": "object",
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SitesContent"
                }
              }
            }
          },
          "404": {
            "description": "コンテンツが見つからない場合",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundError"
                },
                "example": {
                  "error": "File not found"
                }
              }
            }
          }
        },
        "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": {
      "SitesContent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "content",
          "path",
          "siteName"
        ],
        "properties": {
          "path": {
            "type": "string",
            "example": "/path/to/content",
            "description": "コンテンツのパス"
          },
          "siteName": {
            "type": "string",
            "example": "your-site-name",
            "description": "サイト名"
          },
          "content": {
            "type": "string",
            "example": "PGh0bWw+PGJvZHk+aGVsbG8gd29ybGQhPC9ib2R5PjwvaHRtbD4=",
            "description": "コンテンツの本文。エンコーディングは `encoding` の指定に従います。指定したコンテンツが存在しない場合は空文字列 `\"\"` が返ります。"
          },
          "contentType": {
            "type": "string",
            "example": "text/html",
            "description": "コンテンツの [メディアタイプ](https://developer.mozilla.org/ja/docs/Web/HTTP/Basics_of_HTTP/MIME_types)"
          },
          "encoding": {
            "type": "string",
            "example": "base64",
            "description": "コンテンツのエンコーディング。 `base64` で固定です。"
          },
          "isPublic": {
            "type": "boolean",
            "example": true,
            "description": "コンテンツが公開されているかどうか。公開されている場合は `true` が返ります。\n実サイト上での公開状態です。認証付きサイトでは、isPublicがtrueでも認証済みユーザー以外は実サイト上でアクセスできません。\n"
          },
          "generation": {
            "type": "integer",
            "format": "int64",
            "example": 1729047458651849,
            "description": "コンテンツの世代番号です。コンテンツが更新されるたびに新しい世代番号が割り当てられます。"
          },
          "metaData": {
            "type": "object",
            "nullable": true,
            "additionalProperties": false,
            "description": "コンテンツのメタデータ",
            "properties": {
              "userDefinedValues": {
                "type": "object",
                "nullable": true,
                "description": "ユーザーが定義したメタデータ",
                "additionalProperties": true
              }
            }
          }
        }
      },
      "NotFoundError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      }
    }
  },
  "x-explorer-enabled": false
}
````