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

# POST /v1/projects/{projectsId}/locations/{locationsId}/reservations/{reservationsId}/assignments

`POST /v1/projects/{projectsId}/locations/{locationsId}/reservations/{reservationsId}/assignments`

## Request

- Base URL: `https://bigqueryreservation.googleapis.com`
- URL: `https://bigqueryreservation.googleapis.com/v1/projects/{projectsId}/locations/{locationsId}/reservations/{reservationsId}/assignments`
- Auth: one of:
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/bigquery`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/bigquery`
  - 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 an assignment object which allows the given project to submit jobs of a certain type using slots from the specified reservation. Currently a resource (project, folder, organization) can only have one assignment per each (job_type, location) combination, and that reservation will be used for all jobs of the matching type. Different assignments can be created on different levels of the projects, folders or organization hierarchy. During query execution, the assignment is looked up at the project, folder and organization levels in that order. The first assignment found is applied to the query. When creating assignments, it does not matter if other assignments exist at higher levels. Example: * The organization `organizationA` contains two projects, `project1` and `project2`. * Assignments for all three entities (`organizationA`, `project1`, and `project2`) could all be created and mapped to the same or different reservations. "None" assignments represent an absence of the assignment. Projects assigned to None use on-demand pricing. To create a "None" assignment, use "none" as a reservation_id in the parent. Example parent: `projects/myproject/locations/US/reservations/none`. Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have 'bigquery.admin' permissions on the project using the reservation and the project that owns this reservation. Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment does not match location of the reservation.

## Path parameters

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

## Query parameters

- `assignmentId` string

## Request body

- Assignment: An assignment allows a project to submit jobs of a certain type using slots from the specified reservation.
  - `assignee` string: Optional. The resource which will use the reservation. E.g. `projects/myproject`, `folders/123`, or `organizations/456`.
  - `condition` Expr: Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" Example (Equality): title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" Example (Logic): title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" Example (Data Manipulation): title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
    - `description` string: Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
    - `expression` string: Textual representation of an expression in Common Expression Language syntax.
    - `location` string: Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
    - `title` string: Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
  - `enableGeminiInBigquery` boolean: Optional. Deprecated: "Gemini in BigQuery" is now available by default for all BigQuery editions and should not be explicitly set. Controls if "Gemini in BigQuery" (https://cloud.google.com/gemini/docs/bigquery/overview) features should be enabled for this reservation assignment.
  - `jobType` 'JOB_TYPE_UNSPECIFIED' | 'PIPELINE' | 'QUERY' | 'ML_EXTERNAL' | 'BACKGROUND' | 'CONTINUOUS' | 'BACKGROUND_CHANGE_DATA_CAPTURE' | 'BACKGROUND_COLUMN_METADATA_INDEX' | 'BACKGROUND_SEARCH_INDEX_REFRESH' | 'AUTOMATIC_MATERIALIZED_VIEW_REFRESH': Optional. Which type of jobs will use the reservation.
  - `name` string: Output only. Name of the resource. E.g.: `projects/myproject/locations/US/reservations/team1-prod/assignments/123`. The assignment_id must only contain lower case alphanumeric characters or dashes and the max length is 64 characters.
  - `precedence` string, int64: Optional. Specifies the priority precedence for this assignment. Used to resolve ambiguity when multiple assignments match a single job. Higher numerical values represent higher priority (e.g., 20 is higher than 10). If unspecified, it defaults to 0. Multiple assignments can share the same precedence, but it is recommended to use unique precedence values for assignments within the same assignee scope.
  - `principal` string: Optional. Represents the principal for this assignment. If not empty, jobs run by this principal utilize the associated reservation. Otherwise, jobs fall back to using the reservation assigned to the project, folder, or organization, in that order. If no reservation is assigned at any of these levels, on-demand capacity is used. The supported formats are: * `principal://goog/subject/USER_EMAIL_ADDRESS` for users, * `principal://iam.googleapis.com/projects/-/serviceAccounts/SA_EMAIL_ADDRESS` for service accounts, * `principal://iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID/subject/SUBJECT_ID` for workload identity pool identities. * The special value `unknown_or_deleted_user` represents principals which cannot be read from the user info service, for example, deleted users.
  - `schedulingPolicy` SchedulingPolicy: The scheduling policy controls how a reservation's resources are distributed.
    - `concurrency` string, int64: Optional. If present and > 0, the reservation will attempt to limit the concurrency of jobs running for any particular project within it to the given value. This feature is not yet generally available.
    - `maxSlots` string, int64: Optional. If present and > 0, the reservation will attempt to limit the slot consumption of queries running for any particular project within it to the given value. This feature is not yet generally available.
  - `state` 'STATE_UNSPECIFIED' | 'PENDING' | 'ACTIVE': Output only. State of the assignment.

## Response `200`

Successful response

- Assignment: An assignment allows a project to submit jobs of a certain type using slots from the specified reservation.
  - `assignee` string: Optional. The resource which will use the reservation. E.g. `projects/myproject`, `folders/123`, or `organizations/456`.
  - `condition` Expr: Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" Example (Equality): title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" Example (Logic): title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" Example (Data Manipulation): title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
    - `description` string: Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
    - `expression` string: Textual representation of an expression in Common Expression Language syntax.
    - `location` string: Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
    - `title` string: Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
  - `enableGeminiInBigquery` boolean: Optional. Deprecated: "Gemini in BigQuery" is now available by default for all BigQuery editions and should not be explicitly set. Controls if "Gemini in BigQuery" (https://cloud.google.com/gemini/docs/bigquery/overview) features should be enabled for this reservation assignment.
  - `jobType` 'JOB_TYPE_UNSPECIFIED' | 'PIPELINE' | 'QUERY' | 'ML_EXTERNAL' | 'BACKGROUND' | 'CONTINUOUS' | 'BACKGROUND_CHANGE_DATA_CAPTURE' | 'BACKGROUND_COLUMN_METADATA_INDEX' | 'BACKGROUND_SEARCH_INDEX_REFRESH' | 'AUTOMATIC_MATERIALIZED_VIEW_REFRESH': Optional. Which type of jobs will use the reservation.
  - `name` string: Output only. Name of the resource. E.g.: `projects/myproject/locations/US/reservations/team1-prod/assignments/123`. The assignment_id must only contain lower case alphanumeric characters or dashes and the max length is 64 characters.
  - `precedence` string, int64: Optional. Specifies the priority precedence for this assignment. Used to resolve ambiguity when multiple assignments match a single job. Higher numerical values represent higher priority (e.g., 20 is higher than 10). If unspecified, it defaults to 0. Multiple assignments can share the same precedence, but it is recommended to use unique precedence values for assignments within the same assignee scope.
  - `principal` string: Optional. Represents the principal for this assignment. If not empty, jobs run by this principal utilize the associated reservation. Otherwise, jobs fall back to using the reservation assigned to the project, folder, or organization, in that order. If no reservation is assigned at any of these levels, on-demand capacity is used. The supported formats are: * `principal://goog/subject/USER_EMAIL_ADDRESS` for users, * `principal://iam.googleapis.com/projects/-/serviceAccounts/SA_EMAIL_ADDRESS` for service accounts, * `principal://iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID/subject/SUBJECT_ID` for workload identity pool identities. * The special value `unknown_or_deleted_user` represents principals which cannot be read from the user info service, for example, deleted users.
  - `schedulingPolicy` SchedulingPolicy: The scheduling policy controls how a reservation's resources are distributed.
    - `concurrency` string, int64: Optional. If present and > 0, the reservation will attempt to limit the concurrency of jobs running for any particular project within it to the given value. This feature is not yet generally available.
    - `maxSlots` string, int64: Optional. If present and > 0, the reservation will attempt to limit the slot consumption of queries running for any particular project within it to the given value. This feature is not yet generally available.
  - `state` 'STATE_UNSPECIFIED' | 'PENDING' | 'ACTIVE': Output only. State of the assignment.

## Changes

- **2026-11-03** `a802531c2771`: 4 info
  - the security scope `https://www.googleapis.com/auth/bigquery` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/bigquery` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was removed from the endpoint's security scheme `Oauth2c`

[Operation history](https://skmtc.dev/google/apis/bigqueryreservation/changes/v1/projects/:projectsId/locations/:locationsId/reservations/:reservationsId/assignments/post.md)

---

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