{"openapi":"3.0.0","paths":{"/oauth/figma/callback":{"get":{"operationId":"FigmaController_callback","parameters":[{"name":"code","required":true,"in":"query","schema":{"type":"string"}},{"name":"state","required":true,"in":"query","schema":{"type":"string"}},{"name":"error","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Figma"]}},"/v4/builds":{"post":{"operationId":"BuildV4Controller_createBuildV4_v4","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBuildV4RequestDto"}}}},"responses":{"201":{"description":"Creates either a draft or turbo build.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBuildResponseDto"}}}},"400":{"description":"Failed to create build"},"401":{"description":"Could not find API key"},"409":{"description":"Build already exists"}},"tags":["BuildV4"]}},"/v4/builds/{buildId}/snapshots":{"post":{"operationId":"BuildV4Controller_appendSnapshotsV4_v4","parameters":[{"name":"buildId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppendSnapshotsV4RequestDto"}}}},"responses":{"201":{"description":"A batch of snapshots has been appended to the build.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppendSnapshotsResponseDto"}}}},"400":{"description":"Missing required properties"},"401":{"description":"Could not find API key"},"404":{"description":"Build not found"},"409":{"description":"Build is not accepting snapshots"}},"tags":["BuildV4"]}},"/v4/builds/submit":{"post":{"operationId":"BuildV4Controller_submitBuildV4_v4","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitBuildRequestDto"}}}},"responses":{"201":{"description":"The build draft has been successfully submitted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitBuildResponseDto"}}}},"400":{"description":"Missing required properties"},"401":{"description":"Could not find API key"},"409":{"description":"Snapshot count mismatch"}},"tags":["BuildV4"]}},"/v2/builds":{"post":{"operationId":"BuildController_createBuildV3[0]_v2","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBuildRequestDto"}}}},"responses":{"201":{"description":"Creates either a draft or turbo build.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBuildResponseDto"}}}},"400":{"description":"Failed to create build"},"401":{"description":"Could not find API key"},"409":{"description":"Build already exists"}},"tags":["Build"]}},"/v2/builds/draft":{"post":{"operationId":"BuildController_createBuildV3[1]_v2","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBuildRequestDto"}}}},"responses":{"201":{"description":"Creates either a draft or turbo build.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBuildResponseDto"}}}},"400":{"description":"Failed to create build"},"401":{"description":"Could not find API key"},"409":{"description":"Build already exists"}},"tags":["Build"]}},"/v3/builds":{"post":{"operationId":"BuildController_createBuildV3[2]_v3","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBuildRequestDto"}}}},"responses":{"201":{"description":"Creates either a draft or turbo build.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBuildResponseDto"}}}},"400":{"description":"Failed to create build"},"401":{"description":"Could not find API key"},"409":{"description":"Build already exists"}},"tags":["Build"]}},"/v3/builds/draft":{"post":{"operationId":"BuildController_createBuildV3[3]_v3","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBuildRequestDto"}}}},"responses":{"201":{"description":"Creates either a draft or turbo build.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBuildResponseDto"}}}},"400":{"description":"Failed to create build"},"401":{"description":"Could not find API key"},"409":{"description":"Build already exists"}},"tags":["Build"]}},"/v2/builds/submit":{"post":{"operationId":"BuildController_submitBuildV3_v2","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitBuildRequestDto"}}}},"responses":{"201":{"description":"The build draft has been successfully submitted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitBuildResponseDto"}}}},"400":{"description":"Missing required properties"},"401":{"description":"Could not find API key"}},"tags":["Build"]}},"/v3/builds/submit":{"post":{"operationId":"BuildController_submitBuildV3_v3","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitBuildRequestDto"}}}},"responses":{"201":{"description":"The build draft has been successfully submitted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitBuildResponseDto"}}}},"400":{"description":"Missing required properties"},"401":{"description":"Could not find API key"}},"tags":["Build"]}},"/v4/pull-requests":{"post":{"operationId":"PullRequestController_createPullRequest_v4","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePullRequestRequestDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PullRequestResponseDto"}}}},"400":{"description":"Invalid request body"},"401":{"description":"Could not find API key"},"409":{"description":"Could not allocate a unique number"}},"tags":["PullRequest"]}},"/v4/pull-requests/{pullRequestId}":{"patch":{"operationId":"PullRequestController_updatePullRequest_v4","parameters":[{"name":"pullRequestId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePullRequestRequestDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PullRequestResponseDto"}}}},"400":{"description":"Invalid request body"},"401":{"description":"Could not find API key"},"404":{"description":"Pull request not found"}},"tags":["PullRequest"]}},"/v4/pull-requests/{prNumber}/review-skip":{"post":{"operationId":"ReviewSkipController_skipReview_v4","parameters":[{"name":"prNumber","required":true,"in":"path","schema":{"type":"number"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkipReviewRequestDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkipReviewResponseDto"}}}},"401":{"description":"Could not find API key"},"403":{"description":"Skipping is disabled for the project"},"404":{"description":"Pull request not found"},"409":{"description":"Stale commit SHA, pull request not open, visual changes awaiting review, or no git provider connected"}},"tags":["ReviewSkip"]}},"/webhook/azure":{"post":{"operationId":"WebhookAzureController_azureWebhook","parameters":[],"responses":{"201":{"description":""}},"tags":["WebhookAzure"]}},"/webhook/bitbucket":{"post":{"operationId":"WebhookBitbucketController_bitbucketWebhook","parameters":[],"responses":{"201":{"description":""}},"tags":["WebhookBitbucket"]}},"/webhook/github-app":{"post":{"operationId":"WebhookGithubAppController_githubAppWebhook","parameters":[],"responses":{"201":{"description":""}},"tags":["WebhookGithubApp"]}},"/webhook/gitlab":{"post":{"operationId":"WebhookGitlabController_gitlabWebhook","parameters":[],"responses":{"201":{"description":""}},"tags":["WebhookGitlab"]}},"/health":{"get":{"operationId":"HealthController_check","parameters":[],"responses":{"200":{"description":"The Health Check is successful","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ok"},"info":{"type":"object","example":{"database":{"status":"up"}},"additionalProperties":{"type":"object","required":["status"],"properties":{"status":{"type":"string"}},"additionalProperties":true},"nullable":true},"error":{"type":"object","example":{},"additionalProperties":{"type":"object","required":["status"],"properties":{"status":{"type":"string"}},"additionalProperties":true},"nullable":true},"details":{"type":"object","example":{"database":{"status":"up"}},"additionalProperties":{"type":"object","required":["status"],"properties":{"status":{"type":"string"}},"additionalProperties":true}}}}}}},"503":{"description":"The Health Check is not successful","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"error"},"info":{"type":"object","example":{"database":{"status":"up"}},"additionalProperties":{"type":"object","required":["status"],"properties":{"status":{"type":"string"}},"additionalProperties":true},"nullable":true},"error":{"type":"object","example":{"redis":{"status":"down","message":"Could not connect"}},"additionalProperties":{"type":"object","required":["status"],"properties":{"status":{"type":"string"}},"additionalProperties":true},"nullable":true},"details":{"type":"object","example":{"database":{"status":"up"},"redis":{"status":"down","message":"Could not connect"}},"additionalProperties":{"type":"object","required":["status"],"properties":{"status":{"type":"string"}},"additionalProperties":true}}}}}}}},"tags":["Health"]}},"/webhook/auth":{"post":{"operationId":"WebhookAuthController_authWebhook","parameters":[],"responses":{"201":{"description":""}},"tags":["WebhookAuth"]}},"/webhook/slack":{"get":{"operationId":"WebhookSlackController_slackWebhook","parameters":[{"name":"code","required":true,"in":"query","schema":{"type":"string"}},{"name":"state","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["WebhookSlack"]}},"/webhook/stripe":{"post":{"operationId":"WebhookStipeController_stripeWebhook","parameters":[],"responses":{"200":{"description":""}},"tags":["WebhookStipe"]}},"/webhook/sfn/build-processing-completed":{"post":{"operationId":"WebhookSFNController_buildProcessingCompleted","parameters":[],"responses":{"201":{"description":""}},"tags":["WebhookSFN"]}},"/webhook/sfn/build-processing-failed":{"post":{"operationId":"WebhookSFNController_buildProcessingFailed","parameters":[],"responses":{"201":{"description":""}},"tags":["WebhookSFN"]}}},"info":{"title":"Widgetbook Cloud REST API","description":"","version":"1.0","contact":{}},"tags":[],"servers":[],"components":{"schemas":{"Component":{"type":"object","properties":{"name":{"type":"string"},"path":{"type":"string"}},"required":["name","path"]},"Story":{"type":"object","properties":{"name":{"type":"string"},"designLink":{"type":"object"}},"required":["name"]},"Scenario":{"type":"object","properties":{"name":{"type":"string"},"path":{"type":"string"},"modes":{"type":"object"},"args":{"type":"object"}},"required":["name","path","modes","args"]},"Image":{"type":"object","properties":{"path":{"type":"string"},"hash":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"},"pixelRatio":{"type":"number"},"size":{"type":"number"}},"required":["path","hash","width","height","pixelRatio","size"]},"ScenarioRecord":{"type":"object","properties":{"component":{"$ref":"#/components/schemas/Component"},"story":{"$ref":"#/components/schemas/Story"},"scenario":{"$ref":"#/components/schemas/Scenario"},"image":{"$ref":"#/components/schemas/Image"},"semantics":{"type":"object"},"violations":{"type":"array","items":{"type":"string"}}},"required":["component","story","scenario","image","semantics"]},"StoryRecord":{"type":"object","properties":{"component":{"$ref":"#/components/schemas/Component"},"story":{"$ref":"#/components/schemas/Story"},"navPath":{"type":"string"},"knobsConfigs":{"type":"object"}},"required":["component","story","navPath"]},"CreateBuildV4RequestDto":{"type":"object","properties":{"apiKey":{"type":"string"},"versionControlProvider":{"type":"string"},"repository":{"type":"string"},"actor":{"type":"string"},"branch":{"type":"string"},"sha":{"type":"string"},"mergedResultSha":{"type":"object"},"scenarios":{"type":"array","items":{"$ref":"#/components/schemas/ScenarioRecord"}},"stories":{"type":"array","items":{"$ref":"#/components/schemas/StoryRecord"}},"expectedSnapshotCount":{"type":"number"},"size":{"type":"number","description":"The total size of the build in bytes"},"hash":{"type":"object"}},"required":["apiKey","versionControlProvider","repository","actor","branch","sha","mergedResultSha","size"]},"CreateBuildResponseDto":{"type":"object","properties":{"type":{"type":"string","enum":["draft","turbo"]},"buildId":{"type":"string"}},"required":["type","buildId"]},"SnapshotRecord":{"type":"object","properties":{"scenario":{"$ref":"#/components/schemas/Scenario"},"image":{"$ref":"#/components/schemas/Image"},"navPath":{"type":"string"},"semantics":{"type":"object"},"violations":{"type":"array","items":{"type":"string"}}},"required":["scenario","image","navPath","semantics"]},"AppendSnapshotsV4RequestDto":{"type":"object","properties":{"apiKey":{"type":"string"},"snapshots":{"type":"array","items":{"$ref":"#/components/schemas/SnapshotRecord"}}},"required":["apiKey","snapshots"]},"AppendSnapshotsResponseDto":{"type":"object","properties":{"inserted":{"type":"number","description":"Number of snapshot rows persisted by this batch."}},"required":["inserted"]},"SubmitBuildRequestDto":{"type":"object","properties":{"apiKey":{"type":"string"},"buildId":{"type":"string"}},"required":["apiKey","buildId"]},"SubmitBuildResponseDto":{"type":"object","properties":{"buildId":{"type":"string"},"buildUrl":{"type":"string"}},"required":["buildId","buildUrl"]},"CliStory":{"type":"object","properties":{"knobsConfigs":{"type":"object"}},"required":["knobsConfigs"]},"CreateBuildRequestDto":{"type":"object","properties":{"apiKey":{"type":"string"},"versionControlProvider":{"type":"string"},"repository":{"type":"string"},"actor":{"type":"string"},"branch":{"type":"string"},"sha":{"type":"string"},"mergedResultSha":{"type":"object"},"useCases":{"type":"array","items":{"$ref":"#/components/schemas/CliStory"}},"size":{"type":"number","description":"The total size of the build in bytes"},"hash":{"type":"object"},"addonsConfigs":{"type":"object"}},"required":["apiKey","versionControlProvider","repository","actor","branch","sha","mergedResultSha","useCases","size","addonsConfigs"]},"CreatePullRequestRequestDto":{"type":"object","properties":{"apiKey":{"type":"string"},"title":{"type":"string"},"headRef":{"type":"string","description":"Head (source) branch ref."},"headSha":{"type":"string","description":"Head branch commit SHA."},"baseRef":{"type":"string","description":"Base (target) branch ref."},"baseSha":{"type":"string","description":"Base branch commit SHA."},"externalUrl":{"type":"string"}},"required":["apiKey","title","headRef","headSha","baseRef","baseSha"]},"PullRequestResponseDto":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"number","description":"Negative for synthetic PRs."},"title":{"type":"string"},"status":{"type":"string","enum":["merged","closed","open"]},"synthetic":{"type":"boolean"},"headBranch":{"type":"object"},"baseBranch":{"type":"object"},"externalUrl":{"type":"object","nullable":true}},"required":["id","number","title","status","synthetic","headBranch","baseBranch"]},"UpdatePullRequestRequestDto":{"type":"object","properties":{"apiKey":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["merged","closed","open"]},"headRef":{"type":"string"},"headSha":{"type":"string","description":"New head commit SHA to append."},"baseRef":{"type":"string"},"baseSha":{"type":"string","description":"New base commit SHA."}},"required":["apiKey"]},"SkipReviewRequestDto":{"type":"object","properties":{"apiKey":{"type":"string"},"sha":{"type":"string","description":"Head commit SHA of the pull request. Must match the head Widgetbook received from the git provider, otherwise the request is rejected."},"reason":{"type":"string","description":"Shown in the commit status, e.g. \"No UI changes\"."}},"required":["apiKey","sha"]},"SkipReviewResponseDto":{"type":"object","properties":{"sha":{"type":"string"},"state":{"type":"string"},"prNumber":{"type":"number"}},"required":["sha","state","prNumber"]}}}}