---
title: "POST /v1/projects/{projectsId}/locations/{locationsId}/plugins"
method: POST
path: "/v1/projects/{projectsId}/locations/{locationsId}/plugins"
tags: ["projects"]
---

# POST /v1/projects/{projectsId}/locations/{locationsId}/plugins

`POST /v1/projects/{projectsId}/locations/{locationsId}/plugins`

## Request

- Base URL: `https://apihub.googleapis.com`
- URL: `https://apihub.googleapis.com/v1/projects/{projectsId}/locations/{locationsId}/plugins`
- Auth: one of:
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/apihub.readwrite`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/apihub.readwrite`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/cloud-platform`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform`
- TypeScript: <https://skmtc.dev/google/apis/apihub/docs/v1/projects/:projectsId/locations/:locationsId/plugins/post.ts> (a function with typed inputs; its response is checked against the schema)

Create an API Hub plugin resource in the API hub. Once a plugin is created, it can be used to create plugin instances.

## Path parameters

- `projectsId` string, required
- `locationsId` string, required

## Query parameters

- `pluginId` string

## Request body

- GoogleCloudApihubV1Plugin: A plugin resource in the API Hub.
  - `actionsConfig` GoogleCloudApihubV1PluginActionConfig[]: Optional. The configuration of actions supported by the plugin. **REQUIRED**: This field must be provided when creating or updating a Plugin. The server will reject requests if this field is missing.
    - `description` string: Required. The description of the operation performed by the action.
    - `displayName` string: Required. The display name of the action.
    - `id` string: Required. The id of the action.
    - `triggerMode` 'TRIGGER_MODE_UNSPECIFIED' | 'API_HUB_ON_DEMAND_TRIGGER' | 'API_HUB_SCHEDULE_TRIGGER' | 'NON_API_HUB_MANAGED': Required. The trigger mode supported by the action.
  - `configTemplate` GoogleCloudApihubV1ConfigTemplate: ConfigTemplate represents the configuration template for a plugin.
    - `additionalConfigTemplate` GoogleCloudApihubV1ConfigVariableTemplate[]: Optional. The list of additional configuration variables for the plugin's configuration.
      - `description` string: Optional. Description.
      - `enumOptions` GoogleCloudApihubV1ConfigValueOption[]: Optional. Enum options. To be populated if `ValueType` is `ENUM`.
        - `description` string: Optional. Description of the option.
        - `displayName` string: Required. Display name of the option.
        - `id` string: Required. Id of the option.
      - `id` string: Required. ID of the config variable. Must be unique within the configuration.
      - `multiSelectOptions` GoogleCloudApihubV1ConfigValueOption[]: Optional. Multi select options. To be populated if `ValueType` is `MULTI_SELECT`.
        - `description` string: Optional. Description of the option.
        - `displayName` string: Required. Display name of the option.
        - `id` string: Required. Id of the option.
      - `required` boolean: Optional. Flag represents that this `ConfigVariable` must be provided for a PluginInstance.
      - `validationRegex` string: Optional. Regular expression in RE2 syntax used for validating the `value` of a `ConfigVariable`.
      - `valueType` 'VALUE_TYPE_UNSPECIFIED' | 'STRING' | 'INT' | 'BOOL' | 'SECRET' | 'ENUM' | 'MULTI_SELECT' | 'MULTI_STRING' | 'MULTI_INT': Required. Type of the parameter: string, int, bool etc.
    - `authConfigTemplate` GoogleCloudApihubV1AuthConfigTemplate: AuthConfigTemplate represents the authentication template for a plugin.
      - `serviceAccount` GoogleCloudApihubV1GoogleServiceAccountConfig: Config for Google service account authentication.
        - `serviceAccount` string: Required. The service account to be used for authenticating request. The `iam.serviceAccounts.getAccessToken` permission should be granted on this service account to the impersonator service account.
      - `supportedAuthTypes` string[]: Required. The list of authentication types supported by the plugin.
  - `createTime` string, google-datetime: Output only. Timestamp indicating when the plugin was created.
  - `description` string: Optional. The plugin description. Max length is 500000 characters (Unicode code points).
  - `displayName` string: Required. The display name of the plugin. Max length is 500 characters (Unicode code points).
  - `documentation` GoogleCloudApihubV1Documentation: Documentation details.
    - `externalUri` string: Optional. The uri of the externally hosted documentation.
  - `gatewayType` 'GATEWAY_TYPE_UNSPECIFIED' | 'APIGEE_X_AND_HYBRID' | 'APIGEE_EDGE_PUBLIC_CLOUD' | 'APIGEE_EDGE_PRIVATE_CLOUD' | 'CLOUD_API_GATEWAY' | 'CLOUD_ENDPOINTS' | 'API_DISCOVERY' | 'OTHERS' | 'AWS_API_GATEWAY' | 'AZURE_API_MANAGEMENT': Optional. The type of the gateway.
  - `hostingService` GoogleCloudApihubV1HostingService: The information related to the service implemented by the plugin developer, used to invoke the plugin's functionality.
    - `serviceUri` string: Optional. The URI of the service implemented by the plugin developer, used to invoke the plugin's functionality. This information is only required for user defined plugins.
  - `name` string: Identifier. The name of the plugin. Format: `projects/{project}/locations/{location}/plugins/{plugin}`
  - `ownershipType` 'OWNERSHIP_TYPE_UNSPECIFIED' | 'SYSTEM_OWNED' | 'USER_OWNED': Output only. The type of the plugin, indicating whether it is 'SYSTEM_OWNED' or 'USER_OWNED'.
  - `pluginCategory` 'PLUGIN_CATEGORY_UNSPECIFIED' | 'API_GATEWAY' | 'API_PRODUCER': Optional. The category of the plugin, identifying its primary category or purpose. This field is required for all plugins.
  - `state` 'STATE_UNSPECIFIED' | 'ENABLED' | 'DISABLED': Output only. Represents the state of the plugin. Note this field will not be set for plugins developed via plugin framework as the state will be managed at plugin instance level.
  - `type` GoogleCloudApihubV1AttributeValues: The attribute values associated with resource.
    - `attribute` string: Output only. The name of the attribute. Format: projects/{project}/locations/{location}/attributes/{attribute}
    - `enumValues` GoogleCloudApihubV1EnumAttributeValues: The attribute values of data type enum.
      - `values` GoogleCloudApihubV1AllowedValue[]: Required. The attribute values in case attribute data type is enum.
        - `description` string: Optional. The detailed description of the allowed value.
        - `displayName` string: Required. The display name of the allowed value.
        - `id` string: Required. The ID of the allowed value. * If provided, the same will be used. The service will throw an error if the specified id is already used by another allowed value in the same attribute resource. * If not provided, a system generated id derived from the display name will be used. In this case, the service will handle conflict resolution by adding a system generated suffix in case of duplicates. This value should be 3-500 characters, and valid characters are /a-z[0-9]-_/.
        - `immutable` boolean: Optional. When set to true, the allowed value cannot be updated or deleted by the user. It can only be true for System defined attributes.
    - `jsonValues` GoogleCloudApihubV1StringAttributeValues: The attribute values of data type string or JSON.
      - `values` string[]: Required. The attribute values in case attribute data type is string or JSON.
    - `stringValues` GoogleCloudApihubV1StringAttributeValues: The attribute values of data type string or JSON.
      - `values` string[]: Required. The attribute values in case attribute data type is string or JSON.
    - `uriValues` GoogleCloudApihubV1StringAttributeValues: The attribute values of data type string or JSON.
      - `values` string[]: Required. The attribute values in case attribute data type is string or JSON.
  - `updateTime` string, google-datetime: Output only. Timestamp indicating when the plugin was last updated.

## Response `200`

Successful response

- GoogleCloudApihubV1Plugin: A plugin resource in the API Hub.
  - `actionsConfig` GoogleCloudApihubV1PluginActionConfig[]: Optional. The configuration of actions supported by the plugin. **REQUIRED**: This field must be provided when creating or updating a Plugin. The server will reject requests if this field is missing.
    - `description` string: Required. The description of the operation performed by the action.
    - `displayName` string: Required. The display name of the action.
    - `id` string: Required. The id of the action.
    - `triggerMode` 'TRIGGER_MODE_UNSPECIFIED' | 'API_HUB_ON_DEMAND_TRIGGER' | 'API_HUB_SCHEDULE_TRIGGER' | 'NON_API_HUB_MANAGED': Required. The trigger mode supported by the action.
  - `configTemplate` GoogleCloudApihubV1ConfigTemplate: ConfigTemplate represents the configuration template for a plugin.
    - `additionalConfigTemplate` GoogleCloudApihubV1ConfigVariableTemplate[]: Optional. The list of additional configuration variables for the plugin's configuration.
      - `description` string: Optional. Description.
      - `enumOptions` GoogleCloudApihubV1ConfigValueOption[]: Optional. Enum options. To be populated if `ValueType` is `ENUM`.
        - `description` string: Optional. Description of the option.
        - `displayName` string: Required. Display name of the option.
        - `id` string: Required. Id of the option.
      - `id` string: Required. ID of the config variable. Must be unique within the configuration.
      - `multiSelectOptions` GoogleCloudApihubV1ConfigValueOption[]: Optional. Multi select options. To be populated if `ValueType` is `MULTI_SELECT`.
        - `description` string: Optional. Description of the option.
        - `displayName` string: Required. Display name of the option.
        - `id` string: Required. Id of the option.
      - `required` boolean: Optional. Flag represents that this `ConfigVariable` must be provided for a PluginInstance.
      - `validationRegex` string: Optional. Regular expression in RE2 syntax used for validating the `value` of a `ConfigVariable`.
      - `valueType` 'VALUE_TYPE_UNSPECIFIED' | 'STRING' | 'INT' | 'BOOL' | 'SECRET' | 'ENUM' | 'MULTI_SELECT' | 'MULTI_STRING' | 'MULTI_INT': Required. Type of the parameter: string, int, bool etc.
    - `authConfigTemplate` GoogleCloudApihubV1AuthConfigTemplate: AuthConfigTemplate represents the authentication template for a plugin.
      - `serviceAccount` GoogleCloudApihubV1GoogleServiceAccountConfig: Config for Google service account authentication.
        - `serviceAccount` string: Required. The service account to be used for authenticating request. The `iam.serviceAccounts.getAccessToken` permission should be granted on this service account to the impersonator service account.
      - `supportedAuthTypes` string[]: Required. The list of authentication types supported by the plugin.
  - `createTime` string, google-datetime: Output only. Timestamp indicating when the plugin was created.
  - `description` string: Optional. The plugin description. Max length is 500000 characters (Unicode code points).
  - `displayName` string: Required. The display name of the plugin. Max length is 500 characters (Unicode code points).
  - `documentation` GoogleCloudApihubV1Documentation: Documentation details.
    - `externalUri` string: Optional. The uri of the externally hosted documentation.
  - `gatewayType` 'GATEWAY_TYPE_UNSPECIFIED' | 'APIGEE_X_AND_HYBRID' | 'APIGEE_EDGE_PUBLIC_CLOUD' | 'APIGEE_EDGE_PRIVATE_CLOUD' | 'CLOUD_API_GATEWAY' | 'CLOUD_ENDPOINTS' | 'API_DISCOVERY' | 'OTHERS' | 'AWS_API_GATEWAY' | 'AZURE_API_MANAGEMENT': Optional. The type of the gateway.
  - `hostingService` GoogleCloudApihubV1HostingService: The information related to the service implemented by the plugin developer, used to invoke the plugin's functionality.
    - `serviceUri` string: Optional. The URI of the service implemented by the plugin developer, used to invoke the plugin's functionality. This information is only required for user defined plugins.
  - `name` string: Identifier. The name of the plugin. Format: `projects/{project}/locations/{location}/plugins/{plugin}`
  - `ownershipType` 'OWNERSHIP_TYPE_UNSPECIFIED' | 'SYSTEM_OWNED' | 'USER_OWNED': Output only. The type of the plugin, indicating whether it is 'SYSTEM_OWNED' or 'USER_OWNED'.
  - `pluginCategory` 'PLUGIN_CATEGORY_UNSPECIFIED' | 'API_GATEWAY' | 'API_PRODUCER': Optional. The category of the plugin, identifying its primary category or purpose. This field is required for all plugins.
  - `state` 'STATE_UNSPECIFIED' | 'ENABLED' | 'DISABLED': Output only. Represents the state of the plugin. Note this field will not be set for plugins developed via plugin framework as the state will be managed at plugin instance level.
  - `type` GoogleCloudApihubV1AttributeValues: The attribute values associated with resource.
    - `attribute` string: Output only. The name of the attribute. Format: projects/{project}/locations/{location}/attributes/{attribute}
    - `enumValues` GoogleCloudApihubV1EnumAttributeValues: The attribute values of data type enum.
      - `values` GoogleCloudApihubV1AllowedValue[]: Required. The attribute values in case attribute data type is enum.
        - `description` string: Optional. The detailed description of the allowed value.
        - `displayName` string: Required. The display name of the allowed value.
        - `id` string: Required. The ID of the allowed value. * If provided, the same will be used. The service will throw an error if the specified id is already used by another allowed value in the same attribute resource. * If not provided, a system generated id derived from the display name will be used. In this case, the service will handle conflict resolution by adding a system generated suffix in case of duplicates. This value should be 3-500 characters, and valid characters are /a-z[0-9]-_/.
        - `immutable` boolean: Optional. When set to true, the allowed value cannot be updated or deleted by the user. It can only be true for System defined attributes.
    - `jsonValues` GoogleCloudApihubV1StringAttributeValues: The attribute values of data type string or JSON.
      - `values` string[]: Required. The attribute values in case attribute data type is string or JSON.
    - `stringValues` GoogleCloudApihubV1StringAttributeValues: The attribute values of data type string or JSON.
      - `values` string[]: Required. The attribute values in case attribute data type is string or JSON.
    - `uriValues` GoogleCloudApihubV1StringAttributeValues: The attribute values of data type string or JSON.
      - `values` string[]: Required. The attribute values in case attribute data type is string or JSON.
  - `updateTime` string, google-datetime: Output only. Timestamp indicating when the plugin was last updated.

## Changes

- **2026-11-08** `09b6c7d2247b`: 4 info
  - the security scope `https://www.googleapis.com/auth/apihub.readwrite` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/apihub.readwrite` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was removed from the endpoint's security scheme `Oauth2c`

[Operation history](https://skmtc.dev/google/apis/apihub/changes/v1/projects/:projectsId/locations/:locationsId/plugins/post.md)

---

[API](https://skmtc.dev/google/apis/apihub.md) - [All operations](https://skmtc.dev/google/apis/apihub/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/apihub/revisions/09b6c7d2247b?raw)
