---
title: "Upsert remote"
method: POST
path: "/orgs/{orgId}/projects/{projectId}/remotes"
tags: ["Remotes"]
---

# Upsert remote

`POST /orgs/{orgId}/projects/{projectId}/remotes`

Upsert remote.
If remote with the same `mountPath` and `type` already exists the remote object is returned.
If the `type` doesn't match the existing remote, a 409 error is returned.
Otherwise, a new remote is created.

## Request body

- CreateRemote
  - `mountPath` string, required — Remote target path.
  - `type` 'CICD' | 'GIT' | 'URL', required — Remote type. TODO: Add discriminator by type and add other fields for GIT and URL remote types.
  - `autoSync` boolean — Auto sync changes to remote.
  - `autoMerge` boolean — Auto merge changes from remote.
  - `createdAt` string, date-time
  - `updatedAt` string, date-time
  - `providerType` 'GITHUB_CLOUD' | 'GITHUB_SERVER' | 'GITLAB_CLOUD' | 'GITLAB_SELF_MANAGED' | 'BITBUCKET_CLOUD' | 'BITBUCKET_DATACENTER' | 'AZURE', enum — Git provider type.
  - `namespaceId` string
  - `repositoryId` string
  - `projectId` string, nullable
  - `mountBranchName` string
  - `contentPath` string
  - `credentialId` string
  - `branchName` string
  - `contentType` 'FOLDER' | 'FILE'

## Response `201`

Remote created.

- Remote
  - `mountPath` string, required — Remote target path.
  - `type` 'CICD' | 'GIT' | 'URL', required — Remote type. TODO: Add discriminator by type and add other fields for GIT and URL remote types.
  - `autoSync` boolean — Auto sync changes to remote.
  - `autoMerge` boolean — Auto merge changes from remote.
  - `createdAt` string, date-time
  - `updatedAt` string, date-time
  - `providerType` 'GITHUB_CLOUD' | 'GITHUB_SERVER' | 'GITLAB_CLOUD' | 'GITLAB_SELF_MANAGED' | 'BITBUCKET_CLOUD' | 'BITBUCKET_DATACENTER' | 'AZURE', enum — Git provider type.
  - `namespaceId` string
  - `repositoryId` string
  - `projectId` string, nullable
  - `mountBranchName` string
  - `contentPath` string
  - `credentialId` string
  - `branchName` string
  - `contentType` 'FOLDER' | 'FILE'
  - `id` string, required — Remote ID.

## Other responses

- `400` — Bad Request.

---

[API](https://skmtc.dev/redocly/apis/redocly-scout.md) · [All operations](https://skmtc.dev/redocly/apis/redocly-scout/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/redocly/redocly-scout/revisions/406779aef361/schema)
