# Method: projects.locations.connections.repositories.create

- [HTTP request](https://docs.cloud.google.com/build/docs/api/reference/rest/v2/projects.locations.connections.repositories/create#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/build/docs/api/reference/rest/v2/projects.locations.connections.repositories/create#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/build/docs/api/reference/rest/v2/projects.locations.connections.repositories/create#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/build/docs/api/reference/rest/v2/projects.locations.connections.repositories/create#body.request_body)
- [Response body](https://docs.cloud.google.com/build/docs/api/reference/rest/v2/projects.locations.connections.repositories/create#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/build/docs/api/reference/rest/v2/projects.locations.connections.repositories/create#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/build/docs/api/reference/rest/v2/projects.locations.connections.repositories/create#body.aspect_1)
- [Try it!](https://docs.cloud.google.com/build/docs/api/reference/rest/v2/projects.locations.connections.repositories/create#try-it)

Creates a Repository.

### HTTP request

`POST https://cloudbuild.googleapis.com/v2/{parent=projects/*/locations/*/connections/*}/repositories`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` 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 `https://docs.cloud.google.com/build/docs/api/reference/rest/v2/projects.locations.connections.repositories#Repository`.

### Response body

If successful, the response body contains a newly created instance of `https://docs.cloud.google.com/build/docs/api/reference/rest/Shared.Types/Operation`.

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://cloud.google.com/docs/authentication/).

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `parent` resource:

- `cloudbuild.repositories.create`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).