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

# POST /v1/{+parent}/versions

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

Create an API version for an API resource in the API hub.

## Path parameters

- `parent` string, required

## Query parameters

- `versionId` string

## Request body

- 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.
    - `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.
    - `enumValues` GoogleCloudApihubV1EnumAttributeValues — The attribute values of data type enum.
      - `values` GoogleCloudApihubV1AllowedValue[] — Required. The attribute values in case attribute data type is enum.
        - `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 4-63 characters, and valid characters are /a-z-/.
        - `displayName` string — Required. The display name of the allowed value.
        - `description` string — Optional. The detailed description of the allowed value.
        - `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.
    - `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.
  - `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.
    - `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.
    - `enumValues` GoogleCloudApihubV1EnumAttributeValues — The attribute values of data type enum.
      - `values` GoogleCloudApihubV1AllowedValue[] — Required. The attribute values in case attribute data type is enum.
        - `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 4-63 characters, and valid characters are /a-z-/.
        - `displayName` string — Required. The display name of the allowed value.
        - `description` string — Optional. The detailed description of the allowed value.
        - `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.
    - `attribute` string — Output only. The name of the attribute. Format: projects/{project}/locations/{location}/attributes/{attribute}
  - `sourceMetadata` GoogleCloudApihubV1SourceMetadata[] — Output only. The list of sources and metadata from the sources of the version.
    - `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.
      - `actionId` string — Output only. The id of the plugin instance action.
      - `pluginInstance` string — Output only. The resource name of the source plugin instance. Format is `projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}`
    - `sourceType` 'SOURCE_TYPE_UNSPECIFIED' | 'PLUGIN' — Output only. The type of the source.
  - `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.
    - `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.
    - `enumValues` GoogleCloudApihubV1EnumAttributeValues — The attribute values of data type enum.
      - `values` GoogleCloudApihubV1AllowedValue[] — Required. The attribute values in case attribute data type is enum.
        - `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 4-63 characters, and valid characters are /a-z-/.
        - `displayName` string — Required. The display name of the allowed value.
        - `description` string — Optional. The detailed description of the allowed value.
        - `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.
    - `attribute` string — Output only. The name of the attribute. Format: projects/{project}/locations/{location}/attributes/{attribute}

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