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

# POST /v1/{+parent}/operations

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

Create an apiOperation in an API version. An apiOperation can be created only if the version has no apiOperations which were created by parsing a spec.

## Path parameters

- `parent` string, required

## Query parameters

- `apiOperationId` string

## Request body

- GoogleCloudApihubV1ApiOperation — Represents an operation contained in an API version in the API Hub. An operation is added/updated/deleted in an API version when a new spec is added or an existing spec is updated/deleted in a version. Currently, an operation will be created only corresponding to OpenAPI spec as parsing is supported for OpenAPI spec. Alternatively operations can be managed via create,update and delete APIs, creation of apiOperation can be possible only for version with no parsed operations and update/delete can be possible only for operations created via create API.
  - `updateTime` string, google-datetime — Output only. The time at which the operation was last updated.
  - `createTime` string, google-datetime — Output only. The time at which the operation was created.
  - `details` GoogleCloudApihubV1OperationDetails — The operation details parsed from the spec.
    - `httpOperation` GoogleCloudApihubV1HttpOperation — The HTTP Operation.
      - `path` GoogleCloudApihubV1Path — The path details derived from the spec.
        - `path` string — Optional. Complete path relative to server endpoint. Note: Even though this field is optional, it is required for CreateApiOperation API and we will fail the request if not provided.
        - `description` string — Optional. A short description for the path applicable to all operations.
      - `method` 'METHOD_UNSPECIFIED' | 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH' | 'TRACE' — Optional. Operation method Note: Even though this field is optional, it is required for CreateApiOperation API and we will fail the request if not provided.
    - `deprecated` boolean — Optional. For OpenAPI spec, this will be set if `operation.deprecated`is marked as `true` in the spec.
    - `description` string — Optional. Description of the operation behavior. For OpenAPI spec, this will map to `operation.description` in the spec, in case description is empty, `operation.summary` will be used.
    - `documentation` GoogleCloudApihubV1Documentation — Documentation details.
      - `externalUri` string — Optional. The uri of the externally hosted documentation.
    - `mcpTool` GoogleCloudApihubV1McpTool — Details describing an MCP Tool.
      - `description` string — Optional. Description of what the tool does.
      - `name` string — Required. The name of the tool, unique within its parent scope (version).
      - `outputSchema` GoogleCloudApihubV1OperationSchema — The operation schema needed for an operation.
        - `jsonSchema` object — The JSON schema. Only valid JSON is accepted but semantic validation of schema is not supported right now.
      - `title` string — Optional. Optional title for the tool.
      - `annotations` GoogleCloudApihubV1ToolAnnotations — Annotations for a Tool.
        - `readOnlyHint` boolean — Optional. Hint indicating if the tool is read-only.
        - `additionalHints` object — Optional. Additional hints which may help tools and not covered in defaults.
        - `destructiveHint` boolean — Optional. Hint indicating if the tool may have destructive side effects.
        - `idempotentHint` boolean — Optional. Hint indicating if the tool is idempotent.
        - `title` string — Optional. A human-readable title for the tool (if different from Tool.title).
        - `openWorldHint` boolean — Optional. Hint indicating if the tool interacts with the open world (e.g., internet).
      - `inputSchema` GoogleCloudApihubV1OperationSchema — The operation schema needed for an operation.
        - `jsonSchema` object — The JSON schema. Only valid JSON is accepted but semantic validation of schema is not supported right now.
  - `attributes` object — Optional. The list of user defined attributes associated with the API operation 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.
  - `name` string — Identifier. The name of the operation. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
  - `spec` string — Output only. The name of the spec will be of the format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` Note:The name of the spec will be empty if the operation is created via CreateApiOperation API.
  - `sourceMetadata` GoogleCloudApihubV1SourceMetadata[] — Output only. The list of sources and metadata from the sources of the API operation.
    - `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.

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