---
title: "generate openapi spec from http routes/webhook"
method: POST
path: "/w/{workspace}/openapi/generate"
tags: ["openapi"]
---

# generate openapi spec from http routes/webhook

`POST /w/{workspace}/openapi/generate`

## Path parameters

- `workspace` string, required

## Request body

- GenerateOpenapiSpec
  - `info` OpenapiV3Info
    - `title` string, required
    - `version` string, required
    - `description` string
    - `terms_of_service` string
    - `contact` object
      - `name` string
      - `url` string
      - `email` string
    - `license` object
      - `name` string, required
      - `identifier` string
      - `url` string
  - `url` string
  - `openapi_spec_format` 'yaml' | 'json'
  - `http_route_filters` OpenapiHttpRouteFilters[]
    - `folder_regex` string, required
    - `path_regex` string, required
    - `route_path_regex` string, required
  - `webhook_filters` WebhookFilters[]
    - `user_or_folder_regex` '*' | 'u' | 'f', required
    - `user_or_folder_regex_value` string, required
    - `path` string, required
    - `runnable_kind` 'script' | 'flow', required

## Response `200`

openapi spec

---

[API](https://skmtc.net/windmill/apis/windmill-api.md) · [All operations](https://skmtc.net/windmill/apis/windmill-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/windmill/windmill-api/revisions/db0e7e036e34/schema)
