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 (jobType, 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 reservationId 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.
HTTP request
POST https://bigqueryreservation.googleapis.com/v1/{parent=projects/*/locations/*/reservations/*}/assignments
Required. The parent resource name of the assignment E.g. projects/myproject/locations/US/reservations/team1-prod
Authorization requires the following IAM permission on the specified resource parent:
bigquery.reservationAssignments.create
Query parameters
Parameters
assignmentId
string
The optional assignment ID. Assignment name will be generated automatically if this field is empty. This field must only contain lower case alphanumeric characters or dashes. Max length is 64 characters.
Request body
The request body contains an instance of Assignment.
Response body
If successful, the response body contains a newly created instance of Assignment.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-02 UTC."],[[["\u003cp\u003eThis API endpoint creates an assignment object, enabling a specified project to submit jobs of a particular type using slots from a designated reservation.\u003c/p\u003e\n"],["\u003cp\u003eA resource (project, folder, or organization) can have only one assignment per each (jobType, location) combination, which will be applied to all matching jobs.\u003c/p\u003e\n"],["\u003cp\u003eAssignments are hierarchical, with the system searching for an assignment at the project, folder, and organization levels in that order and applying the first one found.\u003c/p\u003e\n"],["\u003cp\u003e"None" assignments signify the absence of an assignment and result in projects using on-demand pricing.\u003c/p\u003e\n"],["\u003cp\u003eCreating an assignment requires the user to have \u003ccode\u003ebigquery.reservationAssignments.create\u003c/code\u003e permission on the specified parent resource and also \u003ccode\u003ebigquery.admin\u003c/code\u003e permissions on both the project using the reservation and the project that owns it.\u003c/p\u003e\n"]]],[],null,["# Method: projects.locations.reservations.assignments.create\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCreates an assignment object which allows the given project to submit jobs of a certain type using slots from the specified reservation.\n\nCurrently a resource (project, folder, organization) can only have one assignment per each (jobType, location) combination, and that reservation will be used for all jobs of the matching type.\n\nDifferent 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.\n\nWhen creating assignments, it does not matter if other assignments exist at higher levels.\n\nExample:\n\n- The organization `organizationA` contains two projects, `project1` and `project2`.\n- Assignments for all three entities (`organizationA`, `project1`, and `project2`) could all be created and mapped to the same or different reservations.\n\n\"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 reservationId in the parent. Example parent: `projects/myproject/locations/US/reservations/none`.\n\nReturns `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.\n\nReturns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment does not match location of the reservation.\n\n### HTTP request\n\n`POST https://bigqueryreservation.googleapis.com/v1/{parent=projects/*/locations/*/reservations/*}/assignments`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Query parameters\n\n### Request body\n\nThe request body contains an instance of [Assignment](/bigquery/docs/reference/reservations/rest/v1/projects.locations.reservations.assignments#Assignment).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [Assignment](/bigquery/docs/reference/reservations/rest/v1/projects.locations.reservations.assignments#Assignment).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/bigquery`\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp)."]]