Creating an API proxy

This page applies to Apigee and Apigee hybrid.

View Apigee Edge documentation.

Create a proxy in the Apigee UI, or using the API, as described in the following sections.

API proxy primary fields

Follow these guidelines when creating an API proxy:

Field Description
API proxy name Name displayed for your API. Specify alphanumeric characters, dash (-), or underscore (_).
API proxy base path URI fragment that appears after the http://[host] or https://[host] address of your API proxy. Apigee uses the base path URI to match and route incoming request messages to the proper API proxy.

Use wildcards in base paths

Use one or more wildcards in API proxy base paths to future-proof your API proxies. We allow specification of a single * wildcard character between two / forward slash characters: /*/. For example, a base path of /team/*/members allows clients to call https://[host]/team/blue/members and https://[host]/team/green/members without you needing to create new API proxies to support new teams. You can replace any number of tokens in the basepath following this pattern. Other patterns, including /**, /something*, or /*something, are not supported.

Description (Optional). A description for the API proxy.
Target/Backend target URL URL (including HTTP or HTTPS) of the backend service that this API proxy invokes.

Steps to create an API proxy

To create an API proxy using the UI or APIs:

Apigee in Cloud console

To create a proxy in Apigee in Cloud console:

  1. Open the Apigee UI in Cloud console in a browser.
  2. In the left navigation pane, click Proxy development > API Proxies.
  3. In the API Proxies pane, click + Create.
  4. In the Create a proxy pane, under Proxy template, select Reverse proxy (Most common).
  5. Under Proxy details, enter the following:
    • Proxy name: Enter a name for the proxy, such as myproxy.
    • Base Path: Automatically set to the value you enter for Proxy name. The Base Path is part of the URL used to make requests to your API. Apigee uses the URL to match and route incoming requests to the appropriate API proxy.
    • Description (Optional): Enter a description for your new API proxy, such as "Testing Apigee with a simple proxy."
    • Target (Existing API): Enter https://mocktarget.apigee.net. This defines the target URL that Apigee invokes on a request to the API proxy. The mocktarget service is hosted at Apigee and returns simple data. It requires no API key or access token.
    • Click Next.
  6. Deploy (optional):
    • Deployment environments: Optional. Use the checkboxes to select one or more environments in which to deploy your proxy. If you prefer not to deploy the proxy at this point, leave the Deployment environments field empty. You can always deploy the proxy later.
    • Service Account: Optional. Attach a service account to your deployment to enable your proxy to access Google Cloud services, as specified in the service account's role and permissions.
  7. Click Create.

Apigee creates the new proxy and displays a summary of the proxy details in the Proxy summary view.

myproxy summary pane.

If you choose to deploy the proxy, the Deployments section displays the Revision number, which is 1 when you first deploy. The Status column displays the environments in which the proxy is deployed with a green status indicator.

Classic Apigee

To create a simple API proxy in the classic Apigee UI:

  1. Sign in to the Apigee UI.
  2. Click API Proxies in the main view.
  3. From the Environment drop-down list, select the environment in which you want to create a new API proxy.

    The hybrid UI displays a list of API proxies for that environment. If you haven't created any proxies yet, the list is empty.

  4. Click Create New.

    The Create Proxy wizard starts.

  5. Click Reverse proxy (most common).

    A reverse proxy

    The Proxy details page is displayed.

  6. Configure your proxy with the following settings:
    • Name: Enter getstarted. If a proxy already exists with this name, choose a different name.
    • Base Path: Leave this set to /getstarted. The Base Path is part of the URL used to make requests to your API. Apigee uses the URL to match and route incoming requests to the appropriate API proxy.
    • Description (Optional): Enter a description for your new API proxy, such as Get started API proxy.
    • Target (Existing API): Enter https://mocktarget.apigee.net. This defines the target URL that Apigee invokes on a request to the API proxy. The mocktarget service is hosted at Apigee and returns simple data. It requires no API key or access token.

    Your API proxy's details should look like the following:

    API proxy details

  7. Click Next.
  8. In the Common policies view, under Security: Authorization select Pass through (no authorization).

    Pass through selection

  9. Click Next.
  10. On the Summary page, select the deployment environments, if desired, and click Create and deploy.

    Create and
      deploy

    Your new API proxy is created and deployed in the selected environment.

    Successful deployment
    screen

  11. Click Edit proxy to display the Overview tab in the Proxy Editor.
  12. Edit proxy
      list

In the API proxies list, the getstarted API proxy deployment status is green for the test environment.

Shows list of API proxies. getstarted deployment status is green.

Apigee API

Create an API proxy in your Apigee organization by issuing a POST request to the following resource:

https://apigee.googleapis.com/v1/organizations/$ORG/apis

You must define the name of the API proxy using the name query parameter. Restrict the characters used in the name to the following: A-Za-z0-9._\-$ %

Optionally, you can import an API proxy configuration bundle by performing the following steps:

  • Set the action query parameter to import
  • Set the Content-type header to multipart/form-data
  • Pass the name of the API proxy configuration bundle on your local file system

The following example demonstrates how to create an API proxy by importing an API proxy configuration bundle (helloworld-config.zip) on your local file system using the API.

curl "https://apigee.googleapis.com/v1/organizations/$ORG/apis?name=helloworld&action=import" \
  -X POST \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-type: multipart/form-data" \
  -F "file=@helloworld-config.zip"

Where $TOKEN is set to your OAuth 2.0 access token, as described in Obtaining an OAuth 2.0 access token. For information about the curl options used in this example, see Using curl. For a description of the environment variables used, see Setting environment variables for Apigee API requests.

The following provides an example of the response output:

{
  "basepaths": [
    "/helloworld"
  ],
  "configurationVersion": {
    "majorVersion": 4
  },
  "createdAt": "1559145292799",
  "displayName": "helloworld",
  "entityMetaDataAsProperties": {
    "bundle_type": "zip",
    "subType": "Proxy",
    "lastModifiedAt": "1559145292799",
    "createdAt": "1559145292799"
  },
  "lastModifiedAt": "1559145292799",
  "name": "helloworld",
  "policies": [
    "verify-api-key",
    "remove-query-param-apikey",
    "OAuth-v20-1"
  ],
  "proxies": [
    "default"
  ],
  "proxyEndpoints": [
    "default"
  ],
  "resourceFiles": {},
  "targetEndpoints": [
    "default"
  ],
  "targets": [
    "default"
  ],
  "type": "Application",
  "revision": "1",
  "description": "Hello world"
}

For more information on creating an API proxy, see the apis.create method in the Apigee API. To see all the methods available for API proxies, see the API proxies API.

Next steps

After you create a simple API proxy, you typically do one of the following: