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

# Find Craft function's code by version

Craft functionのコードをバージョンで検索します

#### Required Scope
APIの実行に必要なScopeです。
```
beta.craft.function.code.findByVersion
```

#### 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/function/code/findByVersion": {
      "post": {
        "tags": [
          "Craft Function"
        ],
        "summary": "Find Craft function's code by version",
        "description": "Craft functionのコードをバージョンで検索します\n\n#### Required Scope\nAPIの実行に必要なScopeです。\n```\nbeta.craft.function.code.findByVersion\n```\n\n#### Required Role\n管理画面でScopeを追加する際に必要な権限です。\n```\nCraft > Craft 設定の閲覧\n```\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "function_id",
                  "version"
                ],
                "properties": {
                  "function_id": {
                    "type": "string",
                    "description": "ファンクションIDです。管理画面のURLに含まれるIDです。",
                    "pattern": "^[a-f\\d]{24}$",
                    "example": "1234567890abcdef12345678"
                  },
                  "version": {
                    "type": "string",
                    "description": "Craft Functionのバージョンです。",
                    "example": 1
                  }
                },
                "type": "object",
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CraftCode"
                }
              }
            }
          }
        },
        "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": {
      "CraftCode": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "function_id": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "packages": {
            "type": "object",
            "additionalProperties": true
          },
          "refreshDependencies": {
            "type": "boolean",
            "description": "パッケージの依存関係を再解決したかどうか"
          },
          "minReleaseAge": {
            "type": "number",
            "minimum": 0,
            "description": "パッケージの最小公開日数（日）"
          },
          "variables": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "name": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "value": {
                  "oneOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "boolean"
                    }
                  ]
                },
                "required": {
                  "type": "boolean"
                },
                "description": {
                  "type": "string"
                }
              },
              "required": [
                "name",
                "type",
                "value",
                "required"
              ]
            }
          }
        }
      }
    }
  },
  "x-explorer-enabled": false
}
````