Swagger: Create or Update API
swagger_create_or_update_apiCreate or update an API in SwaggerHub Registry. Automatically detects specification type (OpenAPI/AsyncAPI) and returns create or update status with API details.
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. API is created with fixed values: version 1.0.0, private visibility, automock disabled, and no project assignment.
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. API is created with fixed values: version 1.0.0, private visibility, automock disabled, and no project assignment. |