Swagger: Create or Update API
swagger_create_or_update_apiCreate a new API or update an existing one in SwaggerHub Registry by submitting an OpenAPI/AsyncAPI definition, with automatic format detection and returned operation status.
Instructions
Create a new API or update an existing API in SwaggerHub Registry for Swagger Studio. The API specification type (OpenAPI, AsyncAPI) is automatically detected from the definition content. APIs are always created with fixed values: version 1.0.0, private visibility, and automock disabled (these values cannot be changed). Returns HTTP 201 for creation, HTTP 200 for update. Response includes 'operation' field indicating whether it was a 'create' or 'update' operation along with API details and SwaggerHub URL.
Toolset: Registry API
Parameters:
owner (string) required: Organization name (owner of the API)
apiName (string) required: API name
definition (string) required: API definition content (OpenAPI/AsyncAPI specification in JSON or YAML format). Format is automatically detected. On create, fixed values are used: version 1.0.0, private visibility, automock disabled, and no project assignment. On update, the API's existing visibility is preserved.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | Organization name (owner of the API) | |
| apiName | Yes | API name | |
| definition | Yes | API definition content (OpenAPI/AsyncAPI specification in JSON or YAML format). Format is automatically detected. On create, fixed values are used: version 1.0.0, private visibility, automock disabled, and no project assignment. On update, the API's existing visibility is preserved. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | ||
| owner | No | ||
| apiName | No | ||
| version | No | ||
| operation | No |