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

# POST /v1/{+location}:collectApiData

`POST /v1/{+location}:collectApiData`

Collect API data from a source and push it to Hub's collect layer.

## Path parameters

- `location` string, required

## Request body

- GoogleCloudApihubV1CollectApiDataRequest — The CollectApiData method's request.
  - `actionId` string — Required. The action ID to be used for collecting the API data. This should map to one of the action IDs specified in action configs in the plugin.
  - `pluginInstance` string — Required. The plugin instance collecting the API data. Format: `projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}`.
  - `apiData` GoogleCloudApihubV1ApiData — The API data to be collected.
    - `apiMetadataList` GoogleCloudApihubV1ApiMetadataList — The message to hold repeated API metadata.
      - `apiMetadata` GoogleCloudApihubV1APIMetadata[] — Required. The list of API metadata.
        - `api` GoogleCloudApihubV1Api — An API resource in the API Hub.
          - `owner` GoogleCloudApihubV1Owner — Owner details.
            - `displayName` string — Optional. The name of the owner.
            - `email` string — Required. The email of the owner.
          - `fingerprint` string — Optional. Fingerprint of the API resource. This must be unique for each API resource. It can neither be unset nor be updated to an existing fingerprint of another API resource.
          - `selectedVersion` string — Optional. The selected version for an API resource. This can be used when special handling is needed on client side for particular version of the API. Format is `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
          - `apiTechnicalRequirements` GoogleCloudApihubV1AttributeValues — The attribute values associated with resource.
            - `stringValues` GoogleCloudApihubV1StringAttributeValues — The attribute values of data type string or JSON.
              - …
            - `uriValues` GoogleCloudApihubV1StringAttributeValues — The attribute values of data type string or JSON.
              - …
            - `enumValues` GoogleCloudApihubV1EnumAttributeValues — The attribute values of data type enum.
              - …
            - `jsonValues` GoogleCloudApihubV1StringAttributeValues — The attribute values of data type string or JSON.
              - …
            - `attribute` string — Output only. The name of the attribute. Format: projects/{project}/locations/{location}/attributes/{attribute}
          - `documentation` GoogleCloudApihubV1Documentation — Documentation details.
            - `externalUri` string — Optional. The uri of the externally hosted documentation.
          - `apiRequirements` GoogleCloudApihubV1AttributeValues — The attribute values associated with resource.
            - `stringValues` GoogleCloudApihubV1StringAttributeValues — The attribute values of data type string or JSON.
              - …
            - `uriValues` GoogleCloudApihubV1StringAttributeValues — The attribute values of data type string or JSON.
              - …
            - `enumValues` GoogleCloudApihubV1EnumAttributeValues — The attribute values of data type enum.
              - …
            - `jsonValues` GoogleCloudApihubV1StringAttributeValues — The attribute values of data type string or JSON.
              - …
            - `attribute` string — Output only. The name of the attribute. Format: projects/{project}/locations/{location}/attributes/{attribute}
          - `maturityLevel` GoogleCloudApihubV1AttributeValues — The attribute values associated with resource.
            - `stringValues` GoogleCloudApihubV1StringAttributeValues — The attribute values of data type string or JSON.
              - …
            - `uriValues` GoogleCloudApihubV1StringAttributeValues — The attribute values of data type string or JSON.
              - …
            - `enumValues` GoogleCloudApihubV1EnumAttributeValues — The attribute values of data type enum.
              - …
            - `jsonValues` GoogleCloudApihubV1StringAttributeValues — The attribute values of data type string or JSON.
              - …
            - `attribute` string — Output only. The name of the attribute. Format: projects/{project}/locations/{location}/attributes/{attribute}
          - `displayName` string — Required. The display name of the API resource.
          - `team` GoogleCloudApihubV1AttributeValues — The attribute values associated with resource.
            - `stringValues` GoogleCloudApihubV1StringAttributeValues — The attribute values of data type string or JSON.
              - …
            - `uriValues` GoogleCloudApihubV1StringAttributeValues — The attribute values of data type string or JSON.
              - …
            - `enumValues` GoogleCloudApihubV1EnumAttributeValues — The attribute values of data type enum.
              - …
            - `jsonValues` GoogleCloudApihubV1StringAttributeValues — The attribute values of data type string or JSON.
              - …
            - `attribute` string — Output only. The name of the attribute. Format: projects/{project}/locations/{location}/attributes/{attribute}
          - `name` string — Identifier. The name of the API resource in the API Hub. Format: `projects/{project}/locations/{location}/apis/{api}`
          - `targetUser` GoogleCloudApihubV1AttributeValues — The attribute values associated with resource.
            - `stringValues` GoogleCloudApihubV1StringAttributeValues — The attribute values of data type string or JSON.
              - …
            - `uriValues` GoogleCloudApihubV1StringAttributeValues — The attribute values of data type string or JSON.
              - …
            - `enumValues` GoogleCloudApihubV1EnumAttributeValues — The attribute values of data type enum.
              - …
            - `jsonValues` GoogleCloudApihubV1StringAttributeValues — The attribute values of data type string or JSON.
              - …
            - `attribute` string — Output only. The name of the attribute. Format: projects/{project}/locations/{location}/attributes/{attribute}
          - `apiFunctionalRequirements` GoogleCloudApihubV1AttributeValues — The attribute values associated with resource.
            - `stringValues` GoogleCloudApihubV1StringAttributeValues — The attribute values of data type string or JSON.
              - …
            - `uriValues` GoogleCloudApihubV1StringAttributeValues — The attribute values of data type string or JSON.
              - …
            - `enumValues` GoogleCloudApihubV1EnumAttributeValues — The attribute values of data type enum.
              - …
            - `jsonValues` GoogleCloudApihubV1StringAttributeValues — The attribute values of data type string or JSON.
              - …
            - `attribute` string — Output only. The name of the attribute. Format: projects/{project}/locations/{location}/attributes/{attribute}
          - `attributes` object — Optional. The list of user defined attributes associated with the API resource. The key is the attribute name. It will be of the format: `projects/{project}/locations/{location}/attributes/{attribute}`. The value is the attribute values associated with the resource.
          - `description` string — Optional. The description of the API resource.
          - `createTime` string, google-datetime — Output only. The time at which the API resource was created.
          - `updateTime` string, google-datetime — Output only. The time at which the API resource was last updated.
          - `sourceMetadata` GoogleCloudApihubV1SourceMetadata[] — Output only. The list of sources and metadata from the sources of the API resource.
            - `originalResourceUpdateTime` string, google-datetime — Output only. The time at which the resource was last updated at the source.
            - `originalResourceId` string — Output only. The unique identifier of the resource at the source.
            - `originalResourceCreateTime` string, google-datetime — Output only. The time at which the resource was created at the source.
            - `pluginInstanceActionSource` GoogleCloudApihubV1PluginInstanceActionSource — PluginInstanceActionSource represents the plugin instance action source.
              - …
            - `sourceType` 'SOURCE_TYPE_UNSPECIFIED' | 'PLUGIN' — Output only. The type of the source.
          - `versions` string[] — Output only. The list of versions present in an API resource. Note: An API resource can be associated with more than 1 version. Format is `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
          - `apiStyle` GoogleCloudApihubV1AttributeValues — The attribute values associated with resource.
            - `stringValues` GoogleCloudApihubV1StringAttributeValues — The attribute values of data type string or JSON.
              - …
            - `uriValues` GoogleCloudApihubV1StringAttributeValues — The attribute values of data type string or JSON.
              - …
            - `enumValues` GoogleCloudApihubV1EnumAttributeValues — The attribute values of data type enum.
              - …
            - `jsonValues` GoogleCloudApihubV1StringAttributeValues — The attribute values of data type string or JSON.
              - …
            - `attribute` string — Output only. The name of the attribute. Format: projects/{project}/locations/{location}/attributes/{attribute}
          - `businessUnit` GoogleCloudApihubV1AttributeValues — The attribute values associated with resource.
            - `stringValues` GoogleCloudApihubV1StringAttributeValues — The attribute values of data type string or JSON.
              - …
            - `uriValues` GoogleCloudApihubV1StringAttributeValues — The attribute values of data type string or JSON.
              - …
            - `enumValues` GoogleCloudApihubV1EnumAttributeValues — The attribute values of data type enum.
              - …
            - `jsonValues` GoogleCloudApihubV1StringAttributeValues — The attribute values of data type string or JSON.
              - …
            - `attribute` string — Output only. The name of the attribute. Format: projects/{project}/locations/{location}/attributes/{attribute}
        - `originalUpdateTime` string, google-datetime — Required. Timestamp indicating when the API was last updated at the source.
        - `originalCreateTime` string, google-datetime — Optional. Timestamp indicating when the API was created at the source.
        - `originalId` string — Optional. The unique identifier of the API in the system where it was originally created.
        - `versions` GoogleCloudApihubV1VersionMetadata[] — Optional. The list of versions present in an API resource.
          - `specs` GoogleCloudApihubV1SpecMetadata[] — Optional. The specs associated with this version. Note that an API version can be associated with multiple specs.
            - `spec` GoogleCloudApihubV1Spec — Represents a spec associated with an API version in the API Hub. Note that specs of various types can be uploaded, however parsing of details is supported for OpenAPI spec currently.
              - …
            - `originalCreateTime` string, google-datetime — Optional. Timestamp indicating when the spec was created at the source.
            - `originalId` string — Optional. The unique identifier of the spec in the system where it was originally created.
            - `originalUpdateTime` string, google-datetime — Required. Timestamp indicating when the spec was last updated at the source.
          - `originalId` string — Optional. The unique identifier of the version in the system where it was originally created.
          - `version` GoogleCloudApihubV1Version — Represents a version of the API resource in API hub. This is also referred to as the API version.
            - `displayName` string — Required. The display name of the version.
            - `lifecycle` GoogleCloudApihubV1AttributeValues — The attribute values associated with resource.
              - …
            - `documentation` GoogleCloudApihubV1Documentation — Documentation details.
              - …
            - `specs` string[] — Output only. The specs associated with this version. Note that an API version can be associated with multiple specs. Format is `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
            - `apiOperations` string[] — Output only. The operations contained in the API version. These operations will be added to the version when a new spec is added or when an existing spec is updated. Format is `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
            - `selectedDeployment` string — Optional. The selected deployment for a Version resource. This can be used when special handling is needed on client side for a particular deployment linked to the version. Format is `projects/{project}/locations/{location}/deployments/{deployment}`
            - `definitions` string[] — Output only. The definitions contained in the API version. These definitions will be added to the version when a new spec is added or when an existing spec is updated. Format is `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
            - `compliance` GoogleCloudApihubV1AttributeValues — The attribute values associated with resource.
              - …
            - `sourceMetadata` GoogleCloudApihubV1SourceMetadata[] — Output only. The list of sources and metadata from the sources of the version.
              - …
            - `createTime` string, google-datetime — Output only. The time at which the version was created.
            - `deployments` string[] — Optional. The deployments linked to this API version. Note: A particular API version could be deployed to multiple deployments (for dev deployment, UAT deployment, etc) Format is `projects/{project}/locations/{location}/deployments/{deployment}`
            - `updateTime` string, google-datetime — Output only. The time at which the version was last updated.
            - `name` string — Identifier. The name of the version. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
            - `attributes` object — Optional. The list of user defined attributes associated with the Version resource. The key is the attribute name. It will be of the format: `projects/{project}/locations/{location}/attributes/{attribute}`. The value is the attribute values associated with the resource.
            - `description` string — Optional. The description of the version.
            - `accreditation` GoogleCloudApihubV1AttributeValues — The attribute values associated with resource.
              - …
          - `deployments` GoogleCloudApihubV1DeploymentMetadata[] — Optional. The deployments linked to this API version. Note: A particular API version could be deployed to multiple deployments (for dev deployment, UAT deployment, etc.)
            - `originalId` string — Optional. The unique identifier of the deployment in the system where it was originally created.
            - `originalUpdateTime` string, google-datetime — Required. Timestamp indicating when the deployment was last updated at the source.
            - `originalCreateTime` string, google-datetime — Optional. Timestamp indicating when the deployment was created at the source.
            - `deployment` GoogleCloudApihubV1Deployment — Details of the deployment where APIs are hosted. A deployment could represent an Apigee proxy, API gateway, other Google Cloud services or non-Google Cloud services as well. A deployment entity is a root level entity in the API hub and exists independent of any API.
              - …
          - `originalUpdateTime` string, google-datetime — Required. Timestamp indicating when the version was last updated at the source.
          - `originalCreateTime` string, google-datetime — Optional. Timestamp indicating when the version was created at the source.
  - `collectionType` 'COLLECTION_TYPE_UNSPECIFIED' | 'COLLECTION_TYPE_UPSERT' | 'COLLECTION_TYPE_DELETE' — Required. The type of collection. Applies to all entries in api_data.

## 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)
