projects

POST /v1/projects/{projectsId}/locations/{locationsId}/apis

Changed on

Create an API resource in the API hub. Once an API resource is created, versions can be added to it.

Request

  • Base URL
    https://apihub.googleapis.com
  • Auth
    • OAuth 2 and OAuth 2
      Implicithttps://accounts.google.com/o/oauth2/auth
      Scopeshttps://www.googleapis.com/auth/apihub.readwrite
      Authorization codehttps://accounts.google.com/o/oauth2/auth
      Token URLhttps://accounts.google.com/o/oauth2/token
      Scopeshttps://www.googleapis.com/auth/apihub.readwrite
    • or OAuth 2 and OAuth 2
      Implicithttps://accounts.google.com/o/oauth2/auth
      Scopeshttps://www.googleapis.com/auth/cloud-platform
      Authorization codehttps://accounts.google.com/o/oauth2/auth
      Token URLhttps://accounts.google.com/o/oauth2/token
      Scopeshttps://www.googleapis.com/auth/cloud-platform
  • TypeScript
    A function with typed inputs. Its response is checked against the schema.

Path parameters

projectsIdstring required
locationsIdstring required

Query parameters

apiIdstring

Optional. The ID to use for the API resource, which will become the final component of the API's resource name. This field is optional. * If provided, the same will be used. The service will throw an error if the specified id is already used by another API resource in the API hub. * If not provided, a system generated id will be used. This value should be 4-500 characters, and valid characters are /a-z[0-9]-_/.

Request body

attributesobject

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.

createTimestring google-datetime

Output only. The time at which the API resource was created.

descriptionstring

Optional. The description of the API resource.

displayNamestring

Required. The display name of the API resource.

fingerprintstring

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.

namestring

Identifier. The name of the API resource in the API Hub. Format: projects/{project}/locations/{location}/apis/{api}

selectedVersionstring

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}

updateTimestring google-datetime

Output only. The time at which the API resource was last updated.

versionsstring[]

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}

Response

Successful response

attributesobject

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.

createTimestring google-datetime

Output only. The time at which the API resource was created.

descriptionstring

Optional. The description of the API resource.

displayNamestring

Required. The display name of the API resource.

fingerprintstring

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.

namestring

Identifier. The name of the API resource in the API Hub. Format: projects/{project}/locations/{location}/apis/{api}

selectedVersionstring

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}

updateTimestring google-datetime

Output only. The time at which the API resource was last updated.

versionsstring[]

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}

Changes

    • info

      the security scope https://www.googleapis.com/auth/apihub.readwrite was added to the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/apihub.readwrite was added to the endpoint's security scheme Oauth2c

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform was removed from the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform was removed from the endpoint's security scheme Oauth2c