---
title: "POST /v1/projects/{projectsId}/locations/{locationsId}/extensionBindings"
method: POST
path: "/v1/projects/{projectsId}/locations/{locationsId}/extensionBindings"
tags: ["projects"]
---

# POST /v1/projects/{projectsId}/locations/{locationsId}/extensionBindings

`POST /v1/projects/{projectsId}/locations/{locationsId}/extensionBindings`

## Request

- Base URL: `https://networkservices.googleapis.com`
- URL: `https://networkservices.googleapis.com/v1/projects/{projectsId}/locations/{locationsId}/extensionBindings`
- Auth: OAuth 2 and OAuth 2
  - Implicit: `https://accounts.google.com/o/oauth2/auth`
  - Scopes: `https://www.googleapis.com/auth/cloud-platform`
  - Authorization code: `https://accounts.google.com/o/oauth2/auth`
  - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform`

Creates a new `ExtensionBinding` resource in a given project and location.

## Path parameters

- `projectsId` string, required
- `locationsId` string, required

## Query parameters

- `$.xgafv` '1' | '2'
- `access_token` string
- `alt` 'json' | 'media' | 'proto'
- `callback` string
- `fields` string
- `key` string
- `oauth_token` string
- `prettyPrint` boolean
- `quotaUser` string
- `uploadType` string
- `upload_protocol` string
- `extensionBindingId` string

## Request body

- ExtensionBinding: `ExtensionBinding` is a resource representing the attachment of an extension to a service.
  - `createTime` string, google-datetime: Output only. The timestamp when the resource was created.
  - `description` string: Optional. A human-readable description of the resource.
  - `etag` string: Optional. Etag of the resource. If provided, it must match the server's etag. If the provided etag does not match the server's etag, the request will fail with a 409 ABORTED error.
  - `failOpen` boolean: Optional. Determines the behavior of the extension binding when the call to the extension fails or times out. Default value is `false`. When set to `true`, failures of the extension are silently ignored.
  - `labels` object: Optional. Set of labels associated with the `ExtensionBinding` resource. The format must comply with [the following requirements](https://cloud.google.com/compute/docs/labeling-resources#requirements).
  - `matchConditions` ExtensionBindingMatchCondition[]: Optional. A list of match conditions to evaluate against the incoming request. The extension is invoked if the request matches at least one condition, or if no match conditions are specified. A request matches a condition only if it matches every field that is set in that condition. Limited to 5 conditions.
    - `to` ExtensionBindingMatchConditionTo: Describes properties of one or more destinations of a request.
      - `destination` ExtensionBindingMatchConditionToDestination: Describes properties of a single destination.
        - `headerSet` ExtensionBindingMatchConditionToDestinationHeaderSet: Describes a set of HTTP headers to match against.
          - `headers` ExtensionBindingMatchConditionHeaderMatch[]: Required. A list of HTTP headers to match against. If multiple header matches are provided, they are evaluated as an AND, meaning that all header matches must match for the request to match. Limited to 10 headers.
            - `name` string: Required. Specifies the name of the header in the request.
            - `value` ExtensionBindingMatchConditionStringMatch: Specifies matching logic for string values.
              - …
        - `hosts` ExtensionBindingMatchConditionStringMatch[]: Optional. A list of HTTP hosts to match against. Limited to 10 hosts. If not specified, any host is allowed. If specified, a match occurs if any of the hosts matches the host value in the request.
          - `contains` string: Optional. The input string must contain the substring specified here. An empty substring is not allowed. Examples: * `abc` matches the value `xyz.abc.def`.
          - `exact` string: Optional. The input string must match exactly the string specified here. Examples: * `abc` matches only the value `abc`.
          - `ignoreCase` boolean: Optional. If true, the `exact`, `prefix`, `suffix`, or `contains` match is case insensitive. For example, the matcher `data` matches both `Data` and `data` when set to true.
          - `prefix` string: Optional. The input string must have the prefix specified here. An empty prefix is not allowed. Examples: * `abc` matches the value `abc.xyz`.
          - `suffix` string: Optional. The input string must have the suffix specified here. An empty suffix is not allowed. Examples: * `abc` matches the value `xyz.abc`.
        - `paths` ExtensionBindingMatchConditionStringMatch[]: Optional. A list of paths to match against. Limited to 10 paths. If not specified, any path is allowed. Note that this path match includes the query parameters. For gRPC services, this should be a fully qualified name of the form `/package.service/method`.
          - `contains` string: Optional. The input string must contain the substring specified here. An empty substring is not allowed. Examples: * `abc` matches the value `xyz.abc.def`.
          - `exact` string: Optional. The input string must match exactly the string specified here. Examples: * `abc` matches only the value `abc`.
          - `ignoreCase` boolean: Optional. If true, the `exact`, `prefix`, `suffix`, or `contains` match is case insensitive. For example, the matcher `data` matches both `Data` and `data` when set to true.
          - `prefix` string: Optional. The input string must have the prefix specified here. An empty prefix is not allowed. Examples: * `abc` matches the value `abc.xyz`.
          - `suffix` string: Optional. The input string must have the suffix specified here. An empty suffix is not allowed. Examples: * `abc` matches the value `xyz.abc`.
        - `resources` ExtensionBindingMatchConditionStringMatch[]: Optional. A list of non-empty strings whose value is matched against the resource to which a request is sent (for example, an `Agent` in `AiApplication`). If not specified, any resource is allowed. If specified, a match occurs if any of the resources matches the resource value in the request. Limited to 5 resources. When matching against resources in the Agent Registry, use the URNs of the registry resources.
          - `contains` string: Optional. The input string must contain the substring specified here. An empty substring is not allowed. Examples: * `abc` matches the value `xyz.abc.def`.
          - `exact` string: Optional. The input string must match exactly the string specified here. Examples: * `abc` matches only the value `abc`.
          - `ignoreCase` boolean: Optional. If true, the `exact`, `prefix`, `suffix`, or `contains` match is case insensitive. For example, the matcher `data` matches both `Data` and `data` when set to true.
          - `prefix` string: Optional. The input string must have the prefix specified here. An empty prefix is not allowed. Examples: * `abc` matches the value `abc.xyz`.
          - `suffix` string: Optional. The input string must have the suffix specified here. An empty suffix is not allowed. Examples: * `abc` matches the value `xyz.abc`.
      - `notDestination` ExtensionBindingMatchConditionToDestination: Describes properties of a single destination.
        - `headerSet` ExtensionBindingMatchConditionToDestinationHeaderSet: Describes a set of HTTP headers to match against.
          - `headers` ExtensionBindingMatchConditionHeaderMatch[]: Required. A list of HTTP headers to match against. If multiple header matches are provided, they are evaluated as an AND, meaning that all header matches must match for the request to match. Limited to 10 headers.
            - `name` string: Required. Specifies the name of the header in the request.
            - `value` ExtensionBindingMatchConditionStringMatch: Specifies matching logic for string values.
              - …
        - `hosts` ExtensionBindingMatchConditionStringMatch[]: Optional. A list of HTTP hosts to match against. Limited to 10 hosts. If not specified, any host is allowed. If specified, a match occurs if any of the hosts matches the host value in the request.
          - `contains` string: Optional. The input string must contain the substring specified here. An empty substring is not allowed. Examples: * `abc` matches the value `xyz.abc.def`.
          - `exact` string: Optional. The input string must match exactly the string specified here. Examples: * `abc` matches only the value `abc`.
          - `ignoreCase` boolean: Optional. If true, the `exact`, `prefix`, `suffix`, or `contains` match is case insensitive. For example, the matcher `data` matches both `Data` and `data` when set to true.
          - `prefix` string: Optional. The input string must have the prefix specified here. An empty prefix is not allowed. Examples: * `abc` matches the value `abc.xyz`.
          - `suffix` string: Optional. The input string must have the suffix specified here. An empty suffix is not allowed. Examples: * `abc` matches the value `xyz.abc`.
        - `paths` ExtensionBindingMatchConditionStringMatch[]: Optional. A list of paths to match against. Limited to 10 paths. If not specified, any path is allowed. Note that this path match includes the query parameters. For gRPC services, this should be a fully qualified name of the form `/package.service/method`.
          - `contains` string: Optional. The input string must contain the substring specified here. An empty substring is not allowed. Examples: * `abc` matches the value `xyz.abc.def`.
          - `exact` string: Optional. The input string must match exactly the string specified here. Examples: * `abc` matches only the value `abc`.
          - `ignoreCase` boolean: Optional. If true, the `exact`, `prefix`, `suffix`, or `contains` match is case insensitive. For example, the matcher `data` matches both `Data` and `data` when set to true.
          - `prefix` string: Optional. The input string must have the prefix specified here. An empty prefix is not allowed. Examples: * `abc` matches the value `abc.xyz`.
          - `suffix` string: Optional. The input string must have the suffix specified here. An empty suffix is not allowed. Examples: * `abc` matches the value `xyz.abc`.
        - `resources` ExtensionBindingMatchConditionStringMatch[]: Optional. A list of non-empty strings whose value is matched against the resource to which a request is sent (for example, an `Agent` in `AiApplication`). If not specified, any resource is allowed. If specified, a match occurs if any of the resources matches the resource value in the request. Limited to 5 resources. When matching against resources in the Agent Registry, use the URNs of the registry resources.
          - `contains` string: Optional. The input string must contain the substring specified here. An empty substring is not allowed. Examples: * `abc` matches the value `xyz.abc.def`.
          - `exact` string: Optional. The input string must match exactly the string specified here. Examples: * `abc` matches only the value `abc`.
          - `ignoreCase` boolean: Optional. If true, the `exact`, `prefix`, `suffix`, or `contains` match is case insensitive. For example, the matcher `data` matches both `Data` and `data` when set to true.
          - `prefix` string: Optional. The input string must have the prefix specified here. An empty prefix is not allowed. Examples: * `abc` matches the value `abc.xyz`.
          - `suffix` string: Optional. The input string must have the suffix specified here. An empty suffix is not allowed. Examples: * `abc` matches the value `xyz.abc`.
  - `name` string: Identifier. Name of the `ExtensionBinding` resource in the following format: `projects/{project}/locations/{location}/extensionBindings/{extension_binding}`.
  - `priority` integer: Optional. This field is not supported.
  - `producerExtension` string: Required. The name of the extension that this binding should attach to target resources. Format: * For Google-provided extensions, specify the service endpoint, for example `modelarmor.us-central1.rep.googleapis.com`.
  - `producerMetadata` object: Optional. Additional metadata that should be passed to the attached extension with each request. This field is subject to the following limitations: * The total size of the metadata must be less than 1 KiB. * The total number of keys must be less than 16. * The length of each key must be less than 64 characters. * The length of each value must be less than 1024 characters.
  - `target` ExtensionBindingTarget: Specifies a list of targets to which this `ExtensionBinding` should attach.
    - `resources` string[]: Optional. The references to the target resources to which this binding should attach. Exactly one of `resources` or `scope` must be set. For AI Application resources, specify the full resource name in the format: `projects/{project}/locations/{location}/applications/{application}`. Limited to 1 resource.
    - `scope` ExtensionBindingTargetScope: Specifies the scope of resources to which this binding should attach.
      - `parent` string: Required. The parent resource that defines the scope, in the format `projects/{project_number}`. When the scope is a project, the binding applies to the resources that meet all of the following conditions: * The resource belongs to the specified project. * The resource is in the same location as the `ExtensionBinding`. * The resource type is listed in `resource_types`.
      - `resourceTypes` string[]: Required. The types of resources to which the binding should attach. Limited to 1 resource type.
  - `updateTime` string, google-datetime: Output only. The timestamp when the resource was updated.

## Response `200`

Successful response

- Operation: This resource represents a long-running operation that is the result of a network API call.
  - `done` boolean: If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
  - `error` Status: The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
    - `code` integer: The status code, which should be an enum value of google.rpc.Code.
    - `details` object[]: A list of messages that carry the error details. There is a common set of message types for APIs to use.
    - `message` string: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
  - `metadata` object: Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
  - `name` string: The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
  - `response` object: The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.

---

[API](https://skmtc.dev/google/apis/networkservices.md) - [All operations](https://skmtc.dev/google/apis/networkservices/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/networkservices/revisions/f0e603cd2d5d?raw)
