Skip to main content
POST
/
v1
/
repos
Create Git repository
curl --request POST \
  --url https://repos.morphllm.com/v1/repos \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "repoId": "my-app",
  "name": "My Application",
  "defaultBranch": "main"
}'
{
  "success": true,
  "repoId": "my-app",
  "name": "My Application",
  "defaultBranch": "main",
  "providerPath": "u-user123-r-my-app",
  "gitUrl": "https://repos.morphllm.com/v1/repos/my-app"
}

Overview

This endpoint creates a new Git repository with:
  • Repository entry in Azure DevOps
  • Database record with user/org association
  • Remote URL configuration for git operations

Typical Usage

Most developers use the Morph SDK instead:
import { MorphGit } from 'morphsdk/git';

const morphGit = new MorphGit({ apiKey: process.env.MORPH_API_KEY });
await morphGit.init({ repoId: 'my-project', dir: './my-project' });

Organization Support

Repositories can be scoped to organizations. The org_id is automatically determined from your API key’s association.

Authorizations

Authorization
string
header
required

Use your Morph API key as the bearer token. Get your API key at https://morphllm.com/dashboard

Body

application/json

Repository creation request

repoId
string
required

Unique repository identifier. Must be unique across your account/organization.

Example:

"my-app"

name
string

Human-readable repository name. Defaults to repoId if not provided.

Example:

"My Application"

defaultBranch
string
default:main

Default branch name for the repository

Example:

"main"

Response

Repository created successfully

success
boolean
required

Whether the repository was created successfully

Example:

true

repoId
string
required

Repository identifier

Example:

"my-app"

providerPath
string
required

Azure DevOps repository path (internal identifier)

Example:

"u-user123-r-my-app"

gitUrl
string
required

Git remote URL for this repository

Example:

"https://repos.morphllm.com/v1/repos/my-app"

name
string

Repository name

Example:

"My Application"

defaultBranch
string

Default branch name

Example:

"main"