---
title: "POST /v1/{+parent}/repositories"
method: POST
path: "/v1/{+parent}/repositories"
tags: ["projects"]
---

# POST /v1/{+parent}/repositories

`POST /v1/{+parent}/repositories`

Creates a new Repository in a given project and location.

## Path parameters

- `parent` string, required

## Query parameters

- `repositoryId` string

## Request body

- Repository — Represents a Dataform Git repository.
  - `kmsKeyName` string — Optional. The reference to a KMS encryption key. If provided, it will be used to encrypt user data in the repository and all child resources. It is not possible to add or update the encryption key after the repository is created. Example: `projects/{kms_project}/locations/{location}/keyRings/{key_location}/cryptoKeys/{key}`
  - `name` string — Identifier. The repository's name.
  - `createTime` string, google-datetime — Output only. The timestamp of when the repository was created.
  - `containingFolder` string — Optional. The name of the containing folder of the repository. The field is immutable and it can be modified via a MoveRepository operation. Format: `projects/*/locations/*/folders/*`. or `projects/*/locations/*/teamFolders/*`.
  - `labels` object — Optional. Repository user labels.
  - `setAuthenticatedUserAdmin` boolean — Optional. Input only. If set to true, the authenticated user will be granted the roles/dataform.admin role on the created repository.
  - `internalMetadata` string — Output only. All the metadata information that is used internally to serve the resource. For example: timestamps, flags, status fields, etc. The format of this field is a JSON string.
  - `displayName` string — Optional. The repository's user-friendly name.
  - `serviceAccount` string — Optional. The service account to run workflow invocations under.
  - `teamFolderName` string — Output only. The resource name of the TeamFolder that this Repository is associated with. This should take the format: projects/{project}/locations/{location}/teamFolders/{teamFolder}. If this is not set, the Repository is not associated with a TeamFolder.
  - `gitRemoteSettings` GitRemoteSettings — Controls Git remote configuration for a repository.
    - `url` string — Required. The Git remote's URL.
    - `effectiveDefaultBranch` string — Output only. The Git remote's effective default branch name. This is the default branch name of the Git remote if it is set, otherwise it is `main`.
    - `sshAuthenticationConfig` SshAuthenticationConfig — Configures fields for performing SSH authentication.
      - `userPrivateKeySecretVersion` string — Required. The name of the Secret Manager secret version to use as a ssh private key for Git operations. Must be in the format `projects/*/secrets/*/versions/*`.
      - `hostPublicKey` string — Required. Content of a public SSH key to verify an identity of a remote Git host.
    - `gitRepositoryLink` string — Optional. Resource name for the `GitRepositoryLink` used for machine credentials. Must be in the format `projects/*/locations/*/connections/*/gitRepositoryLinks/*`
    - `defaultBranch` string — Optional. The Git remote's default branch name. If not set, `main` will be used.
    - `authenticationTokenSecretVersion` string — Optional. The name of the Secret Manager secret version to use as an authentication token for Git operations. Must be in the format `projects/*/secrets/*/versions/*`.
    - `tokenStatus` 'TOKEN_STATUS_UNSPECIFIED' | 'NOT_FOUND' | 'INVALID' | 'VALID' — Output only. Deprecated: The field does not contain any token status information.
  - `dataEncryptionState` DataEncryptionState — Describes encryption state of a resource.
    - `kmsKeyVersionName` string — Required. The KMS key version name with which data of a resource is encrypted.
  - `workspaceCompilationOverrides` WorkspaceCompilationOverrides — Configures workspace compilation overrides for a repository.
    - `schemaSuffix` string — Optional. The suffix that should be appended to all schema (BigQuery dataset ID) names.
    - `defaultDatabase` string — Optional. The default database (Google Cloud project ID).
    - `tablePrefix` string — Optional. The prefix that should be prepended to all table names.
  - `npmrcEnvironmentVariablesSecretVersion` string — Optional. The name of the Secret Manager secret version to be used to interpolate variables into the .npmrc file for package installation operations. Must be in the format `projects/*/secrets/*/versions/*`. The file itself must be in a JSON format.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/dataform.md) · [All operations](https://skmtc.net/google/apis/dataform/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/dataform/versions/b9dafc69d5c5/schema)
