POST /user/repos

Creates a new repository for the authenticated user.

OAuth app tokens and personal access tokens (classic) need the public_repo or repo scope to create a public repository, and repo scope to create a private repository.

Servers

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/json"

Request body fields

Name Type Required Description
has_discussions Boolean No

Whether discussions are enabled.

Default value: false

description String No

A short description of the repository.

team_id Integer No

The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization.

license_template String No

The license keyword of the open source license for this repository.

squash_merge_commit_message String No

The default value for a squash merge commit message:

  • PR_BODY - default to the pull request's body.
  • COMMIT_MESSAGES - default to the branch's commit messages.
  • BLANK - default to a blank commit message.

Possible values:

  • "BLANK"
  • "PR_BODY"
  • "COMMIT_MESSAGES"
has_issues Boolean No

Whether issues are enabled.

Default value: true

merge_commit_message String No

The default value for a merge commit message.

  • PR_TITLE - default to the pull request's title.
  • PR_BODY - default to the pull request's body.
  • BLANK - default to a blank commit message.

Possible values:

  • "BLANK"
  • "PR_BODY"
  • "PR_TITLE"
squash_merge_commit_title String No

Required when using squash_merge_commit_message.

The default value for a squash merge commit title:

  • PR_TITLE - default to the pull request's title.
  • COMMIT_OR_PR_TITLE - default to the commit's title (if only one commit) or the pull request's title (when more than one commit).

Possible values:

  • "PR_TITLE"
  • "COMMIT_OR_PR_TITLE"
has_wiki Boolean No

Whether the wiki is enabled.

Default value: true

allow_squash_merge Boolean No

Whether to allow squash merges for pull requests.

Default value: true

delete_branch_on_merge Boolean No

Whether to delete head branches when pull requests are merged

Default value: false

merge_commit_title String No

Required when using merge_commit_message.

The default value for a merge commit title.

  • PR_TITLE - default to the pull request's title.
  • MERGE_MESSAGE - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name).

Possible values:

  • "PR_TITLE"
  • "MERGE_MESSAGE"
is_template Boolean No

Whether this repository acts as a template that can be used to generate new repositories.

Default value: false

homepage String No

A URL with more information about the repository.

name String Yes

The name of the repository.

auto_init Boolean No

Whether the repository is initialized with a minimal README.

Default value: false

allow_rebase_merge Boolean No

Whether to allow rebase merges for pull requests.

Default value: true

allow_auto_merge Boolean No

Whether to allow Auto-merge to be used on pull requests.

Default value: false

private Boolean No

Whether the repository is private.

Default value: false

has_projects Boolean No

Whether projects are enabled.

Default value: true

gitignore_template String No

The desired language or platform to apply to the .gitignore.

allow_merge_commit Boolean No

Whether to allow merge commits for pull requests.

Default value: true

has_downloads Boolean No

Whether downloads are enabled.

Default value: true

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.