gcloud apihub apis versions create (VERSION : --api=API) --display-name=DISPLAY_NAME [--attributes=[ATTRIBUTES,…]] [--deployments=[DEPLOYMENTS,…]] [--description=DESCRIPTION] [--documentation-external-uri=DOCUMENTATION_EXTERNAL_URI] [--location=LOCATION] [--selected-deployment=SELECTED_DEPLOYMENT] [--accreditation-enum-values=[description=DESCRIPTION],[displayName=DISPLAYNAME],[id=ID],[immutable=IMMUTABLE] | --accreditation-json-values=[ACCREDITATION_JSON_VALUES,…] | --accreditation-string-values=[ACCREDITATION_STRING_VALUES,…] | --accreditation-uri-values=[ACCREDITATION_URI_VALUES,…]] [--compliance-enum-values=[description=DESCRIPTION],[displayName=DISPLAYNAME],[id=ID],[immutable=IMMUTABLE] | --compliance-json-values=[COMPLIANCE_JSON_VALUES,…] | --compliance-string-values=[COMPLIANCE_STRING_VALUES,…] | --compliance-uri-values=[COMPLIANCE_URI_VALUES,…]] [--lifecycle-enum-values=[description=DESCRIPTION],[displayName=DISPLAYNAME],[id=ID],[immutable=IMMUTABLE] | --lifecycle-json-values=[LIFECYCLE_JSON_VALUES,…] | --lifecycle-string-values=[LIFECYCLE_STRING_VALUES,…] | --lifecycle-uri-values=[LIFECYCLE_URI_VALUES,…]] [GCLOUD_WIDE_FLAG …]
my-version for API
my-api, run:
gcloud apihub apis versions create --version=my-version --api=my-api --display-name="My Version" --project=my-project --location=us-central1
Format:
projects/{project}/locations/{location}/apis/{api}/versions/{version}
The arguments in this group can be used to specify the attributes of this
resource. (NOTE) Some attributes are not given arguments in this group but can
be set in other ways.
To set the project attribute:
version on the command line with a fully
specified name;
--project on the command line;
core/project.
To set the location attribute:
version on the command line with a fully
specified name;
--location on the command line.
VERSION
To set the version attribute:
version on the command line.
--api=APIapi attribute:
version on the command line with a fully
specified name;
--api on the command line.
--display-name=DISPLAY_NAME--attributes=[ATTRIBUTES,…]projects/{project}/locations/{location}/attributes/{attribute}. The
value is the attribute values associated with the resource.
KEYKEY value.
VALUEVALUE value.
enumValuesvaluesdescriptiondisplayNameidThis value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.
immutablejsonValuesvaluesstringValuesvaluesuriValuesvaluesShorthand Example:
--attributes=string={enumValues={values=[{description=string,displayName=string,id=string,immutable=boolean}]},jsonValues={values=[string]},stringValues={values=[string]},uriValues={values=[string]}}
JSON Example:
--attributes='{"string": {"enumValues": {"values": [{"description": "string", "displayName": "string", "id": "string", "immutable": boolean}]}, "jsonValues": {"values": ["string"]}, "stringValues": {"values": ["string"]}, "uriValues": {"values": ["string"]}}}'
File Example:
--attributes=path_to_file.(yaml|json)
projects/{project}/locations/{location}/deployments/{deployment}
This represents a Cloud resource. (NOTE) Some attributes are not given arguments
in this group but can be set in other ways.
To set the project attribute:
--deployments on the command line with a fully
specified name;
--project on the command line;
core/project.
location attribute:
--deployments on the command line with a fully
specified name;
--location on the command line.
--deployments=[DEPLOYMENTS,…]deployment attribute:
--deployments on the command line.
--description=DESCRIPTION--documentation-external-uri=DOCUMENTATION_EXTERNAL_URI--location=LOCATIONprojects/{project}/locations/{location}/deployments/{deployment}
This represents a Cloud resource. (NOTE) Some attributes are not given arguments
in this group but can be set in other ways.
To set the project attribute:
--selected-deployment on the command line with
a fully specified name;
--project on the command line;
core/project.
location attribute:
--selected-deployment on the command line with
a fully specified name;
--location on the command line.
--selected-deployment=SELECTED_DEPLOYMENTdeployment attribute:
--selected-deployment on the command line.
--accreditation-enum-values=[description=DESCRIPTION],[displayName=DISPLAYNAME],[id=ID],[immutable=IMMUTABLE]descriptiondisplayNameidThis value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.
immutableShorthand Example:
--accreditation-enum-values=description=string,displayName=string,id=string,immutable=boolean --accreditation-enum-values=description=string,displayName=string,id=string,immutable=boolean
JSON Example:
--accreditation-enum-values='[{"description": "string", "displayName": "string", "id": "string", "immutable": boolean}]'
File Example:
--accreditation-enum-values=path_to_file.(yaml|json)
--accreditation-json-values=[ACCREDITATION_JSON_VALUES,…]--accreditation-string-values=[ACCREDITATION_STRING_VALUES,…]--accreditation-uri-values=[ACCREDITATION_URI_VALUES,…]--compliance-enum-values=[description=DESCRIPTION],[displayName=DISPLAYNAME],[id=ID],[immutable=IMMUTABLE]descriptiondisplayNameidThis value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.
immutableShorthand Example:
--compliance-enum-values=description=string,displayName=string,id=string,immutable=boolean --compliance-enum-values=description=string,displayName=string,id=string,immutable=boolean
JSON Example:
--compliance-enum-values='[{"description": "string", "displayName": "string", "id": "string", "immutable": boolean}]'
File Example:
--compliance-enum-values=path_to_file.(yaml|json)
--compliance-json-values=[COMPLIANCE_JSON_VALUES,…]--compliance-string-values=[COMPLIANCE_STRING_VALUES,…]--compliance-uri-values=[COMPLIANCE_URI_VALUES,…]--lifecycle-enum-values=[description=DESCRIPTION],[displayName=DISPLAYNAME],[id=ID],[immutable=IMMUTABLE]descriptiondisplayNameidThis value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.
immutableShorthand Example:
--lifecycle-enum-values=description=string,displayName=string,id=string,immutable=boolean --lifecycle-enum-values=description=string,displayName=string,id=string,immutable=boolean
JSON Example:
--lifecycle-enum-values='[{"description": "string", "displayName": "string", "id": "string", "immutable": boolean}]'
File Example:
--lifecycle-enum-values=path_to_file.(yaml|json)
--lifecycle-json-values=[LIFECYCLE_JSON_VALUES,…]--lifecycle-string-values=[LIFECYCLE_STRING_VALUES,…]--lifecycle-uri-values=[LIFECYCLE_URI_VALUES,…]--access-token-file,
--account, --billing-project,
--configuration,
--flags-file,
--flatten, --format, --help, --impersonate-service-account,
--log-http,
--project, --quiet, --trace-token, --user-output-enabled,
--verbosity.
Run $ gcloud help for details.
apihub/v1 API. The full documentation for
this API can be found at: https://cloud.google.com/apigee/docs/api-hub/what-is-api-hub
gcloud alpha apihub apis versions create
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-05-27 UTC.