Adding repository details via API
This method allows you to add your repository details to a project.
URL
/projects/<project>/repository
HTTP Method
POST
Supported Parameters
scm_type- One of eithergit,subversionormercurial(required)url- Full URL to the repository (required)port- The port to connect to your repository (optional)branch- The default branch you wish to deploy from (optional)
SVN & Mercurial
The following parameters are only supported for SVN and Mercurial repositories.
username- The username to authenticate withpassword- The password to authenticate with
Example cURL Request
curl -H "Content-type: application/json" \
-H "Accept: application/json" \
--user adam@atechmedia.com:my-api-key \
-X POST \
-d { \
  "repository" : { \
    "scm_type": "git", \
    "url": "git@github.com:test/test.git", \
    "port": null, \
    "username": null, \
    "branch": "master", \
  } \
} \
https://test.deployhq.com/projects/project/repository
Example Response
{
    "scm_type": "git",
    "url": "git@github.com:danquinney/test.git",
    "port": null,
    "username": null,
    "branch": "master",
    "cached": false,
    "hosting_service": {
        "name": "GitHub",
        "url": "http://github.com",
        "tree_url": "https://github.com/danquinney/test/tree/master",
        "commits_url": "https://github.com/danquinney/test/commits/master"
    }
}