You're viewing **Apigee Edge** documentation.  
[Go to the
**Apigee X** documentation](http://cloud.google.com/apigee/docs/api-platform/local-development/vscode/tutorial-attach-policy). info

In this step, you'll publish an API to the portal by performing the following steps:  

1. [Create an OpenAPI Specification](https://docs.apigee.com/api-platform/tutorials/portal/publish-api#spec)  

2. [Create an API proxy from a spec](https://docs.apigee.com/api-platform/tutorials/portal/publish-api#proxy)  

3. [Create an API product](https://docs.apigee.com/api-platform/tutorials/portal/publish-api#product)  

4. [Publish the API to your portal](https://docs.apigee.com/api-platform/tutorials/portal/publish-api#publish)

## Step 1: Create an OpenAPI Specification

Each OpenAPI Specification serves as the [source of truth](https://docs.apigee.com/api-platform/publish/specs/intro#what-happens-if-modify-spec) throughout the API lifecycle. The same specification is used at each phase in the API lifecycle, from development to publishing.

**To create an OpenAPI Specification**:

1. Select **Develop \> Specs** in the left navigation bar to open the **Specs** page.
2. Click **+ Spec \> Import URL**.
3. Enter the following information in the import dialog:
4. Import name: **helloworld**
5. Import Url: **https://raw.githubusercontent.com/apigee/api-platform-samples/master/default-proxies/helloworld/openapi/mocktarget.yaml**

6. Click **Import**.

## Step 2: Create an API Proxy from a spec

Create an API proxy from an OpenAPI Specification that describes the API.

**To create an API proxy from an OpenAPI Specification**:

1. On the Specs page, position your cursor over the **helloworld** spec to display the actions menu.
2. Click ![](https://docs.apigee.com/static/api-platform/images/generate-proxy.png) to generate an API proxy from the spec.  
   The Build a Proxy wizard is opened and the Details page is pre-populated using values from the OpenAPI Specification.
3. Edit the **Description** field as follows: **API proxy for hello world.**
4. Click **Next**.
5. On the **Policies** page:

   - Under **Security: Authorization** , select **Pass through (no authorization)**.
   - Under **Security: Browser** , select **Add CORS headers** .

   ![Common policies page in the Create Proxy wizard with Pass through and Add CORS headers selected](https://docs.apigee.com/static/api-platform/tutorials/portal/images/getstarted-policies.png)
6. Click **Next**.

7. On the **Flows** page, make sure all operations are selected and click **Next** .  

   ![Build a Proxy Flows](https://docs.apigee.com/static/api-platform/images/tutorial-build-proxy-flows-v3.png)

8. On the Virtual Hosts page, make sure all virtual hosts are selected and click **Next**.

9. On the **Summary** page, select the environment to which you want to deploy under **Optional Deployment**.

   ![](https://docs.apigee.com/static/api-platform/images/mocktarget-summary.png)
10. Click **Create**.

On the Summary page, you'll see an acknowledgement that your new API proxy was created successfully
and deployed to your test environment.

## Step 3: Create an API product

Create an API product that contains the API resources that you want to expose to your API consumers.

**To create an API product**:

1. Select **Publish \> API Products** in the left navigation bar to open the API Products page.
2. Click **+ API Product** .  
   The New Product page is displayed.
3. Enter the **Product Details** for your API product.  
   **Note** : The Display Name and Description fields are displayed in the portal when you publish the API product, by default. You can edit the values in [Step 4: Publish the API to your portal](https://docs.apigee.com/api-platform/tutorials/portal/publish-api#publish).   

   | Field | Value |
   |---|---|
   | Name | **Hello World** |
   | Display Name | **Hello World** |
   | Description | **Simple hello world example** |
   | Environment | Select environment where API proxy is deployed. |
   | Access | **Public** |
   | Automatically approve access requests | **Enabled** |
   | Quota | **(leave blank)** |
   | Allowed OAuth Scopes | **(leave blank)** |

4. Under **API resources** , click **Add a proxy** to identify the API proxies to add to your API product.  
   The **Add API Resource** dialog displays.
5. Click **API Proxy** (if it's not already selected) and select **Mock-Target-API** in the list.
6. Click **Add**.
7. Click **Save** to save the API product.


   ![Hello World API product showing all fields set](https://docs.apigee.com/static/api-platform/tutorials/portal/images/getstarted-helloworldproduct.png)

## Step 4: Publish the API to your portal

Publish the API to your portal to enable your customers to learn about and use it.

**To publish the API to your portal**:

1. Navigate to the APIs page in your portal:
   1. Select **Publish \> Portals** in the left navigation bar.
   2. Click in the **My first portal** row to open the portal.
   3. Click **API catalog** to display the APIs page.
2. Click **+**.
3. Select **Hello World** in the **Add an API product to the catalog** dialog and click **Next**.
4. Under **API details** , configure the following options:
   - Select **Published (listed in the catalog)** to publish the API to your portal.
   - For **Display image** :
     1. Click **Select image**.
     2. Click **home-background.jpg** from the list of existing images in the **Select image** dialog.
     3. Click **Select**.
     4. Preview the image and click **Select**.
   - For **Categories** , enter **Get Started** and press **Enter**.

   Leave all other values set to their defaults.
5. Under **API documentation** , to auto-generate API reference documentation from a snapshot of your OpenAPI Specification:
   1. Select **OpenAPI document**.
   2. Click **Select Document**.
   3. Select the **My Specs** tab (if it is not already selected).
   4. Select **helloworld** from the list of specs.
   5. Click **Select**.
6. Click **Save** to save the API details.


   ![Hello World API showing all fields set](https://docs.apigee.com/static/api-platform/tutorials/portal/images/getstarted-helloworldapi.png)

To view the API reference documentation:

1. Click **Live Portal** to view the changes in the live portal (or refresh the live portal if it is already open in another tab).
2. Click **APIs** in the top navigation bar to the view published API.
3. Click the **Hello World** card to view the API reference documentation. **Give your API a try!**

![Mock Target API published with Try this API panel](https://docs.apigee.com/static/api-platform/tutorials/portal/images/getstarted-apicall.png)

*** ** * ** ***

**Congratulations!**
You have successfully completed the tutorial. Ready to learn more?
Go to the [Build your integrated portal](https://docs.apigee.com/api-platform/publish/portal/build-integrated-portal).