LogoFreestyle
API Reference/Git

Create a repository

Create a repository. Once the repository is created, it will also be created on the Git server. The repository name must be unique within your account. Once created, you can then push your code to this repository. The repo will be available at `git.freestyle.sh/{repo-id}`

POST
/git/v1/repo

Request Body

application/jsonRequired
namestring | null

This name is not visible to users, and is only accessible to you via API and in the dashboard. Mostly useful for observability.

publicboolean
Default: false
defaultBranchstring | null

The default branch name for the repository. Defaults to "main" if not specified.

sourceobject

Fork from another Git repository. Cannot be used with import.

importFiles | Tar | Zip | Git

Import static content with an initial commit. Cannot be used with source.

Response Body

200

Repository created successfully

repoIdRequiredstring
Format: "uuid"

400

Invalid request

messageRequiredstring

500

Internal server error

messageRequiredstring
curl -X POST "https://api.freestyle.sh/git/v1/repo" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "string",
    "public": false,
    "defaultBranch": "string",
    "source": {
      "url": "http://example.com",
      "branch": "string",
      "depth": 0
    },
    "import": {
      "files": {
        "property1": "string",
        "property2": "string"
      },
      "commitMessage": "string",
      "authorName": "string",
      "authorEmail": "string",
      "type": "files"
    }
  }'

Repository created successfully

{
  "repoId": "c7c90052-c566-40b6-94a5-a1e9a44bfdc7"
}

Freestyle AI

Documentation assistant

Experimental: AI responses may not always be accurate—please verify important details with the official documentation.

How can I help?

Ask me about Freestyle while you browse the docs.