{
  "openapi": "3.0.0",
  "info": {
    "title": "パーマスタイル",
    "description": "# 概要\nパーマスタイルフィルターで、弾むようなカール、ゆるやかなウェーブ、大胆なカールスタイルなど、自宅にいながら数秒で新しいヘアスタイルを試せます。\n\nソフトなウェーブから大胆なアフロまで、精度とリアリズムの高さは他社と一線を画します。次のサロン訪問前に、自信を持って新しいヘアスタイルを試すための理想的なツールです。\n\n\n![](https://plugins-media.makeupar.com/smb/blog/post/2025-04-01/webp_03963789-fb1e-4ad8-be4d-48932e247376.jpg)\n\n![](https://plugins-media.makeupar.com/smb/blog/post/2025-03-20/b25b228a-259b-4efb-a7c1-31d200b62e8c.jpg)\n\n撮影時の推奨事項:\n![撮影時の推奨事項](https://bcw-media.s3.ap-northeast-1.amazonaws.com/AI_Hair_Extension_recommendation_ba24bd5d92.png \"撮影時の推奨事項\")\n\n---\n\n## ファイル仕様とエラー\n\n* 対応フォーマットとサイズ\n\n|AI 機能|対応サイズ|対応ファイルサイズ|対応フォーマット|\n|  ----  | ----  | ----  | ----  |\n|パーマスタイル|長辺 <= 1024、顔幅 >= 128、顔の姿勢: -10 < pitch < +10, -45 < yaw < +45, -15 < roll < +15、単一の顔のみ、顔全体が写っている必要あり|< 10MB|jpg/jpeg/png|\n\n* エラーコード\n\n|エラーコード|説明|\n|  ----  | ----  |\n|error_no_shoulder\t|ソース画像に肩が写っていません\n|error_large_face_angle\t|アップロードされた画像の顔の角度が大きすぎます\n|error_insufficient_landmarks\t|ソース画像で十分な顔または体のランドマークを検出できません\n|error_hair_too_short\t|入力された髪が短すぎます\n|error_face_pose\t|ソース画像の顔の姿勢はサポートされていません\n\n---\n\n## ユニット消費量\n\n| AI 機能 | 消費ユニット |\n|---|---|\n| パーマスタイル V1.0 | 1 |\n\n---\n",
    "version": "",
    "termsOfService": "https://www.makeupar.com/perfectbeauty/youcam/terms-of-service-api",
    "contact": {
      "email": "YouCamOnlineEditor_API@perfectcorp.com"
    },
    "license": {
      "name": "Privacy policy",
      "url": "https://www.makeupar.com/perfectbeauty/youcam/privacy-policy-api"
    }
  },
  "servers": [
    {
      "url": "https://yce-api-01.makeupar.com"
    }
  ],
  "tags": [
    {
      "name": "V1.0",
      "description": "パーマスタイル API を使用すると、事前定義されたテンプレートを使用して画像にパーマスタイルを適用できます。"
    }
  ],
  "paths": {
    "/s2s/v2.0/task/template/hair-curl": {
      "get": {
        "summary": "事前定義されたテンプレートを一覧表示します。",
        "tags": [
          "V1.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "parameters": [
          {
            "name": "page_size",
            "in": "query",
            "schema": {
              "type": "integer",
              "example": 20
            },
            "description": "このページで返す結果の数。有効な値は 1 から 20 の間です。初期値は 20 です。"
          },
          {
            "name": "starting_token",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "73a3c9e69b89"
            },
            "description": "現在のページのトークン。最初のページでは `null` から開始し、前のレスポンスの `next_token` を使用して次のページを開始します"
          }
        ],
        "responses": {
          "200": {
            "description": "スタイルの取得に成功しました",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateResponseSchema"
                }
              }
            }
          },
          "400": {
            "description": "無効なリクエストパラメータ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorInvalidParameters"
                }
              }
            }
          },
          "401": {
            "description": "無効な API キー、非アクティブな API キー、または期限切れの API キー",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorInvalidApiKey"
                }
              }
            }
          }
        }
      }
    },
    "/s2s/v2.0/task/hair-curl": {
      "post": {
        "summary": "パーマスタイルタスクを実行します。",
        "description": "タスクステータスの確認については、ポーリングガイドを参照してください。",
        "tags": [
          "V1.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunWithSingleTemplateAndSrcUrl"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "タスクの実行に成功しました",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BasicRunTaskResponseV2"
                }
              }
            }
          },
          "400": {
            "description": "タスクの実行に失敗しました",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorRunError"
                }
              }
            }
          },
          "401": {
            "description": "無効な API キー、非アクティブな API キー、または期限切れの API キー",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorInvalidApiKey"
                }
              }
            }
          },
          "429": {
            "description": "一定時間内にリクエストが多すぎます",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/s2s/v2.0/task/hair-curl/{task_id}": {
      "get": {
        "summary": "パーマスタイルタスクのステータスを確認します。",
        "tags": [
          "V1.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe"
            },
            "description": "確認するタスクの ID"
          }
        ],
        "responses": {
          "200": {
            "description": "タスクステータスの確認に成功しました",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskStatusResponseV2"
                }
              }
            }
          },
          "400": {
            "description": "無効なタスク ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorInvalidTaskId"
                }
              }
            }
          },
          "401": {
            "description": "無効な API キー、非アクティブな API キー、または期限切れの API キー",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorInvalidApiKey"
                }
              }
            }
          },
          "500": {
            "description": "タスクが期待される時間内にレスポンスを返していません",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorTaskTimeout"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "FileV1.1": {
        "title": "ファイル V1.1",
        "description": "このオブジェクトはファイルを表します。",
        "type": "object",
        "required": [
          "files"
        ],
        "properties": {
          "files": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "content_type",
                "file_name",
                "file_size"
              ],
              "properties": {
                "content_type": {
                  "type": "string",
                  "example": "image/jpg",
                  "description": "このファイルのコンテンツ MIME タイプ。現在利用可能な値は enum に記載されています。"
                },
                "file_name": {
                  "type": "string",
                  "example": "my-selfie.jpg",
                  "description": "このファイルの名前"
                },
                "file_size": {
                  "type": "integer",
                  "example": 50000,
                  "description": "このファイルのコンテンツ長 (バイト単位)。10MB を超えてはいけません。"
                }
              }
            }
          }
        }
      },
      "BasicFileResponse": {
        "type": "object",
        "properties": {
          "files": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "content_type": {
                  "type": "string",
                  "example": "image/jpg",
                  "description": "このファイルのコンテンツ MIME タイプ。"
                },
                "file_name": {
                  "type": "string",
                  "example": "my-selfie.jpg",
                  "description": "このファイルの名前"
                },
                "file_id": {
                  "type": "string",
                  "example": "U8aqJbsXGT537jtGnEDFHqxdDXqh8+oTF/cSkLimzuvVwMP+Jb1XbjPsf7ZgUgLY",
                  "description": "このファイルの ID。他のタスク実行 API ではこの `file_id` が必要です。"
                },
                "requests": {
                  "type": "array",
                  "description": "以下の `url`、`headers`、`method` を使用してファイルをアップロードします。完了後、`file_id` を使用してタスク実行 API の呼び出しを進めます。",
                  "items": {
                    "type": "object",
                    "properties": {
                      "headers": {
                        "type": "object",
                        "example": {
                          "Content-Type": "image/jpg",
                          "Content-Length": 50000
                        },
                        "description": "ファイルのアップロード時に含めるヘッダー"
                      },
                      "url": {
                        "type": "string",
                        "example": "https://example.com/presigned-upload-url",
                        "description": "このファイルをアップロードする URL"
                      },
                      "method": {
                        "type": "string",
                        "example": "PUT",
                        "description": "このファイルをアップロードするための HTTP メソッド"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "FileResponseV2": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "example": 200,
            "description": "レスポンスステータス"
          },
          "data": {
            "$ref": "#/components/schemas/BasicFileResponse"
          }
        }
      },
      "Template": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "テンプレートの ID。タスク実行時に `template_id` として使用します。",
            "example": "good_template_001"
          },
          "thumb": {
            "type": "string",
            "description": "スタイルのサムネイル。"
          },
          "title": {
            "type": "string",
            "description": "テンプレートのタイトル。"
          },
          "category_name": {
            "type": "string",
            "description": "テンプレートのカテゴリ名。"
          }
        }
      },
      "TemplateResponseSchema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "description": "レスポンスステータス",
            "example": 200
          },
          "data": {
            "type": "object",
            "properties": {
              "templates": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Template"
                }
              },
              "next_token": {
                "type": "string",
                "example": "73a3c9e69b89",
                "description": "次のページをクエリするためのトークン。"
              }
            }
          }
        }
      },
      "RunWithSingleTemplateAndSrcUrl": {
        "title": "RunWithSingleTemplateAndSrcUrl",
        "allOf": [
          {
            "$ref": "#/components/schemas/RunWithSingleTemplate"
          },
          {
            "$ref": "#/components/schemas/BasicRunTaskV2"
          }
        ]
      },
      "RunWithSingleTemplate": {
        "title": "RunWithSingleTemplate",
        "type": "object",
        "properties": {
          "template_id": {
            "type": "string",
            "description": "テンプレートの ID。事前に定義されたテンプレートを一覧表示し、その中のテンプレート ID を使用します。",
            "example": "good_template_001"
          }
        },
        "required": [
          "template_id"
        ]
      },
      "BasicRunTaskV2SrcFileUrl": {
        "title": "ソースファイル URL でタスクを実行",
        "type": "object",
        "required": [
          "src_file_url"
        ],
        "properties": {
          "src_file_url": {
            "type": "string",
            "description": "タスクを実行するファイルの URL。この URL は公開されている必要があります。",
            "example": "https://example.com/selfie.jpg"
          }
        }
      },
      "BasicRunTaskV2SrcFileId": {
        "title": "ソースファイル ID でタスクを実行",
        "type": "object",
        "required": [
          "src_file_id"
        ],
        "properties": {
          "src_file_id": {
            "type": "string",
            "description": "タスクを実行するファイルの ID。ファイルアップロード API から取得したファイル ID です。",
            "example": "pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE="
          }
        }
      },
      "BasicRunTaskV2": {
        "title": "BasicRunTaskV2",
        "anyOf": [
          {
            "$ref": "#/components/schemas/BasicRunTaskV2SrcFileUrl"
          },
          {
            "$ref": "#/components/schemas/BasicRunTaskV2SrcFileId"
          }
        ]
      },
      "BasicRunTaskResponseV2": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "description": "レスポンスステータス",
            "example": 200
          },
          "data": {
            "type": "object",
            "properties": {
              "task_id": {
                "type": "string",
                "description": "このタスクの ID。タスク結果はこの ID で 24 時間有効です。",
                "example": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe"
              }
            }
          }
        }
      },
      "TaskStatusResponseV2": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "description": "レスポンスステータス",
            "example": 200
          },
          "data": {
            "type": "object",
            "properties": {
              "task_status": {
                "type": "string",
                "enum": [
                  "running",
                  "success",
                  "error"
                ],
                "description": "このタスクのステータス"
              },
              "error": {
                "$ref": "#/components/schemas/EngineErrorCode"
              },
              "error_message": {
                "type": "string",
                "description": "エラーの詳細説明"
              },
              "results": {
                "$ref": "#/components/schemas/TaskStatusResponseBodySingleUrlResultsV2"
              }
            }
          }
        }
      },
      "TaskStatusResponseBodySingleUrlResultsV2": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "この結果をダウンロードするための URL。2 時間有効です。",
            "example": "https://example.com/sample-result-url"
          }
        }
      },
      "EngineErrorCode": {
        "type": "string",
        "nullable": true,
        "enum": [
          "exceed_max_filesize",
          "invalid_parameter",
          "error_download_image",
          "error_download_mask",
          "error_decode_image",
          "error_decode_mask",
          "error_nsfw_content_detected",
          "error_no_face",
          "error_pose",
          "error_face_parsing",
          "error_inference",
          "exceed_nsfw_retry_limits",
          "error_upload",
          "unknown_internal_error"
        ],
        "description": "エラー:\n- `exceed_max_filesize` - 入力ファイルサイズが最大制限を超えています\n- `invalid_parameter` - 無効なパラメータ値です\n- `error_download_image` - ソース画像のダウンロードエラーです\n- `error_download_mask` - マスク画像のダウンロードエラーです\n- `error_decode_image` - ソース画像のデコードエラーです\n- `error_decode_mask` - マスク画像のデコードエラーです\n- `error_nsfw_content_detected` - ソース画像に NSFW コンテンツが検出されました\n- `error_no_face` - ソース画像に顔が検出されませんでした\n- `error_pose` - ソース画像のポーズ検出に失敗しました\n- `error_face_parsing` - ソース画像の顔セグメンテーションに失敗しました\n- `error_inference` - 推論パイプラインエラーです\n- `exceed_nsfw_retry_limits` - NSFW 画像生成を避けるためのリトライ制限を超えました\n- `error_upload` - 結果画像のアップロードエラーです\n- `unknown_internal_error` - その他\n"
      },
      "ErrorInvalidParameters": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "example": 400,
            "description": "レスポンスステータス"
          },
          "error": {
            "type": "string",
            "description": "エラーメッセージ",
            "example": "The operation could not be completed"
          },
          "error_code": {
            "type": "string",
            "enum": [
              "InvalidParameters"
            ],
            "description": "エラーコード:\n  * InvalidParameters - 無効なリクエストパラメータまたはボディです\n"
          }
        }
      },
      "ErrorInvalidApiKey": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "example": 401,
            "description": "レスポンスステータス"
          },
          "error_code": {
            "type": "string",
            "enum": [
              "InvalidApiKey",
              "InactiveApiKey",
              "ExpiredApiKey"
            ],
            "description": "エラーコード:\n  * InvalidApiKey - API キーが指定されていないか、無効です\n  * InactiveApiKey - API キーが無効化されています\n  * ExpiredApiKey - API キーの有効期限が切れています\n"
          }
        }
      },
      "ErrorRunError": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "description": "レスポンスステータス",
            "example": 400
          },
          "error": {
            "type": "string",
            "description": "エラーメッセージ",
            "example": "The operation could not be completed"
          },
          "error_code": {
            "type": "string",
            "enum": [
              "CreditInsufficiency",
              "InvalidStyleGroup",
              "InvalidStyle",
              "BadRequest",
              "InvalidParameters"
            ],
            "description": "エラーコード:\n  * CreditInsufficiency - 実行に必要なユニットが不足しています\n  * BadRequest - 予期しないリクエストパラメータです\n  * InvalidStyleGroup - 無効なスタイルグループ ID です\n  * InvalidStyle - 無効なスタイル ID です\n  * InvalidParameters - 無効なリクエストパラメータです\n"
          }
        }
      },
      "ErrorInvalidTaskId": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "description": "レスポンスステータス",
            "example": 400
          },
          "error_code": {
            "type": "string",
            "enum": [
              "InvalidTaskId"
            ],
            "description": "エラーコード:\n  * InvalidTaskId - 無効なタスク ID です\n"
          }
        }
      },
      "ErrorTaskTimeout": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "description": "レスポンスステータス",
            "example": 500
          },
          "error_code": {
            "type": "string",
            "enum": [
              "TaskTimeout"
            ],
            "description": "エラーコード:\n  * TaskTimeout - 期待される時間内にタスクの応答がありません\n"
          }
        }
      }
    },
    "securitySchemes": {
      "BearerAuthenticationV2": {
        "type": "http",
        "scheme": "bearer",
        "description": "標準の 'Bearer authentication' を使用します。ヘッダーに 'API Key' を設定します: `Authorization:Bearer YOUR_API_KEY`。'Bearer' と 'YOUR_API_KEY' の間にスペースがあることに注意してください。"
      }
    }
  }
}