---
title: "Get authenticated clone URL for a repository"
method: POST
path: "/api/vcs/clone-url"
tags: ["VCS"]
---

# Get authenticated clone URL for a repository

`POST /api/vcs/clone-url`

Generates an authenticated git clone URL with embedded credentials for the specified repository.
Supports all VCS providers: GitHub, GitLab, Bitbucket, Bitbucket Data Center, Azure DevOps, and AWS CodeCommit.

## Request body

- CloneUrlRequest
  - `vcsId` string, required — The VCS integration ID
  - `repository` string, required — Repository path. Format varies by provider: - GitHub/GitLab/Bitbucket: org/repo - Bitbucket DC: project/repo - Azure DevOps: org/project/repo - CodeCommit: repo-name
  - `region` string — AWS region (required only for CodeCommit)

## Response `200`

Successfully generated clone URL

- CloneUrlResponse
  - `cloneUrl` string, required — The authenticated git clone URL
  - `vcsType` 'github' | 'gitlab' | 'bitbucket' | 'bitbucketdc' | 'azuredevops' | 'codecommit', required — The type of VCS provider
  - `credentials` CodeCommitCredentials — AWS credentials for CodeCommit (only returned for CodeCommit integrations)
    - `accessKey` string — AWS access key ID
    - `secretKey` string — AWS secret access key
    - `sessionToken` string — AWS session token
    - `region` string — AWS region

## Other responses

- `400` — Bad Request Error
- `401` — Unauthorized Error
- `404` — Not Found Error
- `500` — Internal Server Error

---

[API](https://skmtc.net/firefly/apis/api-gateway.md) · [All operations](https://skmtc.net/firefly/apis/api-gateway/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/firefly/api-gateway/revisions/eea119b4113f/schema)
