diff options
author | Ben <benmaggacis+gitlab@gmail.com> | 2019-01-17 13:37:08 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2019-01-17 13:37:08 +0300 |
commit | 1e2bd853336818931f283a284ff4a78815ee4b3b (patch) | |
tree | 2dc4e5c8390853874d3ffc43c62a65182abe6d7b /doc/api/import.md | |
parent | f598daf28490d6cb131d060bc1a4d13447352f4c (diff) |
API for importing external repos
Diffstat (limited to 'doc/api/import.md')
-rw-r--r-- | doc/api/import.md | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/doc/api/import.md b/doc/api/import.md new file mode 100644 index 00000000000..9f8e0d232c6 --- /dev/null +++ b/doc/api/import.md @@ -0,0 +1,33 @@ +# Import API + +## Import repository from GitHub + +Import your projects from GitHub to GitLab via the API. + +``` +POST /import/github +``` + +| Attribute | Type | Required | Description | +|------------|---------|----------|---------------------| +| `personal_access_token` | string | yes | GitHub personal access token | +| `repo_id` | integer | yes | GitHub repository ID | +| `new_name` | string | no | New repo name | +| `target_namespace` | string | yes | Namespace to import repo into | + + +```bash +curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" --data "personal_access_token=abc123&repo_id=12345&target_namespace=root" https://gitlab.example.com/api/v4/import/github +``` + +Example response: + +```json +{ + "id": 27, + "name": "my-repo", + "full_path": "/root/my-repo", + "full_name": "Administrator / my-repo" +} +``` + |