*This page
applies to **Apigee** and **Apigee hybrid**.*

When you register an API with API hub, you create and store an entity that represents the API. We call
this entity an **API resource**. API resources stored in API hub are searchable and provide detailed
operational and descriptive information about the API.
Either at the time you register an API or afterwards, you can add and edit API resource attributes to build
a rich description of the API.

### Console

To register an API:

1. In the Google Cloud console, go to the **APIs** page in **API hub**.

   [Go to API hub](https://console.cloud.google.com/apigee/api-hub/apis)
2. Click **Register API**.
3. Under **General details** , optionally specify a unique ID for the API. If you do not supply an ID, the system will generate one for you.
   If you wish to enter an ID, click **Specify Unique ID**.

   > [!NOTE]
   > **Note:** The ID must be 4-500 characters, and valid characters are `/[A-Z][a-z][0-9]-/.` The ID is the last component of the fully qualified, unique API resource name, which is in the format: `projects/PROJECT/locations/LOCATION/apis/API_ID`

4. (Required) Provide a display name for the API resource.
5. Optionally add additional attributes that describe the API. You can return to the API at any time to add or change API attributes. See [Edit an API resource](https://docs.cloud.google.com/apigee/docs/apihub/manage-apis.md.txt#updateapi.).
   - **Owner information**: (Optional) The name and email address of the API owner.
   - **Additional details** : (Optional) Specify attributes to help define your API and make it more easily searchable. You can define default values for some of these attributes in Settings. For details, see [Manage attributes](https://docs.cloud.google.com/apigee/docs/apihub/manage-attributes.md.txt).
   - **User defined attributes** : (Optional) These are attributes that you define in Settings. For details, see [Manage attributes](https://docs.cloud.google.com/apigee/docs/apihub/manage-attributes.md.txt).
6. Click **Register**.

### REST

To register an API, use the [Create API](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis/create.md.txt) REST API.

```
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" -d '{
    "display_name": "DISPLAY_NAME",            # Required attribute
    "description": "DESCRIPTION"               # description is an optional attribute
    }
    'https://apihub.googleapis.com/v1/projects/HUB_PROJECT/locations/HUB_LOCATION/apis?api_id=API_ID
```

Replace the following:

- <var translate="no">HUB_PROJECT</var>: The name of your API hub host project. The host project was selected when API hub was provisioned.
- <var translate="no">HUB_LOCATION</var>: The location of the host project. The location was chosen when API hub was provisioned.
- <var translate="no">API_ID</var>: (Optional) Enter a unique ID for the API. If you do not supply this query parameter, the system will generate a unique ID for you.

  > [!NOTE]
  > **Note:** The ID must be 4-500 characters, and valid characters are `/[A-Z][a-z][0-9]-/.` The ID is the last component of the fully qualified, unique API resource name, which is in the format: `projects/PROJECT/locations/LOCATION/apis/API_ID`

- <var translate="no">DISPLAY_NAME</var>: (Required) The display name of the API resource. You can use any name you wish.
- <var translate="no">DESCRIPTION</var>: (Optional) You can add a number of optional attributes to describe the API resource, including a description, an owner, a link to the API documentation, and more. These optional attributes are listed and described in the [API resource definition](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis.md.txt).

## What's next

- Learn how to [View API resource insights](https://docs.cloud.google.com/apigee/docs/apihub/view-api-resource-insights.md.txt).
- Learn how to [Manage API versions](https://docs.cloud.google.com/apigee/docs/apihub/manage-versions.md.txt).
- Learn about [API insights in API hub](https://docs.cloud.google.com/apigee/docs/apihub/api-insights-overview.md.txt).