---
title: "POST /v1/{+parent}/instances"
method: POST
path: "/v1/{+parent}/instances"
tags: ["projects"]
---

# POST /v1/{+parent}/instances

`POST /v1/{+parent}/instances`

Creates a Plugin instance in the API hub.

## Path parameters

- `parent` string, required

## Query parameters

- `pluginInstanceId` string

## Request body

- GoogleCloudApihubV1PluginInstance — Represents a plugin instance resource in the API Hub. A PluginInstance is a specific instance of a hub plugin with its own configuration, state, and execution details.
  - `updateTime` string, google-datetime — Output only. Timestamp indicating when the plugin instance was last updated.
  - `createTime` string, google-datetime — Output only. Timestamp indicating when the plugin instance was created.
  - `name` string — Identifier. The unique name of the plugin instance resource. Format: `projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}`
  - `actions` GoogleCloudApihubV1PluginInstanceAction[] — Required. The action status for the plugin instance.
    - `resourceConfig` GoogleCloudApihubV1ResourceConfig — The configuration of resources created for a given plugin instance action.
      - `pubsubTopic` string — Output only. The pubsub topic to publish the data to. Format is projects/{project}/topics/{topic}
      - `actionType` 'ACTION_TYPE_UNSPECIFIED' | 'SYNC_METADATA' | 'SYNC_RUNTIME_DATA' — Output only. The type of the action.
    - `state` 'STATE_UNSPECIFIED' | 'ENABLED' | 'DISABLED' | 'ENABLING' | 'DISABLING' | 'ERROR' — Output only. The current state of the plugin action in the plugin instance.
    - `scheduleTimeZone` string — Optional. The time zone for the schedule cron expression. If not provided, UTC will be used.
    - `scheduleCronExpression` string — Optional. The schedule for this plugin instance action. This can only be set if the plugin supports API_HUB_SCHEDULE_TRIGGER mode for this action.
    - `serviceAccount` string — Optional. The service account used to publish data. Note, the service account will only be accepted for non-Google Cloud plugins like OPDK.
    - `hubInstanceAction` GoogleCloudApihubV1ExecutionStatus — The execution status for the plugin instance.
      - `currentExecutionState` 'CURRENT_EXECUTION_STATE_UNSPECIFIED' | 'RUNNING' | 'NOT_RUNNING' — Output only. The current state of the execution.
      - `lastExecution` GoogleCloudApihubV1LastExecution — The result of the last execution of the plugin instance.
        - `startTime` string, google-datetime — Output only. The last execution start time of the plugin instance.
        - `result` 'RESULT_UNSPECIFIED' | 'SUCCEEDED' | 'FAILED' — Output only. The result of the last execution of the plugin instance.
        - `resultMetadata` string — Output only. The result metadata of the last execution of the plugin instance. This will be a string representation of a JSON object and will be available on successful execution.
        - `errorMessage` string — Output only. Error message describing the failure, if any, during the last execution.
        - `endTime` string, google-datetime — Output only. The last execution end time of the plugin instance.
    - `actionId` string — Required. This should map to one of the action id specified in actions_config in the plugin.
    - `curationConfig` GoogleCloudApihubV1CurationConfig — The curation information for this plugin instance.
      - `curationType` 'CURATION_TYPE_UNSPECIFIED' | 'DEFAULT_CURATION_FOR_API_METADATA' | 'CUSTOM_CURATION_FOR_API_METADATA' — Required. The curation type for this plugin instance.
      - `customCuration` GoogleCloudApihubV1CustomCuration — Custom curation information for this plugin instance.
        - `curation` string — Required. The unique name of the curation resource. This will be the name of the curation resource in the format: `projects/{project}/locations/{location}/curations/{curation}`
  - `displayName` string — Required. The display name for this plugin instance. Max length is 255 characters.
  - `additionalConfig` object — Optional. The additional information for this plugin instance corresponding to the additional config template of the plugin. This information will be sent to plugin hosting service on each call to plugin hosted service. The key will be the config_variable_template.display_name to uniquely identify the config variable.
  - `sourceEnvironmentsConfig` object — Optional. The source environment's config present in the gateway instance linked to the plugin instance. The key is the `source_environment` name from the SourceEnvironment message.
  - `sourceProjectId` string — Optional. The source project id of the plugin instance. This will be the id of runtime project in case of Google Cloud based plugins and org id in case of non-Google Cloud based plugins. This field will be a required field for Google provided on-ramp plugins.
  - `authConfig` GoogleCloudApihubV1AuthConfig — AuthConfig represents the authentication information.
    - `authType` 'AUTH_TYPE_UNSPECIFIED' | 'NO_AUTH' | 'GOOGLE_SERVICE_ACCOUNT' | 'USER_PASSWORD' | 'API_KEY' | 'OAUTH2_CLIENT_CREDENTIALS' — Required. The authentication type.
    - `userPasswordConfig` GoogleCloudApihubV1UserPasswordConfig — Parameters to support Username and Password Authentication.
      - `username` string — Required. Username.
      - `password` GoogleCloudApihubV1Secret — Secret provides a reference to entries in Secret Manager.
        - `secretVersion` string — Required. The resource name of the secret version in the format, format as: `projects/*/secrets/*/versions/*`.
    - `oauth2ClientCredentialsConfig` GoogleCloudApihubV1Oauth2ClientCredentialsConfig — Parameters to support Oauth 2.0 client credentials grant authentication. See https://tools.ietf.org/html/rfc6749#section-1.3.4 for more details.
      - `clientId` string — Required. The client identifier.
      - `clientSecret` GoogleCloudApihubV1Secret — Secret provides a reference to entries in Secret Manager.
        - `secretVersion` string — Required. The resource name of the secret version in the format, format as: `projects/*/secrets/*/versions/*`.
    - `googleServiceAccountConfig` 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.
    - `apiKeyConfig` GoogleCloudApihubV1ApiKeyConfig — Config for authentication with API key.
      - `name` string — Required. The parameter name of the API key. E.g. If the API request is "https://example.com/act?api_key=", "api_key" would be the parameter name.
      - `apiKey` GoogleCloudApihubV1Secret — Secret provides a reference to entries in Secret Manager.
        - `secretVersion` string — Required. The resource name of the secret version in the format, format as: `projects/*/secrets/*/versions/*`.
      - `httpElementLocation` 'HTTP_ELEMENT_LOCATION_UNSPECIFIED' | 'QUERY' | 'HEADER' | 'PATH' | 'BODY' | 'COOKIE' — Required. The location of the API key. The default value is QUERY.
  - `state` 'STATE_UNSPECIFIED' | 'CREATING' | 'ACTIVE' | 'APPLYING_CONFIG' | 'ERROR' | 'FAILED' | 'DELETING' — Output only. The current state of the plugin instance (e.g., enabled, disabled, provisioning).
  - `errorMessage` string — Output only. Error message describing the failure, if any, during Create, Delete or ApplyConfig operation corresponding to the plugin instance.This field will only be populated if the plugin instance is in the ERROR or FAILED state.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/apihub.md) · [All operations](https://skmtc.dev/google/apis/apihub/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/apihub/revisions/19473c7df886/schema)
