Creating REST APIs by importing from file

Build an API by importing definitions from an existing file.

About this task

API definition files typically follow the OpenAPI (Swagger) standard and include details about endpoints, request and response formats, authentication methods, and other specifications. This approach eliminates manual configuration and helps maintain standardized API structures.

Procedure

  1. From the home page, select an existing project. If no project exists, create a new project.
  2. In the Quick start page, click Add an API > Import.
    The Import API from file page is displayed.
  3. On the Import API from file page, upload or drag your API definition file in the Upload API file section.
  4. Provide the API details.
    • API type. The API type is set to REST, based on the API definition file that you upload.
    • API name. Provide a name for the API.
    • Namespace. Define a domain for the API to avoid conflicts with other APIs.
    • API version. Specify the version of the API to manage changes over time. The default value is 1.0.
    • Tags. Add labels to categorize the API for improved search and filtering.
  5. Click Create.
    A REST API is created, and the following files are generated:
    • An API file with kind: API.
    • An API specification file.

    You can view these files in the code view.

What to do next

  1. Author policies. Define and apply policies to manage security, rate limit, caching, and other API behaviors. For more information, see Creating policies.
  2. Update the API specification. Update the API specification to reflect changes such as new resources, modified operations, updated request or response structures, or revised security requirements, replacing the existing specification and updating all references. For more information, see Updating API specification.
  3. Publish the API. Publish the API to the gateway and make it accessible for consumers. For more information, see Publishing projects.
  4. Test the API. Verify that endpoints work as expected. For more information, see Testing published APIs.