Create a Domain

You can create a new domain from scratch, and then add content to it, or you can fork an existing domain like you fork an API.

To create a new domain:

  1. In the top left corner of any page, click and select Create New Domain.

    Adding a new domain
  2. Enter domain information:

    Domain information
    • Specification – Choose the domain format: OpenAPI 2.0, OpenAPI 3.0 or AsyncAPI. Note: OpenAPI 3.0 support has some limitations, AsyncAPI also has limitations.

    • Name – The domain name is its unique ID and is part of its URL on SwaggerHub, as in{owner}/commons/1.0.


      • 3 to 60 character long

      • allowed characters: A..Z a..z 0..9 - _ .

      • must start and end with a letter or digit


      Domain names are case-sensitive, so commons and Commons are two different domains.

    • Version – The version number of the domain. For example, 1.0, 1.0.0, 1.0rc5, beta, 2016-04-15, and so on. See Version Format.

    • Owner – Choose whether to create the domain in your personal or organization account (if you are a member of an organization on SwaggerHub). The domain owner is part of the domain path in SwaggerHub:{domain-name}/1.0. Organization-owned domains count toward the organization’s limits rather than yours.


      Organization owners can always create domains in that organization. Members with the Designer role can also create domains.

    • Project – If an organization is selected as the Owner, you can optionally select a project to add this domain to. The list contains existing projects available to you.


      This option was added in v. 1.23.

    • Visibility – Choose whether the domain will be public (visible to anyone in your company) or private (can be accessed only by you and by the collaborators with whom you share the domain). For details, see Public and Private APIs.

  3. Click Create Domain.

After you create a domain, the SwaggerHub editor opens, in which you can add components to your domain, such as common parameters and data models. Once the components are added, you can refer to them from your APIs.

See Also

Publication date: