Required. The connection to contain the repository. If the request is part of a BatchCreateRepositoriesRequest, this field should be empty or match the parent specified there.
Query parameters
Parameters
repositoryId
string
Required. The ID to use for the repository, which will become the final component of the repository's resource name. This ID should be unique in the connection. Allows alphanumeric characters and any of -._~%!$&'()*+,;=@.
Request body
The request body contains an instance of Repository.
Response body
If successful, the response body contains a newly created instance of Operation.
[[["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-17 UTC."],[[["\u003cp\u003eThis API endpoint allows you to create a new repository within a specified connection using a \u003ccode\u003ePOST\u003c/code\u003e request.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eparent\u003c/code\u003e path parameter is mandatory and indicates the connection where the repository will reside.\u003c/p\u003e\n"],["\u003cp\u003eYou must provide a unique \u003ccode\u003erepositoryId\u003c/code\u003e query parameter to name the repository, and it must follow specific alphanumeric character constraints.\u003c/p\u003e\n"],["\u003cp\u003eThe request body requires a \u003ccode\u003eRepository\u003c/code\u003e object, and a successful operation returns an \u003ccode\u003eOperation\u003c/code\u003e object.\u003c/p\u003e\n"],["\u003cp\u003eCreating a repository requires the \u003ccode\u003ecloudbuild.repositories.create\u003c/code\u003e IAM permission and the \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e OAuth scope.\u003c/p\u003e\n"]]],[],null,["# Method: projects.locations.connections.repositories.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- [IAM Permissions](#body.aspect_1)\n- [Try it!](#try-it)\n\nCreates a Repository.\n\n### HTTP request\n\n`POST https://cloudbuild.googleapis.com/v2/{parent=projects/*/locations/*/connections/*}/repositories`\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 [Repository](/build/docs/api/reference/rest/v2/projects.locations.connections.repositories#Repository).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [Operation](/build/docs/api/reference/rest/Shared.Types/Operation).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](https://cloud.google.com/docs/authentication/).\n\n### IAM Permissions\n\nRequires the following [IAM](https://cloud.google.com/iam/docs) permission on the `parent` resource:\n\n- `cloudbuild.repositories.create`\n\nFor more information, see the [IAM documentation](https://cloud.google.com/iam/docs)."]]