{
  "components": {
    "parameters": {
      "orgID": {
        "description": "Organization ID. Find it under the gear icon in the console URL bar, or via the `Caller-Identity` claim of the bot's introspection endpoint",
        "in": "path",
        "name": "orgID",
        "required": true,
        "schema": {
          "type": "string"
        }
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "description": "Bearer authentication. Two token formats are accepted:\n\n1. **Bot API key** (most common for automation): `Authorization: Bearer shisho_apikey_\u003ckey\u003e:\u003cbot_id\u003e`. Issue and rotate bot API keys from the console under `Organization → Bots`.\n2. **OIDC JWT issued by the Shisho STS** with `sub_type=bot` (Workload Identity flows, e.g. GitHub OIDC federation).\n\nSome endpoints additionally require the caller to be a bot principal; those reject human-user JWTs with `403 Forbidden`. See the per-endpoint description for any additional principal restrictions.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "title": "Takumi API",
    "version": "v1"
  },
  "openapi": "3.1.0",
  "paths": {
    "/o/{orgID}/guard/org-user-tokens": {
      "get": {
        "description": "Returns a page of tokens belonging to the organization in the URL path. Both active and revoked tokens are included by default; narrow the result with the `status` query parameter. The plaintext token is never returned — only the short `token_prefix` safe for UI display.\n\n## Pagination\n\nWalk the result set with `limit` + `offset`. The response `total_count` reports the size of the filtered set (not just the returned page), so callers can compute pagination state directly. `limit` is server-clamped to `[1, 200]`; values above 200 yield `400`.\n\n## Sort order\n\nTokens are returned in `created_at DESC` order by default. When `user_identifier_prefix` is set the primary sort becomes `user_identifier ASC`. When `status=revoked` the primary sort becomes `revoked_at DESC`. The sort is always total-ordered via an opaque per-token tiebreaker, so offset-based pagination is stable across page boundaries provided no tokens are issued or revoked between requests.\n\n## Common errors\n\n| Status | Meaning |\n|---|---|\n| `400 Bad Request` | The request body or query parameters failed validation |\n| `401 Unauthorized` | The `Authorization` header is missing or its bearer token is rejected |\n| `403 Forbidden` | The caller authenticated successfully but is not a bot principal (`bot_principal_required`) or lacks `issue_takumi_guard_token` permission on the organization |\n| `500 Internal Server Error` | An internal failure prevented the request from completing; safe to retry with backoff |\n\nAll error responses share the same JSON envelope (`code`, `details`, `request_id`); include the `request_id` when reporting issues to support.",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgID"
          },
          {
            "in": "query",
            "name": "user_identifier_prefix",
            "schema": {
              "type": "string",
              "description": "Narrows the result to tokens whose user_identifier starts with this string. Omit to disable the filter"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "revoked"
              ],
              "description": "Narrows the result by revocation state. Allowed values: \"active\"; \"revoked\"; or omitted (both active and revoked). Any other value yields HTTP 400"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 0,
              "description": "Caps the number of tokens returned in this page. 0 (or omission) accepts the server-side default of 50. Values above 200 yield HTTP 400"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Zero-based pagination offset over the filtered set. Pair with limit and the response total_count to walk the entire result set"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "tokens": {
                      "items": {
                        "properties": {
                          "token_id": {
                            "type": "string",
                            "description": "The token's management ID (e.g. \"OT_...\"); use this when calling DELETE to revoke"
                          },
                          "token_prefix": {
                            "type": "string",
                            "description": "A short prefix of the original plaintext token; safe to surface in UI"
                          },
                          "user_identifier": {
                            "type": "string",
                            "description": "The user_identifier the token was issued for"
                          },
                          "bot_id": {
                            "type": "string",
                            "description": "The bot that issued the token; empty for user-issued tokens"
                          },
                          "created_at": {
                            "type": "string",
                            "description": "When the token was created (RFC 3339 UTC)"
                          },
                          "last_used_at": {
                            "type": "string",
                            "description": "When the token was last used (RFC 3339 UTC); omitted if never used"
                          },
                          "revoked_at": {
                            "type": "string",
                            "description": "When the token was revoked (RFC 3339 UTC); omitted for active tokens"
                          }
                        },
                        "type": "object",
                        "required": [
                          "token_id",
                          "token_prefix",
                          "user_identifier",
                          "bot_id",
                          "created_at"
                        ]
                      },
                      "type": "array",
                      "description": "Page of tokens belonging to the organization in the URL path. Includes both active and revoked tokens; filter on the absence of revoked_at to find active ones. Tokens are returned in created_at DESC order by default. When user_identifier_prefix is set the primary sort becomes user_identifier ASC. When status=revoked the primary sort becomes revoked_at DESC. The sort is always total-ordered via an opaque per-token tiebreaker; so offset-based pagination is stable across page boundaries as long as no tokens are issued or revoked between requests"
                    },
                    "total_count": {
                      "type": "integer",
                      "description": "Total number of tokens matching the request's filter across the entire result set (not just the returned page)"
                    }
                  },
                  "type": "object",
                  "required": [
                    "tokens",
                    "total_count"
                  ]
                }
              }
            },
            "description": "Successful response"
          }
        },
        "summary": "List organization user tokens"
      },
      "post": {
        "description": "Issues a new Takumi Guard organization user token (`tg_org_*`) bound to the supplied `user_identifier`. The token is meant to be embedded in `.npmrc` / `pip.conf` / equivalent registry-client configuration on a single end-user's machine.\n\nThe full plaintext `token` is returned exactly once in the response and **never disclosed again**; persist it on the caller side immediately, then hand it to the user. The server retains only a SHA-256 hash plus the short `token_prefix` (safe to display in UI listings).\n\nEach organization holds at most a small number of **active** tokens per `user_identifier`; when the cap is reached, mint fails with `429 Too Many Requests` until earlier tokens are revoked. The cap is enforced server-side; callers should treat `429` as a signal to call `DELETE /by-id/{token_id}` on stale tokens before retrying.\n\n## Additional errors\n\n| Status | Meaning |\n|---|---|\n| `402 Payment Required` | Takumi Guard is not enabled for the organization; enable it in the console and retry |\n| `429 Too Many Requests` | Per-(`user_identifier`; organization) active-token cap reached; revoke existing tokens for this `user_identifier` and retry |\n\n## Common errors\n\n| Status | Meaning |\n|---|---|\n| `400 Bad Request` | The request body or query parameters failed validation |\n| `401 Unauthorized` | The `Authorization` header is missing or its bearer token is rejected |\n| `403 Forbidden` | The caller authenticated successfully but is not a bot principal (`bot_principal_required`) or lacks `issue_takumi_guard_token` permission on the organization |\n| `500 Internal Server Error` | An internal failure prevented the request from completing; safe to retry with backoff |\n\nAll error responses share the same JSON envelope (`code`, `details`, `request_id`); include the `request_id` when reporting issues to support.",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "user_identifier": {
                    "type": "string",
                    "maxLength": 255,
                    "minLength": 4,
                    "description": "The human-readable identifier of the user the token is being issued for (typically an email or a directory ID). Allowed characters: letters; digits; hyphen; underscore; dot; at sign; plus sign"
                  }
                },
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "user_identifier"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "token_id": {
                      "type": "string",
                      "description": "The server-assigned management ID for the new token (e.g. \"OT_...\"). Use this when calling DELETE to revoke"
                    },
                    "token": {
                      "type": "string",
                      "description": "The full plaintext token to surface to the user exactly once. Never persisted server-side beyond a SHA-256 hash"
                    },
                    "token_prefix": {
                      "type": "string",
                      "description": "A short prefix safe to display in UI listings"
                    },
                    "user_identifier": {
                      "type": "string",
                      "description": "Echoes the user_identifier from the request"
                    },
                    "created_at": {
                      "type": "string",
                      "description": "When the token was created (RFC 3339 UTC)"
                    }
                  },
                  "type": "object",
                  "required": [
                    "token_id",
                    "token",
                    "token_prefix",
                    "user_identifier",
                    "created_at"
                  ]
                }
              }
            },
            "description": "Successful response"
          }
        },
        "summary": "Issue a new organization user token"
      }
    },
    "/o/{orgID}/guard/org-user-tokens/by-id/{token_id}": {
      "delete": {
        "description": "Revokes the token identified by `token_id`. Obtain `token_id` from the response of `POST /` (mint) or `GET /` (list). The token stops authenticating future Takumi Guard registry calls within seconds; requests already past the auth step may still complete.\n\nThe call is **idempotent**: revoking an already-revoked token still returns `200`. Tokens belonging to a different organization are reported as `404 Not Found` so the existence of cross-organization tokens cannot be probed.\n\n## Additional errors\n\n| Status | Meaning |\n|---|---|\n| `404 Not Found` | No token with this `token_id` exists in this organization (the token never existed, or belongs to a different organization) |\n\n## Common errors\n\n| Status | Meaning |\n|---|---|\n| `400 Bad Request` | The request body or query parameters failed validation |\n| `401 Unauthorized` | The `Authorization` header is missing or its bearer token is rejected |\n| `403 Forbidden` | The caller authenticated successfully but is not a bot principal (`bot_principal_required`) or lacks `issue_takumi_guard_token` permission on the organization |\n| `500 Internal Server Error` | An internal failure prevented the request from completing; safe to retry with backoff |\n\nAll error responses share the same JSON envelope (`code`, `details`, `request_id`); include the `request_id` when reporting issues to support.",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgID"
          },
          {
            "description": "The token's management ID. Obtain it from the mint response or from a list entry's token_id field",
            "in": "path",
            "name": "token_id",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^OT_[0-9A-HJKMNP-TV-Z]{26}$"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on a 200 response"
                    },
                    "token_id": {
                      "type": "string",
                      "description": "Echoes the revoked token's management ID"
                    }
                  },
                  "type": "object",
                  "required": [
                    "success"
                  ]
                }
              }
            },
            "description": "Successful response"
          }
        },
        "summary": "Revoke an organization user token by management ID"
      }
    },
    "/o/{orgID}/guard/org-user-tokens/probe": {
      "post": {
        "description": "Checks whether the plaintext `token` supplied in the body is currently **active** and **owned by the organization in the URL path**. The plaintext is hashed server-side before any lookup; it is never persisted or logged.\n\nReturns `200` with token metadata (`created_at`, `last_used_at`, `prefix`) only when both conditions hold. Use this to validate a token before relying on it in a downstream operation.\n\n## Cross-organization isolation\n\nEvery negative outcome — token does not exist, token is revoked, token belongs to a different organization — collapses to the **same** `404 Not Found` response (`{\"code\": \"invalid_request\", \"details\": {\"message\": \"token not active\"}}`). The collapse is deliberate: a caller that has obtained the token through a leak must not be able to distinguish \"never existed\" from \"revoked\" from \"belongs to another organization\".\n\n## Additional errors\n\n| Status | Meaning |\n|---|---|\n| `404 Not Found` | Negative probe outcome (see Cross-organization isolation above) |\n\n## Common errors\n\n| Status | Meaning |\n|---|---|\n| `400 Bad Request` | The request body or query parameters failed validation |\n| `401 Unauthorized` | The `Authorization` header is missing or its bearer token is rejected |\n| `403 Forbidden` | The caller authenticated successfully but is not a bot principal (`bot_principal_required`) or lacks `issue_takumi_guard_token` permission on the organization |\n| `500 Internal Server Error` | An internal failure prevented the request from completing; safe to retry with backoff |\n\nAll error responses share the same JSON envelope (`code`, `details`, `request_id`); include the `request_id` when reporting issues to support.",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "token": {
                    "type": "string",
                    "minLength": 1,
                    "description": "The plaintext token to probe. Only its SHA-256 hash is transmitted to the backing service"
                  }
                },
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "token"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "created_at": {
                      "type": "string",
                      "description": "When the token was created (RFC 3339 UTC)"
                    },
                    "last_used_at": {
                      "type": "string",
                      "description": "When the token was last used (RFC 3339 UTC); omitted if never used"
                    },
                    "prefix": {
                      "type": "string",
                      "description": "A short prefix of the original plaintext token; matches the token_prefix returned by the list endpoint"
                    }
                  },
                  "type": "object",
                  "required": [
                    "created_at",
                    "prefix"
                  ]
                }
              }
            },
            "description": "Successful response"
          }
        },
        "summary": "Check whether a plaintext token is active and owned by the organization in the URL path"
      }
    },
    "/o/{orgID}/input-files/cancel-upload": {
      "post": {
        "parameters": [
          {
            "$ref": "#/components/parameters/orgID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "file_id": {
                    "type": "string",
                    "maxLength": 256,
                    "minLength": 1,
                    "description": "The ID of the file upload to cancel"
                  }
                },
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "file_id"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "file_id": {
                      "type": "string",
                      "description": "The ID of the canceled file"
                    }
                  },
                  "type": "object",
                  "required": [
                    "file_id"
                  ]
                }
              }
            },
            "description": "Successful response"
          }
        },
        "summary": "Cancel a pending file upload"
      }
    },
    "/o/{orgID}/input-files/confirm-upload": {
      "post": {
        "parameters": [
          {
            "$ref": "#/components/parameters/orgID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "file_id": {
                    "type": "string",
                    "maxLength": 256,
                    "minLength": 1,
                    "description": "The ID of the file to confirm. Must call this after uploading the file to the upload URL"
                  }
                },
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "file_id"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "file_id": {
                      "type": "string",
                      "description": "The ID of the confirmed file"
                    }
                  },
                  "type": "object",
                  "required": [
                    "file_id"
                  ]
                }
              }
            },
            "description": "Successful response"
          }
        },
        "summary": "Confirm a file upload"
      }
    },
    "/o/{orgID}/input-files/delete": {
      "post": {
        "parameters": [
          {
            "$ref": "#/components/parameters/orgID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "file_id": {
                    "type": "string",
                    "maxLength": 256,
                    "minLength": 1,
                    "description": "The ID of the file to delete"
                  }
                },
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "file_id"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "file_id": {
                      "type": "string",
                      "description": "The ID of the deleted file"
                    }
                  },
                  "type": "object",
                  "required": [
                    "file_id"
                  ]
                }
              }
            },
            "description": "Successful response"
          }
        },
        "summary": "Delete a file"
      }
    },
    "/o/{orgID}/input-files/get-upload-url": {
      "post": {
        "description": "Returns a URL for uploading a file via HTTP PUT.\n\n```\ncurl -X PUT \"\u003cupload_url\u003e\" --upload-file path/to/file\n```\n\nAfter the upload completes, call `/input-files/confirm-upload` to finalize the file. The file can only be referenced in workflow inputs after confirmation.\n\nUploaded files are automatically deleted after a retention period. Storage capacity is limited per organization. Delete files that are no longer needed using the `/input-files/delete` endpoint.\n\nTo abort an upload, call `/input-files/cancel-upload` so that the reserved storage capacity is released.",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "content_length": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Size of the file to upload in bytes"
                  }
                },
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "content_length"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "file_id": {
                      "type": "string",
                      "description": "The ID assigned to this file. Use this ID in subsequent confirm/cancel calls and in workflow dispatch inputs"
                    },
                    "upload_url": {
                      "type": "string",
                      "description": "URL to upload the file via HTTP PUT"
                    },
                    "expires_in_seconds": {
                      "type": "integer",
                      "description": "Number of seconds until the upload URL expires"
                    }
                  },
                  "type": "object",
                  "required": [
                    "file_id",
                    "upload_url",
                    "expires_in_seconds"
                  ]
                }
              }
            },
            "description": "Successful response"
          }
        },
        "summary": "Get an upload URL"
      }
    },
    "/o/{orgID}/workflows/blackbox-assessment/cancel": {
      "post": {
        "parameters": [
          {
            "$ref": "#/components/parameters/orgID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "workflow_run_id": {
                    "type": "string",
                    "maxLength": 256,
                    "minLength": 1,
                    "description": "The ID of the workflow run to cancel"
                  }
                },
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "workflow_run_id"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {},
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          }
        },
        "summary": "Cancel a blackbox-assessment workflow run"
      }
    },
    "/o/{orgID}/workflows/blackbox-assessment/describe": {
      "post": {
        "description": "To download the artifacts listed in the response, use the `/blackbox-assessment/get-artifact-download-url` endpoint.",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "workflow_run_id": {
                    "type": "string",
                    "maxLength": 256,
                    "minLength": 1,
                    "description": "The ID of the workflow run to describe"
                  }
                },
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "workflow_run_id"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "RUNNING",
                        "EXITED"
                      ],
                      "title": "Status",
                      "description": "Current status of the workflow run"
                    },
                    "output": {
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "SUCCESS",
                            "ABORTED"
                          ],
                          "description": "Whether the workflow run succeeded or was aborted"
                        },
                        "successOutput": {
                          "properties": {
                            "report": {
                              "properties": {
                                "artifact_name": {
                                  "type": "string",
                                  "description": "The name of the artifact"
                                }
                              },
                              "type": "object",
                              "required": [
                                "artifact_name"
                              ],
                              "description": "The assessment report in Markdown format"
                            },
                            "findings": {
                              "properties": {
                                "artifact_name": {
                                  "type": "string",
                                  "description": "The name of the artifact"
                                }
                              },
                              "type": "object",
                              "required": [
                                "artifact_name"
                              ],
                              "description": "A JSON file containing the list of vulnerability findings. The schema is available at `/v1/docs/workflow-artifacts/blackbox-assessment/findings.json`"
                            },
                            "features": {
                              "properties": {
                                "artifact_name": {
                                  "type": "string",
                                  "description": "The name of the artifact"
                                }
                              },
                              "type": "object",
                              "required": [
                                "artifact_name"
                              ],
                              "description": "A JSON file containing the list of application features examined during the assessment. The schema is available at `/v1/docs/workflow-artifacts/blackbox-assessment/features.json`. Always present for runs created after this field was introduced; absent for older runs. Added in https://shisho.dev/docs/r/202603-takumi-api-scoped-blackbox-assessment"
                            },
                            "scan_progress": {
                              "properties": {
                                "artifact_name": {
                                  "type": "string",
                                  "description": "The name of the artifact"
                                }
                              },
                              "type": "object",
                              "required": [
                                "artifact_name"
                              ],
                              "description": "A JSON file containing the completed and skipped feature–perspective pairs. Completed pairs were actually tested; skipped pairs were not applicable (e.g. authentication perspective on a non-authentication feature). Pairs absent from both lists were not tested due to credit limit or other runtime constraints. The schema is available at `/v1/docs/workflow-artifacts/blackbox-assessment/scan_progress.json`. Always present for runs created after this field was introduced; absent for older runs. Added in https://shisho.dev/docs/r/202603-takumi-api-scoped-blackbox-assessment"
                            }
                          },
                          "type": "object",
                          "required": [
                            "report",
                            "findings"
                          ],
                          "description": "The success output. Present only when kind is SUCCESS"
                        },
                        "abortedReason": {
                          "properties": {
                            "code": {
                              "type": "string",
                              "description": "The abort reason code"
                            },
                            "detail": {
                              "description": "Type-specific detail for the abort reason"
                            }
                          },
                          "type": "object",
                          "required": [
                            "code"
                          ],
                          "description": "The reason the workflow run was aborted. Present only when kind is ABORTED"
                        }
                      },
                      "type": "object",
                      "required": [
                        "kind"
                      ],
                      "description": "Output of the workflow run. Present only when status is EXITED"
                    },
                    "artifacts": {
                      "items": {
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "Name of the artifact"
                          }
                        },
                        "type": "object",
                        "required": [
                          "name"
                        ]
                      },
                      "type": "array",
                      "description": "Downloadable artifacts produced by the workflow run. Present only when status is EXITED"
                    }
                  },
                  "type": "object",
                  "required": [
                    "status"
                  ]
                }
              }
            },
            "description": "Successful response"
          }
        },
        "summary": "Describe a blackbox-assessment workflow run"
      }
    },
    "/o/{orgID}/workflows/blackbox-assessment/dispatch": {
      "post": {
        "description": "Dispatches a blackbox assessment and returns immediately. Poll the `/blackbox-assessment/describe` endpoint to check status. Depending on the complexity of the target application, execution may take anywhere from several hours to several days.\n\nNote that workflow runs dispatched via this API do not appear in the web console's \"Assessment\" tab; the API and the web console manage assessment data independently. See [Relationship with Web Console Assessments](https://shisho.dev/docs/t/api/#relationship-with-existing-features) for details.",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "input": {
                    "properties": {
                      "language": {
                        "type": "string",
                        "enum": [
                          "english",
                          "japanese"
                        ]
                      },
                      "target_urls": {
                        "items": {
                          "type": "string",
                          "maxLength": 5000,
                          "format": "uri",
                          "description": "A fully qualified URL (e.g. https://app.example)"
                        },
                        "type": "array",
                        "maxItems": 100,
                        "minItems": 1,
                        "description": "Web application URLs to test. Each URL must belong to an application whose ownership has been verified; otherwise the workflow run will be rejected. When 'resume' is specified; this must contain the same URLs as the referenced run. See https://shisho.dev/docs/t/concepts/assessment-authentication/ for setup instructions"
                      },
                      "oos_urls": {
                        "items": {
                          "type": "string",
                          "maxLength": 5000,
                          "format": "uri",
                          "description": "A fully qualified URL (e.g. https://app.example)"
                        },
                        "type": "array",
                        "maxItems": 100,
                        "description": "Out-of-scope URLs to exclude from testing"
                      },
                      "authentication": {
                        "properties": {
                          "credentials": {
                            "items": {
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "maxLength": 256,
                                  "minLength": 1,
                                  "description": "Login ID such as a username or email address"
                                },
                                "password": {
                                  "type": "string",
                                  "maxLength": 5000,
                                  "description": "Login password"
                                },
                                "role": {
                                  "type": "string",
                                  "maxLength": 256,
                                  "minLength": 1,
                                  "description": "Role label for this credential (e.g. \"admin\" or \"regular user\")"
                                },
                                "additional_instructions": {
                                  "type": "string",
                                  "maxLength": 5000,
                                  "minLength": 1,
                                  "description": "Additional instructions for authenticating with this credential (e.g. login page URL; MFA setup steps). Cannot be combined with the deprecated configuration-wide additional_instructions"
                                }
                              },
                              "additionalProperties": false,
                              "type": "object",
                              "required": [
                                "id",
                                "password",
                                "role"
                              ]
                            },
                            "type": "array",
                            "maxItems": 100,
                            "minItems": 1,
                            "description": "Login credentials for authenticated testing"
                          },
                          "additional_instructions": {
                            "type": "string",
                            "maxLength": 5000,
                            "minLength": 1,
                            "description": "Deprecated: set additional_instructions on each credential instead; the two cannot be combined. Additional instructions for the authentication process (e.g. login page URL; MFA setup steps)",
                            "deprecated": true
                          }
                        },
                        "additionalProperties": false,
                        "type": "object",
                        "description": "Credentials and instructions for logging into the target web application"
                      },
                      "preference": {
                        "properties": {
                          "preferences": {
                            "items": {
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "DO",
                                    "DONT"
                                  ],
                                  "description": "DO for a positive instruction; DONT for a negative instruction"
                                },
                                "preference": {
                                  "type": "string",
                                  "maxLength": 5000,
                                  "minLength": 1,
                                  "description": "The instruction text (e.g. \"Please check the authentication feature\" for DO; \"No need to check the logging feature\" for DONT)"
                                }
                              },
                              "additionalProperties": false,
                              "type": "object",
                              "required": [
                                "kind",
                                "preference"
                              ]
                            },
                            "type": "array",
                            "maxItems": 100,
                            "minItems": 1,
                            "description": "Custom instructions to guide the assessment behavior. Note: Takumi does not always follow these instructions"
                          }
                        },
                        "additionalProperties": false,
                        "type": "object",
                        "description": "Deprecated: write the same thing as free text in customer_notes instead. Custom instructions to guide the assessment. Note: Takumi does not always follow these instructions",
                        "deprecated": true
                      },
                      "customer_notes": {
                        "type": "string",
                        "maxLength": 10000,
                        "description": "Supplementary information about the target that the assessment is judged against: a threat model; the permission and role design; behaviour you declare as specified; risks you declare as accepted. Free text including newlines"
                      },
                      "scan_credit_limit": {
                        "type": "integer",
                        "maximum": 100000,
                        "minimum": 10,
                        "description": "Maximum number of credits to consume while scanning. The assessment stops early and exits as ABORTED with code 'credit_limit_reached' when the limit is reached. The aborted reason detail includes a scan_progress artifact that records which pairs were completed or skipped; pairs absent from scan_progress were not attempted due to the limit and can be retried via 'resume.continue_assessment'"
                      },
                      "crawl_credit_limit": {
                        "type": "integer",
                        "maximum": 100000,
                        "minimum": 5,
                        "description": "Maximum number of credits to consume while crawling. When the limit is reached; the scan proceeds with the features discovered so far. Independent of 'scan_credit_limit' which governs scanning"
                      },
                      "resume": {
                        "properties": {
                          "kind": {
                            "type": "string",
                            "enum": [
                              "assess_crawled_features",
                              "continue_assessment"
                            ],
                            "description": "Resume mode: 'assess_crawled_features' or 'continue_assessment'. Set the corresponding sub-object accordingly"
                          },
                          "assess_crawled_features": {
                            "properties": {
                              "workflow_id": {
                                "type": "string",
                                "maxLength": 256,
                                "minLength": 1,
                                "description": "The ID of the workflow that produced the referenced run"
                              },
                              "workflow_run_id": {
                                "type": "string",
                                "maxLength": 256,
                                "minLength": 1,
                                "description": "The ID of the workflow run to reference. The referenced run must have completed with SUCCESS or been ABORTED with code 'credit_limit_reached'; other abort reasons are not eligible"
                              }
                            },
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "workflow_id",
                              "workflow_run_id"
                            ],
                            "description": "Required when kind is 'assess_crawled_features'. Reuse only the discovered feature list from a previous run and start a fresh assessment from scratch. The referenced run can be either a blackbox-assessment or a blackbox-crawl run"
                          },
                          "continue_assessment": {
                            "properties": {
                              "workflow_id": {
                                "type": "string",
                                "maxLength": 256,
                                "minLength": 1,
                                "description": "The ID of the workflow that produced the referenced run"
                              },
                              "workflow_run_id": {
                                "type": "string",
                                "maxLength": 256,
                                "minLength": 1,
                                "description": "The ID of the workflow run to reference. The referenced run must have completed with SUCCESS or been ABORTED with code 'credit_limit_reached'; other abort reasons are not eligible"
                              }
                            },
                            "additionalProperties": false,
                            "type": "object",
                            "required": [
                              "workflow_id",
                              "workflow_run_id"
                            ],
                            "description": "Required when kind is 'continue_assessment'. Continue a previous blackbox-assessment run; reusing its feature list and scan results. New findings are appended to the previous report. The referenced run must be a blackbox-assessment run"
                          }
                        },
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "kind"
                        ],
                        "description": "Configuration for resuming from a previous workflow run. Set 'kind' to select the resume mode and populate the corresponding sub-object. The referenced run must have completed with SUCCESS or been ABORTED with code 'credit_limit_reached'"
                      },
                      "pairs": {
                        "items": {
                          "properties": {
                            "feature_name": {
                              "type": "string",
                              "maxLength": 5000,
                              "minLength": 1,
                              "description": "Name of the application feature to assess. Must match the 'name' field of an entry in the features artifact produced by the workflow run referenced in resume"
                            },
                            "perspective": {
                              "type": "string",
                              "enum": [
                                "Injection",
                                "XSS",
                                "CSRF",
                                "Authorization",
                                "FileSystem",
                                "BusinessLogic",
                                "OpenRedirect",
                                "SSRF",
                                "Authentication",
                                "Clickjacking",
                                "CORS"
                              ],
                              "description": "Security testing perspective to apply to the feature"
                            },
                            "priority": {
                              "type": "string",
                              "enum": [
                                "high",
                                "medium",
                                "low"
                              ],
                              "description": "Assessment priority for this pair. Higher-priority pairs are assessed first. When omitted; the system determines priority automatically"
                            }
                          },
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "feature_name",
                            "perspective"
                          ]
                        },
                        "type": "array",
                        "maxItems": 10000,
                        "description": "Specific feature–perspective pairs to assess. When omitted; all discovered features are assessed against all applicable perspectives. When specified; only the listed pairs are assessed. Requires 'resume' to be set. When using 'resume.continue_assessment'; pairs already in scan_progress are carried over automatically and only pairs absent in scan_progress will be freshly assessed"
                      }
                    },
                    "additionalProperties": false,
                    "type": "object",
                    "required": [
                      "language",
                      "target_urls"
                    ],
                    "description": "Workflow-specific input parameters"
                  },
                  "notification": {
                    "properties": {
                      "webhook_endpoint_ids": {
                        "items": {
                          "type": "string"
                        },
                        "type": "array",
                        "maxItems": 100,
                        "minItems": 1,
                        "description": "IDs of the registered webhook endpoints to notify when the workflow run completes"
                      }
                    },
                    "additionalProperties": false,
                    "type": "object",
                    "required": [
                      "webhook_endpoint_ids"
                    ],
                    "description": "Optional notification configuration for the workflow run"
                  }
                },
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "input"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "workflow_run_id": {
                      "type": "string",
                      "description": "The ID of the newly created workflow run"
                    }
                  },
                  "type": "object",
                  "required": [
                    "workflow_run_id"
                  ]
                }
              }
            },
            "description": "Successful response"
          }
        },
        "summary": "Dispatch a blackbox-assessment workflow run"
      }
    },
    "/o/{orgID}/workflows/blackbox-assessment/get-artifact-download-url": {
      "post": {
        "description": "To list the available artifacts for a workflow run, use the `/blackbox-assessment/describe` endpoint.",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "workflow_run_id": {
                    "type": "string",
                    "maxLength": 256,
                    "minLength": 1,
                    "description": "The ID of the workflow run that produced the artifact"
                  },
                  "artifact_name": {
                    "type": "string",
                    "maxLength": 256,
                    "minLength": 1,
                    "description": "The name of the artifact to download"
                  }
                },
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "workflow_run_id",
                  "artifact_name"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "url": {
                      "type": "string",
                      "description": "URL to download the artifact via HTTP GET"
                    },
                    "expires_in_seconds": {
                      "type": "integer",
                      "description": "Number of seconds until the download URL expires"
                    }
                  },
                  "type": "object",
                  "required": [
                    "url",
                    "expires_in_seconds"
                  ]
                }
              }
            },
            "description": "Successful response"
          }
        },
        "summary": "Get artifact download URL for a blackbox-assessment workflow run"
      }
    },
    "/o/{orgID}/workflows/blackbox-crawl/cancel": {
      "post": {
        "parameters": [
          {
            "$ref": "#/components/parameters/orgID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "workflow_run_id": {
                    "type": "string",
                    "maxLength": 256,
                    "minLength": 1,
                    "description": "The ID of the workflow run to cancel"
                  }
                },
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "workflow_run_id"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {},
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          }
        },
        "summary": "Cancel a blackbox-crawl workflow run"
      }
    },
    "/o/{orgID}/workflows/blackbox-crawl/describe": {
      "post": {
        "description": "To download the artifacts listed in the response, use the `/blackbox-crawl/get-artifact-download-url` endpoint.",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "workflow_run_id": {
                    "type": "string",
                    "maxLength": 256,
                    "minLength": 1,
                    "description": "The ID of the workflow run to describe"
                  }
                },
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "workflow_run_id"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "RUNNING",
                        "EXITED"
                      ],
                      "title": "Status",
                      "description": "Current status of the workflow run"
                    },
                    "output": {
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "SUCCESS",
                            "ABORTED"
                          ],
                          "description": "Whether the workflow run succeeded or was aborted"
                        },
                        "successOutput": {
                          "properties": {
                            "features": {
                              "properties": {
                                "artifact_name": {
                                  "type": "string",
                                  "description": "The name of the artifact"
                                }
                              },
                              "type": "object",
                              "required": [
                                "artifact_name"
                              ],
                              "description": "A JSON file containing the list of application features discovered during the crawl. The schema is available at `/v1/docs/workflow-artifacts/blackbox-crawl/features.json`"
                            }
                          },
                          "type": "object",
                          "required": [
                            "features"
                          ],
                          "description": "The success output. Present only when kind is SUCCESS"
                        },
                        "abortedReason": {
                          "properties": {
                            "code": {
                              "type": "string",
                              "description": "The abort reason code"
                            },
                            "detail": {
                              "description": "Type-specific detail for the abort reason"
                            }
                          },
                          "type": "object",
                          "required": [
                            "code"
                          ],
                          "description": "The reason the workflow run was aborted. Present only when kind is ABORTED"
                        }
                      },
                      "type": "object",
                      "required": [
                        "kind"
                      ],
                      "description": "Output of the workflow run. Present only when status is EXITED"
                    },
                    "artifacts": {
                      "items": {
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "Name of the artifact"
                          }
                        },
                        "type": "object",
                        "required": [
                          "name"
                        ]
                      },
                      "type": "array",
                      "description": "Downloadable artifacts produced by the workflow run. Present only when status is EXITED"
                    }
                  },
                  "type": "object",
                  "required": [
                    "status"
                  ]
                }
              }
            },
            "description": "Successful response"
          }
        },
        "summary": "Describe a blackbox-crawl workflow run"
      }
    },
    "/o/{orgID}/workflows/blackbox-crawl/dispatch": {
      "post": {
        "description": "Dispatches a blackbox crawl and returns immediately. A crawl discovers application features without performing security testing. Poll the `/blackbox-crawl/describe` endpoint to check status. After the crawl completes; use the features artifact to select specific feature–perspective pairs for a subsequent blackbox-assessment run.\n\nNote that workflow runs dispatched via this API do not appear in the web console's \"Assessment\" tab; the API and the web console manage assessment data independently. See [Relationship with Web Console Assessments](https://shisho.dev/docs/t/api/#relationship-with-existing-features) for details.",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "input": {
                    "properties": {
                      "language": {
                        "type": "string",
                        "enum": [
                          "english",
                          "japanese"
                        ]
                      },
                      "target_urls": {
                        "items": {
                          "type": "string",
                          "maxLength": 5000,
                          "format": "uri",
                          "description": "A fully qualified URL (e.g. https://app.example)"
                        },
                        "type": "array",
                        "maxItems": 100,
                        "minItems": 1,
                        "description": "Web application URLs to crawl. Each URL must belong to an application whose ownership has been verified; otherwise the workflow run will be rejected. See https://shisho.dev/docs/t/concepts/assessment-authentication/ for setup instructions"
                      },
                      "oos_urls": {
                        "items": {
                          "type": "string",
                          "maxLength": 5000,
                          "format": "uri",
                          "description": "A fully qualified URL (e.g. https://app.example)"
                        },
                        "type": "array",
                        "maxItems": 100,
                        "description": "Out-of-scope URLs to exclude from crawling"
                      },
                      "authentication": {
                        "properties": {
                          "credentials": {
                            "items": {
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "maxLength": 256,
                                  "minLength": 1,
                                  "description": "Login ID such as a username or email address"
                                },
                                "password": {
                                  "type": "string",
                                  "maxLength": 5000,
                                  "description": "Login password"
                                },
                                "role": {
                                  "type": "string",
                                  "maxLength": 256,
                                  "minLength": 1,
                                  "description": "Role label for this credential (e.g. \"admin\" or \"regular user\")"
                                },
                                "additional_instructions": {
                                  "type": "string",
                                  "maxLength": 5000,
                                  "minLength": 1,
                                  "description": "Additional instructions for authenticating with this credential (e.g. login page URL; MFA setup steps). Cannot be combined with the deprecated configuration-wide additional_instructions"
                                }
                              },
                              "additionalProperties": false,
                              "type": "object",
                              "required": [
                                "id",
                                "password",
                                "role"
                              ]
                            },
                            "type": "array",
                            "maxItems": 100,
                            "minItems": 1,
                            "description": "Login credentials for authenticated testing"
                          },
                          "additional_instructions": {
                            "type": "string",
                            "maxLength": 5000,
                            "minLength": 1,
                            "description": "Deprecated: set additional_instructions on each credential instead; the two cannot be combined. Additional instructions for the authentication process (e.g. login page URL; MFA setup steps)",
                            "deprecated": true
                          }
                        },
                        "additionalProperties": false,
                        "type": "object",
                        "description": "Credentials and instructions for logging into the target web application"
                      },
                      "preference": {
                        "properties": {
                          "preferences": {
                            "items": {
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "DO",
                                    "DONT"
                                  ],
                                  "description": "DO for a positive instruction; DONT for a negative instruction"
                                },
                                "preference": {
                                  "type": "string",
                                  "maxLength": 5000,
                                  "minLength": 1,
                                  "description": "The instruction text (e.g. \"Please check the authentication feature\" for DO; \"No need to check the logging feature\" for DONT)"
                                }
                              },
                              "additionalProperties": false,
                              "type": "object",
                              "required": [
                                "kind",
                                "preference"
                              ]
                            },
                            "type": "array",
                            "maxItems": 100,
                            "minItems": 1,
                            "description": "Custom instructions to guide the assessment behavior. Note: Takumi does not always follow these instructions"
                          }
                        },
                        "additionalProperties": false,
                        "type": "object",
                        "description": "Deprecated: write the same thing as free text in customer_notes instead. Custom instructions to guide the crawl. Note: Takumi does not always follow these instructions",
                        "deprecated": true
                      },
                      "customer_notes": {
                        "type": "string",
                        "maxLength": 10000,
                        "description": "Supplementary information about the target that the crawl is judged against: a threat model; the permission and role design; behaviour you declare as specified; risks you declare as accepted. Free text including newlines"
                      },
                      "credit_limit": {
                        "type": "integer",
                        "maximum": 100000,
                        "minimum": 5,
                        "description": "Maximum number of credits to consume during crawling. When the limit is reached; the crawl completes successfully with all features discovered so far; results can be extended by resuming with additional credits"
                      },
                      "additional_instructions": {
                        "type": "string",
                        "maxLength": 5000,
                        "minLength": 1,
                        "description": "Additional instructions for crawling (e.g. 'Focus on crawling the APIs (/api/v1/users/...) used by the page accessible at /page/abc')"
                      },
                      "resume": {
                        "properties": {
                          "workflow_id": {
                            "type": "string",
                            "maxLength": 256,
                            "minLength": 1,
                            "description": "The ID of the workflow that produced the referenced run. Must be 'blackbox-crawl'"
                          },
                          "workflow_run_id": {
                            "type": "string",
                            "maxLength": 256,
                            "minLength": 1,
                            "description": "ID of the blackbox-crawl run to resume from. The run must have exited with status SUCCESS"
                          }
                        },
                        "additionalProperties": false,
                        "type": "object",
                        "required": [
                          "workflow_id",
                          "workflow_run_id"
                        ],
                        "description": "Resume crawling from a previous blackbox-crawl run; previously discovered features are preserved and the agent continues from where it left off. Note: resuming does not guarantee new endpoints will be discovered; credits are consumed even if no new endpoints are found"
                      }
                    },
                    "additionalProperties": false,
                    "type": "object",
                    "required": [
                      "language",
                      "target_urls"
                    ],
                    "description": "Workflow-specific input parameters"
                  },
                  "notification": {
                    "properties": {
                      "webhook_endpoint_ids": {
                        "items": {
                          "type": "string"
                        },
                        "type": "array",
                        "maxItems": 100,
                        "minItems": 1,
                        "description": "IDs of the registered webhook endpoints to notify when the workflow run completes"
                      }
                    },
                    "additionalProperties": false,
                    "type": "object",
                    "required": [
                      "webhook_endpoint_ids"
                    ],
                    "description": "Optional notification configuration for the workflow run"
                  }
                },
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "input"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "workflow_run_id": {
                      "type": "string",
                      "description": "The ID of the newly created workflow run"
                    }
                  },
                  "type": "object",
                  "required": [
                    "workflow_run_id"
                  ]
                }
              }
            },
            "description": "Successful response"
          }
        },
        "summary": "Dispatch a blackbox-crawl workflow run"
      }
    },
    "/o/{orgID}/workflows/blackbox-crawl/get-artifact-download-url": {
      "post": {
        "description": "To list the available artifacts for a workflow run, use the `/blackbox-crawl/describe` endpoint.",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "workflow_run_id": {
                    "type": "string",
                    "maxLength": 256,
                    "minLength": 1,
                    "description": "The ID of the workflow run that produced the artifact"
                  },
                  "artifact_name": {
                    "type": "string",
                    "maxLength": 256,
                    "minLength": 1,
                    "description": "The name of the artifact to download"
                  }
                },
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "workflow_run_id",
                  "artifact_name"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "url": {
                      "type": "string",
                      "description": "URL to download the artifact via HTTP GET"
                    },
                    "expires_in_seconds": {
                      "type": "integer",
                      "description": "Number of seconds until the download URL expires"
                    }
                  },
                  "type": "object",
                  "required": [
                    "url",
                    "expires_in_seconds"
                  ]
                }
              }
            },
            "description": "Successful response"
          }
        },
        "summary": "Get artifact download URL for a blackbox-crawl workflow run"
      }
    },
    "/o/{orgID}/workflows/whitebox-assessment/cancel": {
      "post": {
        "parameters": [
          {
            "$ref": "#/components/parameters/orgID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "workflow_run_id": {
                    "type": "string",
                    "maxLength": 256,
                    "minLength": 1,
                    "description": "The ID of the workflow run to cancel"
                  }
                },
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "workflow_run_id"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {},
                  "type": "object"
                }
              }
            },
            "description": "Successful response"
          }
        },
        "summary": "Cancel a whitebox-assessment workflow run"
      }
    },
    "/o/{orgID}/workflows/whitebox-assessment/describe": {
      "post": {
        "description": "To download the artifacts listed in the response, use the `/whitebox-assessment/get-artifact-download-url` endpoint.",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "workflow_run_id": {
                    "type": "string",
                    "maxLength": 256,
                    "minLength": 1,
                    "description": "The ID of the workflow run to describe"
                  }
                },
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "workflow_run_id"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "RUNNING",
                        "EXITED"
                      ],
                      "title": "Status",
                      "description": "Current status of the workflow run"
                    },
                    "output": {
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "SUCCESS",
                            "ABORTED"
                          ],
                          "description": "Whether the workflow run succeeded or was aborted"
                        },
                        "successOutput": {
                          "properties": {
                            "report": {
                              "properties": {
                                "artifact_name": {
                                  "type": "string",
                                  "description": "The name of the artifact"
                                }
                              },
                              "type": "object",
                              "required": [
                                "artifact_name"
                              ],
                              "description": "The assessment report in Markdown format"
                            },
                            "findings": {
                              "properties": {
                                "artifact_name": {
                                  "type": "string",
                                  "description": "The name of the artifact"
                                }
                              },
                              "type": "object",
                              "required": [
                                "artifact_name"
                              ],
                              "description": "A JSON file containing the list of vulnerability findings. The schema is available at `/v1/docs/workflow-artifacts/whitebox-assessment/findings.json`"
                            }
                          },
                          "type": "object",
                          "required": [
                            "report",
                            "findings"
                          ],
                          "description": "The success output. Present only when kind is SUCCESS"
                        },
                        "abortedReason": {
                          "properties": {
                            "code": {
                              "type": "string",
                              "description": "The abort reason code"
                            },
                            "detail": {
                              "description": "Type-specific detail for the abort reason"
                            }
                          },
                          "type": "object",
                          "required": [
                            "code"
                          ],
                          "description": "The reason the workflow run was aborted. Present only when kind is ABORTED"
                        }
                      },
                      "type": "object",
                      "required": [
                        "kind"
                      ],
                      "description": "Output of the workflow run. Present only when status is EXITED"
                    },
                    "artifacts": {
                      "items": {
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "Name of the artifact"
                          }
                        },
                        "type": "object",
                        "required": [
                          "name"
                        ]
                      },
                      "type": "array",
                      "description": "Downloadable artifacts produced by the workflow run. Present only when status is EXITED"
                    }
                  },
                  "type": "object",
                  "required": [
                    "status"
                  ]
                }
              }
            },
            "description": "Successful response"
          }
        },
        "summary": "Describe a whitebox-assessment workflow run"
      }
    },
    "/o/{orgID}/workflows/whitebox-assessment/dispatch": {
      "post": {
        "description": "Dispatches a whitebox assessment and returns immediately. Poll the `/whitebox-assessment/describe` endpoint to check status. Depending on the complexity of the target application, execution may take anywhere from several hours to several days.\n\nNote that workflow runs dispatched via this API do not appear in the web console's \"Assessment\" tab; the API and the web console manage assessment data independently. See [Relationship with Web Console Assessments](https://shisho.dev/docs/t/api/#relationship-with-existing-features) for details.",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "input": {
                    "properties": {
                      "language": {
                        "type": "string",
                        "enum": [
                          "english",
                          "japanese"
                        ]
                      },
                      "targets": {
                        "items": {
                          "properties": {
                            "file_upload": {
                              "properties": {
                                "file_id": {
                                  "type": "string",
                                  "maxLength": 256,
                                  "minLength": 1,
                                  "description": "File ID returned by the input files upload API"
                                },
                                "archive_type": {
                                  "type": "string",
                                  "enum": [
                                    "zip",
                                    "tar_gz"
                                  ],
                                  "description": "Archive format of the uploaded file"
                                }
                              },
                              "additionalProperties": false,
                              "type": "object",
                              "required": [
                                "file_id",
                                "archive_type"
                              ],
                              "description": "Source code archive uploaded via the input files API"
                            }
                          },
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "file_upload"
                          ]
                        },
                        "type": "array",
                        "maxItems": 100,
                        "minItems": 1,
                        "description": "Source code archives to analyze"
                      },
                      "preference": {
                        "properties": {
                          "preferences": {
                            "items": {
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "DO",
                                    "DONT"
                                  ],
                                  "description": "DO for a positive instruction; DONT for a negative instruction"
                                },
                                "preference": {
                                  "type": "string",
                                  "maxLength": 5000,
                                  "minLength": 1,
                                  "description": "The instruction text (e.g. \"Please check the authentication feature\" for DO; \"No need to check the logging feature\" for DONT)"
                                }
                              },
                              "additionalProperties": false,
                              "type": "object",
                              "required": [
                                "kind",
                                "preference"
                              ]
                            },
                            "type": "array",
                            "maxItems": 100,
                            "minItems": 1,
                            "description": "Custom instructions to guide the assessment behavior. Note: Takumi does not always follow these instructions"
                          }
                        },
                        "additionalProperties": false,
                        "type": "object",
                        "description": "Custom instructions to guide the assessment. Note: Takumi does not always follow these instructions"
                      }
                    },
                    "additionalProperties": false,
                    "type": "object",
                    "required": [
                      "language",
                      "targets"
                    ],
                    "description": "Workflow-specific input parameters"
                  },
                  "notification": {
                    "properties": {
                      "webhook_endpoint_ids": {
                        "items": {
                          "type": "string"
                        },
                        "type": "array",
                        "maxItems": 100,
                        "minItems": 1,
                        "description": "IDs of the registered webhook endpoints to notify when the workflow run completes"
                      }
                    },
                    "additionalProperties": false,
                    "type": "object",
                    "required": [
                      "webhook_endpoint_ids"
                    ],
                    "description": "Optional notification configuration for the workflow run"
                  }
                },
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "input"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "workflow_run_id": {
                      "type": "string",
                      "description": "The ID of the newly created workflow run"
                    }
                  },
                  "type": "object",
                  "required": [
                    "workflow_run_id"
                  ]
                }
              }
            },
            "description": "Successful response"
          }
        },
        "summary": "Dispatch a whitebox-assessment workflow run"
      }
    },
    "/o/{orgID}/workflows/whitebox-assessment/get-artifact-download-url": {
      "post": {
        "description": "To list the available artifacts for a workflow run, use the `/whitebox-assessment/describe` endpoint.",
        "parameters": [
          {
            "$ref": "#/components/parameters/orgID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "workflow_run_id": {
                    "type": "string",
                    "maxLength": 256,
                    "minLength": 1,
                    "description": "The ID of the workflow run that produced the artifact"
                  },
                  "artifact_name": {
                    "type": "string",
                    "maxLength": 256,
                    "minLength": 1,
                    "description": "The name of the artifact to download"
                  }
                },
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "workflow_run_id",
                  "artifact_name"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "url": {
                      "type": "string",
                      "description": "URL to download the artifact via HTTP GET"
                    },
                    "expires_in_seconds": {
                      "type": "integer",
                      "description": "Number of seconds until the download URL expires"
                    }
                  },
                  "type": "object",
                  "required": [
                    "url",
                    "expires_in_seconds"
                  ]
                }
              }
            },
            "description": "Successful response"
          }
        },
        "summary": "Get artifact download URL for a whitebox-assessment workflow run"
      }
    }
  },
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "servers": [
    {
      "description": "Production",
      "url": "https://api.cloud.shisho.dev"
    },
    {
      "description": "Staging",
      "url": "https://api.shisho.fslp.dev"
    }
  ]
}