Swagger Portal Integration


swagger-portal.png

The Swagger Portal client provides comprehensive portal and product management capabilities. Access to these features requires authentication with a SWAGGER_API_KEY.

Available Tools

Portal Management Tools

list_portals

  • Purpose: Search for available portals within Swagger. Returns only the portals for which you are an owner or designer, either at the product or organization level.
  • Returns: Paginated list of portals, including metadata such as name, subdomain, status, and more.
  • Use case: Discovery of available portals.

get_portal

  • Purpose: Retrieve information about a specific portal.
  • Parameters: Portal UUID or subdomain (portalId).
  • Returns: Complete set of metadata properties for a specific portal.
  • Use case: Get full details on a specific portal configuration.

create_portal

  • Purpose: Create a new portal with Swagger.
  • Returns: Complete set of metadata properties for a specific portal.
  • Use case: Get full details on a specific portal configuration.
  • Parameters:
ParameterDescriptionTypeRequired
nameThe portal name.
Must be between 3 and 40 characters.
stringNo
subdomainThe subdomain to use for the portal.
Must be between 3 and 20 characters.
stringYes
offlineIf set to true the portal will not be visible to customers.
Default: false
booleanNo
routingDetermines the routing strategy ('browser' or 'proxy').
Default: browser
stringNo
credentialsEnabledIndicates if credentials are enabled for the portal.
Default: true
booleanNo
swaggerHubOrganizationIdThe corresponding Swagger (formerly SwaggerHub) organization UUIDstring (uuid)Yes
openapiRendererPortal level setting for the OpenAPI renderer.
- SWAGGER_UI - Use the Swagger UI renderer
- ELEMENTS - Use the Elements renderer
- TOGGLE - Switch between the two renderers with elements set as the default
Default: TOGGLE
stringNo
pageContentFormatDetermines the format of the page content (HTML or MARKDOWN or BOTH)
Default: HTML
stringNo

update_portal

  • Purpose: Update a specific portal's configuration.
  • Returns: Complete set of metadata properties for a specific portal.
  • Use case: Update configuration settings of existing Swagger portal.
  • Parameters:
ParameterDescriptionTypeRequired
portalIdPortal UUID or subdomain - unique identifier for the portal instancestringYes
nameUpdate the portal display name - shown to users and in branding (3-40 characters)stringNo
subdomainUpdate the portal subdomain - changes the portal URL. Must remain unique across all portals (3-20 characters, lowercase, alphanumeric with hyphens)stringNo
customDomainSet a custom domain for the portal by providing the domain name as a string. To remove the custom domain, set this value to null.stringNo
offlineSet portal visibility - true hides portal from customers (useful for maintenance or development)booleanNo
gtmKeyGoogle Tag Manager key for analytics tracking - format: GTM-XXXXXX (max 25 characters)stringNo
routingUpdate routing strategy - 'browser' for client-side routing or 'proxy' for server-side routingstringNo
credentialsEnabledEnable/disable authentication credentials for portal access - controls whether users can authenticate to view private contentbooleanNo
openapiRendererChange OpenAPI renderer: 'SWAGGER_UI' (Swagger UI), 'ELEMENTS' (Stoplight Elements), or 'TOGGLE' (switch between both)stringNo
pageContentFormatUpdate page content format for documentation rendering: 'HTML', 'MARKDOWN', or 'BOTH'stringNo

list_portal_products

  • Purpose: Get products for a specific portal.
  • Parameters: Portal UUID or subdomain (portalId).
  • Returns: Paginated list of products in a portal.
  • Use case: Understanding the products that exist for a given portal.

get_portal_product

  • Purpose: Retrieve information about a specific product resource.
  • Parameters: Product UUID (productId).
  • Returns: Complete set of properties for a specific product.
  • Use case: Understanding the product information and status (both from a publishing and visibility perspective).

create_portal_product

  • Purpose: Create a new product within a specific portal.
  • Returns: Information about the newly created product.
  • Use case: Add a new product to a portal.
  • Parameters:
ParameterDescriptionTypeRequired
portalIdPortal UUID or subdomain.stringYes
typeProduct creation type - 'new' to create from scratch or 'copy' to duplicate an existing productstringYes
sourceProductIdSource product UUID to copy from when type is 'copy'. Specifies which existing product to duplicate. Omit when type is 'new'.stringNo
nameProduct display name - will be shown to users in the portal navigation and product listings (3-40 characters)stringYes
slugURL-friendly identifier for the product - must be unique within the portal, used in URLs (e.g., 'my-api' becomes /my-api). 3-22 characters, lowercase, alphanumeric with hyphens, underscores, or dotsstringYes
descriptionProduct description - explains what the API/product does, shown in product listings and cards (max 110 characters)stringNo
publicWhether the product is publicly visible to all portal visitors - false means only authenticated users with appropriate roles can access itbooleanNo
hiddenWhether the product is hidden from the portal landing page navigation menus - useful for internal or draft productsbooleanNo
roleWhether the product has role-based access restrictions - controls if specific user roles are required to access the productbooleanNo

update_portal_product

  • Purpose: Update an product within a specific portal.
  • Returns: Information about the update product.
  • Use case: Change information on an existing product.
  • Parameters:
ParameterDescriptionTypeRequired
productIdProduct UUID or identifier in the format 'portal-subdomain:product-slug' - unique identifier for the productstringYes
nameUpdate product display name - changes how it appears to users in navigation and listings (3-40 characters)stringNo
slugUpdate URL-friendly identifier - must remain unique within the portal, affects product URLs (3-22 characters, lowercase, alphanumeric with hyphens/underscores/dots)stringNo
descriptionUpdate product description - explains the API/product functionality, shown in listings (max 110 characters)stringNo
publicChange product visibility - true makes it publicly accessible to all visitors, false restricts to authenticated users with rolesbooleanNo
hiddenChange navigation visibility - true hides from portal landing page menus while keeping the product accessible via direct linksbooleanNo

delete_portal_product

  • Purpose: Delete a product from a specific portal.
  • Parameters: Product UUID (productId).
  • Returns: No content on success.
  • Use case: Delete an existing product from a Swagger portal.

publish_portal_product

  • Purpose: Publish a product's content to make it live or as preview. This endpoint publishes the current content of a product, making it visible to portal visitors. Use preview mode to test before going live.
  • Returns: Publication status information.
  • Use case: Make product content visible to portal visitors, either as live content or preview for testing.
  • Parameters:
ParameterDescriptionTypeRequired
productIdProduct UUID or identifier in the format 'portal-subdomain:product-slug' - unique identifier for the productstringYes
previewWhether to publish as preview (true) or live (false). Preview allows testing before going live. Defaults to false (live publication)booleanNo

Product Sections Management

list_portal_product_sections

  • Purpose: Get sections for a specific product within a portal.
  • Returns: List of sections within a product, including metadata and embedded table of contents if requested.
  • Use case: Understanding the structure and organization of content within a product.
  • Parameters:
ParameterDescriptionTypeRequired
productIdProduct UUID or identifier in the format 'portal-subdomain:product-slug' - unique identifier for the productstringYes
embedList of related entities to embed in the response - e.g., ['tableOfContents', 'tableOfContents.swaggerhubApi'] to include table of contents and SwaggerHub API detailsarrayNo
pagePage number for paginated results - specifies which page of results to retrieve (default is 1)numberNo
sizeNumber of items per page for pagination - controls how many results are returned per page (default is 20)numberNo

Table of Contents Management

create_table_of_contents

  • Purpose: Create a new table of contents item in a portal product section. Supports API references, HTML content, and Markdown content types.
  • Returns: Information about the newly created table of contents item.
  • Use case: Add structured content navigation to product sections.
  • Parameters:
ParameterDescriptionTypeRequired
sectionIdSection ID - unique identifier for the section within the productstringYes
typeType of table of contents creation - 'new' to create from scratch or 'copy' to duplicate an existing onestringYes
titleTitle of the table of contents item - will be displayed in navigation (3-40 characters)stringYes
slugURL-friendly identifier for the table of contents item - must be unique within the section (3-22 characters, lowercase, alphanumeric with hyphens/underscores/dots)stringYes
orderOrder position of the table of contents item within its parent section or itemnumberYes
parentIdParent table of contents item ID - null for top-level items, or ID of parent item for nested structurestring/nullNo
contentContent configuration for the table of contents itemobjectYes

list_table_of_contents

  • Purpose: Get table of contents for a section of a product within a portal.
  • Returns: List of table of contents items within a section, including nested structure and content metadata.
  • Use case: Understanding the navigation structure and content organization within a product section.
  • Parameters:
ParameterDescriptionTypeRequired
sectionIdSection ID - unique identifier for the section within the productstringYes
embedList of related entities to embed in the response - e.g., ['swaggerhubApi'] to include SwaggerHub API detailsarrayNo
pagePage number for paginated results - specifies which page of results to retrieve (default is 1)numberNo
sizeNumber of items per page for pagination - controls how many results are returned per page (default is 20)numberNo

delete_table_of_contents

  • Purpose: Delete table of contents entry. Performs a soft-delete of an entry from the table of contents. Supports recursive deletion of nested items.
  • Returns: No content on success.
  • Use case: Remove table of contents items and optionally their nested structure.
  • Parameters:
ParameterDescriptionTypeRequired
tableOfContentsIdThe table of contents UUID, or identifier in the format 'portal-subdomain:product-slug:section-slug:table-of-contents-slug'stringYes
recursiveFlag to include all the nested tables of contents (default: false)booleanNo

Document Management

Note: Documents are managed as part of table of contents items. To delete a document, use delete_table_of_contents which will remove the table of contents entry and any associated document content.

get_document

  • Purpose: Get document content and metadata by document ID. Useful for retrieving HTML or Markdown content from table of contents items.
  • Returns: Document content and metadata including type, creation/modification dates.
  • Use case: Retrieve content for editing or display purposes.
  • Parameters:
ParameterDescriptionTypeRequired
documentIdDocument UUID - unique identifier for the documentstringYes

update_document

  • Purpose: Update the content of an existing document. Supports both HTML and Markdown content types.
  • Returns: Updated document metadata.
  • Use case: Modify existing documentation content within portal products.
  • Parameters:
ParameterDescriptionTypeRequired
documentIdDocument UUID - unique identifier for the documentstringYes
contentThe document content to update (HTML or Markdown based on document type)stringYes
typeContent type - 'html' for HTML content or 'markdown' for Markdown contentstringNo

Configuration

To use Swagger Portal tools, you need to configure the SWAGGER_API_KEY environment variable with your Swagger API token.

Common Use Cases

  1. Portal Discovery: Use list_portals to find available portals you have access to.
  2. Portal Management: Create and update portals using the respective tools.
  3. Product Organization: Manage products within portals for better API organization.
  4. Content Publishing: Use publish_portal_product to make product content live or preview changes before publishing.
  5. Content Structure Management: Organize product content using sections and table of contents for better navigation.
  6. Document Management: Create, update, and manage documentation content within portal products.
  7. Portal Content Architecture: Build comprehensive documentation portals with nested content structures and API references.