2017-05-18 04:49:03 -04:00
# Services API
2014-10-14 13:07:34 -04:00
2015-08-26 19:58:49 -04:00
## Asana
Asana - Teamwork without email
### Create/Edit Asana service
Set Asana service for a project.
2016-06-25 23:43:10 -04:00
> This service adds commit messages as comments to Asana tasks. Once enabled, commit messages are checked for Asana task URLs (for example, `https://app.asana.com/0/123456/987654`) or task IDs starting with # (for example, `#987654`). Every task ID found will get the commit comment added to it. You can also close a task with a message containing: `fix #123456`. You can find your Api Keys here: https://asana.com/developers/documentation/getting-started/auth#api-key
2015-08-26 19:58:49 -04:00
```
PUT /projects/:id/services/asana
```
Parameters:
2016-05-30 01:31:22 -04:00
- `api_key` (**required**) - User API token. User must have access to task, all comments will be attributed to this user.
- `restrict_to_branch` (optional) - Comma-separated list of branches which will be automatically inspected. Leave blank to include all branches.
2015-08-26 19:58:49 -04:00
### Delete Asana service
Delete Asana service for a project.
```
DELETE /projects/:id/services/asana
```
2015-09-03 09:38:54 -04:00
### Get Asana service settings
Get Asana service settings for a project.
```
GET /projects/:id/services/asana
```
2015-08-26 19:58:49 -04:00
## Assembla
Project Management Software (Source Commits Endpoint)
### Create/Edit Assembla service
Set Assembla service for a project.
```
PUT /projects/:id/services/assembla
```
Parameters:
- `token` (**required**)
- `subdomain` (optional)
### Delete Assembla service
Delete Assembla service for a project.
```
DELETE /projects/:id/services/assembla
```
2015-09-03 09:38:54 -04:00
### Get Assembla service settings
Get Assembla service settings for a project.
```
GET /projects/:id/services/assembla
```
2015-08-26 19:58:49 -04:00
## Atlassian Bamboo CI
2017-03-06 05:50:32 -05:00
A continuous integration and build server
2015-08-26 19:58:49 -04:00
### Create/Edit Atlassian Bamboo CI service
Set Atlassian Bamboo CI service for a project.
> You must set up automatic revision labeling and a repository trigger in Bamboo.
```
PUT /projects/:id/services/bamboo
```
Parameters:
- `bamboo_url` (**required**) - Bamboo root URL like https://bamboo.example.com
2017-03-06 05:50:32 -05:00
- `build_key` (**required**) - Bamboo build plan key like KEY
2015-08-26 19:58:49 -04:00
- `username` (**required**) - A user with API access, if applicable
- `password` (**required**)
### Delete Atlassian Bamboo CI service
Delete Atlassian Bamboo CI service for a project.
```
DELETE /projects/:id/services/bamboo
```
2015-09-03 09:38:54 -04:00
### Get Atlassian Bamboo CI service settings
Get Atlassian Bamboo CI service settings for a project.
```
GET /projects/:id/services/bamboo
```
2015-08-26 19:58:49 -04:00
## Buildkite
Continuous integration and deployments
### Create/Edit Buildkite service
Set Buildkite service for a project.
```
2017-03-06 05:50:32 -05:00
PUT /projects/:id/services/buildkite
2015-08-26 19:58:49 -04:00
```
Parameters:
- `token` (**required**) - Buildkite project GitLab token
2017-03-06 05:50:32 -05:00
- `project_url` (**required**) - https://buildkite.com/example/project
2015-08-26 19:58:49 -04:00
- `enable_ssl_verification` (optional) - Enable SSL verification
### Delete Buildkite service
Delete Buildkite service for a project.
```
2017-03-06 05:50:32 -05:00
DELETE /projects/:id/services/buildkite
2015-08-26 19:58:49 -04:00
```
2015-09-03 09:38:54 -04:00
### Get Buildkite service settings
Get Buildkite service settings for a project.
```
2017-03-06 05:50:32 -05:00
GET /projects/:id/services/buildkite
2015-09-03 09:38:54 -04:00
```
2015-08-26 19:58:49 -04:00
## Campfire
Simple web-based real-time group chat
### Create/Edit Campfire service
Set Campfire service for a project.
```
PUT /projects/:id/services/campfire
```
Parameters:
- `token` (**required**)
- `subdomain` (optional)
- `room` (optional)
### Delete Campfire service
Delete Campfire service for a project.
```
DELETE /projects/:id/services/campfire
```
2015-09-03 09:38:54 -04:00
### Get Campfire service settings
Get Campfire service settings for a project.
```
GET /projects/:id/services/campfire
```
2015-08-26 19:58:49 -04:00
## Custom Issue Tracker
Custom issue tracker
### Create/Edit Custom Issue Tracker service
Set Custom Issue Tracker service for a project.
```
PUT /projects/:id/services/custom-issue-tracker
```
Parameters:
- `new_issue_url` (**required**) - New Issue url
- `issues_url` (**required**) - Issue url
- `project_url` (**required**) - Project url
- `description` (optional) - Custom issue tracker
- `title` (optional) - Custom Issue Tracker
### Delete Custom Issue Tracker service
Delete Custom Issue Tracker service for a project.
```
DELETE /projects/:id/services/custom-issue-tracker
```
2015-09-03 09:38:54 -04:00
### Get Custom Issue Tracker service settings
Get Custom Issue Tracker service settings for a project.
```
GET /projects/:id/services/custom-issue-tracker
```
2015-08-26 19:58:49 -04:00
## Drone CI
Drone is a Continuous Integration platform built on Docker, written in Go
### Create/Edit Drone CI service
Set Drone CI service for a project.
```
PUT /projects/:id/services/drone-ci
```
Parameters:
- `token` (**required**) - Drone CI project specific token
- `drone_url` (**required**) - http://drone.example.com
- `enable_ssl_verification` (optional) - Enable SSL verification
### Delete Drone CI service
Delete Drone CI service for a project.
```
DELETE /projects/:id/services/drone-ci
```
2015-09-03 09:38:54 -04:00
### Get Drone CI service settings
Get Drone CI service settings for a project.
```
GET /projects/:id/services/drone-ci
```
2015-08-26 19:58:49 -04:00
## Emails on push
Email the commits and diff of each push to a list of recipients.
### Create/Edit Emails on push service
Set Emails on push service for a project.
```
PUT /projects/:id/services/emails-on-push
```
Parameters:
- `recipients` (**required**) - Emails separated by whitespace
- `disable_diffs` (optional) - Disable code diffs
- `send_from_committer_email` (optional) - Send from committer
### Delete Emails on push service
Delete Emails on push service for a project.
```
DELETE /projects/:id/services/emails-on-push
```
2015-09-03 09:38:54 -04:00
### Get Emails on push service settings
Get Emails on push service settings for a project.
```
GET /projects/:id/services/emails-on-push
```
2015-08-26 19:58:49 -04:00
## External Wiki
Replaces the link to the internal wiki with a link to an external wiki.
### Create/Edit External Wiki service
Set External Wiki service for a project.
```
PUT /projects/:id/services/external-wiki
```
Parameters:
- `external_wiki_url` (**required**) - The URL of the external Wiki
### Delete External Wiki service
Delete External Wiki service for a project.
```
DELETE /projects/:id/services/external-wiki
```
2015-09-03 09:38:54 -04:00
### Get External Wiki service settings
Get External Wiki service settings for a project.
```
GET /projects/:id/services/external-wiki
```
2015-08-26 19:58:49 -04:00
## Flowdock
Flowdock is a collaboration web app for technical teams.
### Create/Edit Flowdock service
Set Flowdock service for a project.
```
PUT /projects/:id/services/flowdock
```
Parameters:
- `token` (**required**) - Flowdock Git source token
### Delete Flowdock service
Delete Flowdock service for a project.
```
DELETE /projects/:id/services/flowdock
```
2015-09-03 09:38:54 -04:00
### Get Flowdock service settings
Get Flowdock service settings for a project.
```
GET /projects/:id/services/flowdock
```
2015-08-26 19:58:49 -04:00
## Gemnasium
Gemnasium monitors your project dependencies and alerts you about updates and security vulnerabilities.
### Create/Edit Gemnasium service
Set Gemnasium service for a project.
```
PUT /projects/:id/services/gemnasium
```
Parameters:
2016-08-10 10:15:27 -04:00
- `api_key` (**required**) - Your personal API KEY on gemnasium.com
2015-08-26 19:58:49 -04:00
- `token` (**required**) - The project's slug on gemnasium.com
### Delete Gemnasium service
Delete Gemnasium service for a project.
```
DELETE /projects/:id/services/gemnasium
```
2015-09-03 09:38:54 -04:00
### Get Gemnasium service settings
Get Gemnasium service settings for a project.
```
GET /projects/:id/services/gemnasium
```
2015-02-03 18:18:40 -05:00
## HipChat
2014-10-14 13:07:34 -04:00
2015-08-26 19:58:49 -04:00
Private group chat and IM
### Create/Edit HipChat service
2014-10-14 13:07:34 -04:00
2015-08-26 19:58:49 -04:00
Set HipChat service for a project.
2014-10-14 13:07:34 -04:00
```
PUT /projects/:id/services/hipchat
```
2015-08-26 19:58:49 -04:00
2014-10-14 13:07:34 -04:00
Parameters:
2015-08-26 19:58:49 -04:00
- `token` (**required**) - Room token
- `color` (optional)
- `notify` (optional)
- `room` (optional) - Room name or ID
- `api_version` (optional) - Leave blank for default (v2)
- `server` (optional) - Leave blank for default. https://hipchat.example.com
2014-10-14 13:07:34 -04:00
2015-02-03 18:18:40 -05:00
### Delete HipChat service
2014-10-14 13:07:34 -04:00
2015-02-03 18:18:40 -05:00
Delete HipChat service for a project.
2014-10-14 13:07:34 -04:00
```
DELETE /projects/:id/services/hipchat
```
2015-08-26 19:58:49 -04:00
2015-09-03 09:38:54 -04:00
### Get HipChat service settings
Get HipChat service settings for a project.
```
GET /projects/:id/services/hipchat
```
2015-08-26 19:58:49 -04:00
## Irker (IRC gateway)
Send IRC messages, on update, to a list of recipients through an Irker gateway.
### Create/Edit Irker (IRC gateway) service
Set Irker (IRC gateway) service for a project.
> NOTE: Irker does NOT have built-in authentication, which makes it vulnerable to spamming IRC channels if it is hosted outside of a firewall. Please make sure you run the daemon within a secured network to prevent abuse. For more details, read: http://www.catb.org/~esr/irker/security.html.
```
PUT /projects/:id/services/irker
```
Parameters:
- `recipients` (**required**) - Recipients/channels separated by whitespaces
- `default_irc_uri` (optional) - irc://irc.network.net:6697/
- `server_port` (optional) - 6659
- `server_host` (optional) - localhost
- `colorize_messages` (optional)
### Delete Irker (IRC gateway) service
Delete Irker (IRC gateway) service for a project.
```
DELETE /projects/:id/services/irker
```
2015-09-03 09:38:54 -04:00
### Get Irker (IRC gateway) service settings
Get Irker (IRC gateway) service settings for a project.
```
GET /projects/:id/services/irker
```
2015-08-26 19:58:49 -04:00
## JIRA
2016-10-26 11:12:39 -04:00
JIRA issue tracker.
### Get JIRA service settings
Get JIRA service settings for a project.
```
GET /projects/:id/services/jira
```
2015-08-26 19:58:49 -04:00
### Create/Edit JIRA service
Set JIRA service for a project.
2016-11-22 12:31:34 -05:00
>**Notes:**
- Starting with GitLab 8.14, `api_url` , `issues_url` , `new_issue_url` and
`project_url` are replaced by `project_key` , `url` . If you are using an
older version, [follow this documentation][old-jira-api].
2015-08-26 19:58:49 -04:00
```
PUT /projects/:id/services/jira
```
2016-10-26 11:12:39 -04:00
| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
2016-11-22 12:31:34 -05:00
| `url` | string | yes | The URL to the JIRA project which is being linked to this GitLab project, e.g., `https://jira.example.com` . |
| `project_key` | string | yes | The short identifier for your JIRA project, all uppercase, e.g., `PROJ` . |
2017-10-24 03:40:26 -04:00
| `username` | string | yes | The username of the user created to be used with GitLab/JIRA. |
| `password` | string | yes | The password of the user created to be used with GitLab/JIRA. |
2016-12-05 09:40:53 -05:00
| `jira_issue_transition_id` | integer | no | The ID of a transition that moves issues to a closed state. You can find this number under the JIRA workflow administration (**Administration > Issues > Workflows**) by selecting **View** under **Operations** of the desired workflow of your project. The ID of each state can be found inside the parenthesis of each transition name under the **Transitions (id)** column ([see screenshot][trans]). By default, this ID is set to `2` . |
2015-08-26 19:58:49 -04:00
### Delete JIRA service
2016-10-26 11:12:39 -04:00
Remove all previously JIRA settings from a project.
2015-08-26 19:58:49 -04:00
```
DELETE /projects/:id/services/jira
```
2017-11-13 01:42:31 -05:00
## Kubernetes
Kubernetes / Openshift integration
### Create/Edit Kubernetes service
Set Kubernetes service for a project.
```
PUT /projects/:id/services/kubernetes
```
Parameters:
- `namespace` (**required**) - The Kubernetes namespace to use
- `api_url` (**required**) - The URL to the Kubernetes cluster API, e.g., https://kubernetes.example.com
- `token` (**required**) - The service token to authenticate against the Kubernetes cluster with
- `ca_pem` (optional) - A custom certificate authority bundle to verify the Kubernetes cluster with (PEM format)
### Delete Kubernetes service
Delete Kubernetes service for a project.
```
DELETE /projects/:id/services/kubernetes
```
### Get Kubernetes service settings
Get Kubernetes service settings for a project.
```
GET /projects/:id/services/kubernetes
```
2017-04-18 04:19:00 -04:00
## Slack slash commands
2016-12-05 09:40:53 -05:00
2017-04-18 04:19:00 -04:00
Ability to receive slash commands from a Slack chat instance.
2016-12-05 09:40:53 -05:00
2017-04-18 04:19:00 -04:00
### Get Slack slash command service settings
2016-12-05 09:40:53 -05:00
2017-04-18 04:19:00 -04:00
Get Slack slash command service settings for a project.
2016-12-05 09:40:53 -05:00
```
2017-04-18 04:19:00 -04:00
GET /projects/:id/services/slack-slash-commands
```
Example response:
```json
{
"id": 4,
"title": "Slack slash commands",
"created_at": "2017-06-27T05:51:39-07:00",
"updated_at": "2017-06-27T05:51:39-07:00",
"active": true,
"push_events": true,
"issues_events": true,
"merge_requests_events": true,
"tag_push_events": true,
"note_events": true,
2017-05-15 11:11:45 -04:00
"job_events": true,
2017-04-18 04:19:00 -04:00
"pipeline_events": true,
"properties": {
"token": "9koXpg98eAheJpvBs5tK"
}
}
```
### Create/Edit Slack slash command service
Set Slack slash command for a project.
```
PUT /projects/:id/services/slack-slash-commands
2016-12-05 09:40:53 -05:00
```
Parameters:
2016-12-12 08:27:52 -05:00
| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
2017-04-18 04:19:00 -04:00
| `token` | string | yes | The Slack token |
2016-12-12 08:27:52 -05:00
2016-12-05 09:40:53 -05:00
2017-04-18 04:19:00 -04:00
### Delete Slack slash command service
2016-12-05 09:40:53 -05:00
2017-04-18 04:19:00 -04:00
Delete Slack slash command service for a project.
2016-12-05 09:40:53 -05:00
```
2017-04-18 04:19:00 -04:00
DELETE /projects/:id/services/slack-slash-commands
2016-12-05 09:40:53 -05:00
```
2017-04-18 04:19:00 -04:00
## Mattermost slash commands
Ability to receive slash commands from a Mattermost chat instance.
### Get Mattermost slash command service settings
2016-12-05 09:40:53 -05:00
2017-04-18 04:19:00 -04:00
Get Mattermost slash command service settings for a project.
2016-12-05 09:40:53 -05:00
```
GET /projects/:id/services/mattermost-slash-commands
```
2017-04-18 04:19:00 -04:00
### Create/Edit Mattermost slash command service
Set Mattermost slash command for a project.
```
PUT /projects/:id/services/mattermost-slash-commands
```
Parameters:
| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `token` | string | yes | The Mattermost token |
2017-11-08 05:22:24 -05:00
| `username` | string | no | The username to use to post the message |
2017-04-18 04:19:00 -04:00
### Delete Mattermost slash command service
Delete Mattermost slash command service for a project.
```
DELETE /projects/:id/services/mattermost-slash-commands
```
2017-09-21 16:05:44 -04:00
## Packagist
Update your project on Packagist, the main Composer repository, when commits or tags are pushed to GitLab.
### Create/Edit Packagist service
Set Packagist service for a project.
```
PUT /projects/:id/services/packagist
```
Parameters:
- `username` (**required**)
- `token` (**required**)
- `server` (optional)
### Delete Packagist service
Delete Packagist service for a project.
```
DELETE /projects/:id/services/packagist
```
### Get Packagist service settings
Get Packagist service settings for a project.
```
GET /projects/:id/services/packagist
```
2016-12-05 09:40:53 -05:00
## Pipeline-Emails
Get emails for GitLab CI pipelines.
### Create/Edit Pipeline-Emails service
Set Pipeline-Emails service for a project.
```
PUT /projects/:id/services/pipelines-email
```
Parameters:
2016-12-12 08:27:52 -05:00
| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `recipients` | string | yes | Comma-separated list of recipient email addresses |
| `add_pusher` | boolean | no | Add pusher to recipients list |
2017-03-17 19:06:11 -04:00
| `notify_only_broken_pipelines` | boolean | no | Notify only broken pipelines |
2016-12-05 09:40:53 -05:00
### Delete Pipeline-Emails service
Delete Pipeline-Emails service for a project.
```
DELETE /projects/:id/services/pipelines-email
```
### Get Pipeline-Emails service settings
Get Pipeline-Emails service settings for a project.
```
GET /projects/:id/services/pipelines-email
```
2015-08-26 19:58:49 -04:00
## PivotalTracker
Project Management Software (Source Commits Endpoint)
### Create/Edit PivotalTracker service
Set PivotalTracker service for a project.
```
PUT /projects/:id/services/pivotaltracker
```
Parameters:
- `token` (**required**)
2016-08-10 10:15:27 -04:00
- `restrict_to_branch` (optional) - Comma-separated list of branches which will be automatically inspected. Leave blank to include all branches.
2015-08-26 19:58:49 -04:00
### Delete PivotalTracker service
Delete PivotalTracker service for a project.
```
DELETE /projects/:id/services/pivotaltracker
```
2015-09-03 09:38:54 -04:00
### Get PivotalTracker service settings
Get PivotalTracker service settings for a project.
```
GET /projects/:id/services/pivotaltracker
```
2015-08-26 19:58:49 -04:00
## Pushover
Pushover makes it easy to get real-time notifications on your Android device, iPhone, iPad, and Desktop.
### Create/Edit Pushover service
Set Pushover service for a project.
```
PUT /projects/:id/services/pushover
```
Parameters:
- `api_key` (**required**) - Your application key
- `user_key` (**required**) - Your user key
- `priority` (**required**)
- `device` (optional) - Leave blank for all active devices
- `sound` (optional)
### Delete Pushover service
Delete Pushover service for a project.
```
DELETE /projects/:id/services/pushover
```
2015-09-03 09:38:54 -04:00
### Get Pushover service settings
Get Pushover service settings for a project.
```
GET /projects/:id/services/pushover
```
2015-08-26 19:58:49 -04:00
## Redmine
Redmine issue tracker
### Create/Edit Redmine service
Set Redmine service for a project.
```
PUT /projects/:id/services/redmine
```
Parameters:
- `new_issue_url` (**required**) - New Issue url
- `project_url` (**required**) - Project url
- `issues_url` (**required**) - Issue url
- `description` (optional) - Redmine issue tracker
### Delete Redmine service
Delete Redmine service for a project.
```
DELETE /projects/:id/services/redmine
```
2015-09-03 09:38:54 -04:00
### Get Redmine service settings
Get Redmine service settings for a project.
```
GET /projects/:id/services/redmine
```
2016-11-25 14:36:37 -05:00
## Slack notifications
2015-08-26 19:58:49 -04:00
2016-11-25 14:36:37 -05:00
Receive event notifications in Slack
2015-08-26 19:58:49 -04:00
### Create/Edit Slack service
Set Slack service for a project.
```
PUT /projects/:id/services/slack
```
Parameters:
- `webhook` (**required**) - https://hooks.slack.com/services/...
- `username` (optional) - username
- `channel` (optional) - #channel
### Delete Slack service
Delete Slack service for a project.
```
DELETE /projects/:id/services/slack
```
2015-09-03 09:38:54 -04:00
### Get Slack service settings
Get Slack service settings for a project.
```
GET /projects/:id/services/slack
```
2016-11-25 14:36:37 -05:00
## Mattermost notifications
Receive event notifications in Mattermost
### Create/Edit Mattermost notifications service
Set Mattermost service for a project.
```
PUT /projects/:id/services/mattermost
```
Parameters:
- `webhook` (**required**) - https://mattermost.example/hooks/1298aff...
- `username` (optional) - username
- `channel` (optional) - #channel
### Delete Mattermost notifications service
Delete Mattermost Notifications service for a project.
```
DELETE /projects/:id/services/mattermost
```
### Get Mattermost notifications service settings
Get Mattermost notifications service settings for a project.
```
GET /projects/:id/services/mattermost
```
2015-08-26 19:58:49 -04:00
## JetBrains TeamCity CI
A continuous integration and build server
### Create/Edit JetBrains TeamCity CI service
Set JetBrains TeamCity CI service for a project.
> The build configuration in Teamcity must use the build format number %build.vcs.number% you will also want to configure monitoring of all branches so merge requests build, that setting is in the vsc root advanced settings.
```
PUT /projects/:id/services/teamcity
```
Parameters:
- `teamcity_url` (**required**) - TeamCity root URL like https://teamcity.example.com
- `build_type` (**required**) - Build configuration ID
- `username` (**required**) - A user with permissions to trigger a manual build
- `password` (**required**)
### Delete JetBrains TeamCity CI service
Delete JetBrains TeamCity CI service for a project.
```
DELETE /projects/:id/services/teamcity
```
2015-09-03 09:38:54 -04:00
### Get JetBrains TeamCity CI service settings
Get JetBrains TeamCity CI service settings for a project.
```
GET /projects/:id/services/teamcity
```
2016-10-26 11:12:39 -04:00
2017-02-03 13:41:35 -05:00
[jira-doc]: ../user/project/integrations/jira.md
2016-11-22 12:31:34 -05:00
[old-jira-api]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-13-stable/doc/api/services.md#jira
2017-02-14 20:52:44 -05:00
## MockCI
Mock an external CI. See [`gitlab-org/gitlab-mock-ci-service` ](https://gitlab.com/gitlab-org/gitlab-mock-ci-service ) for an example of a companion mock service.
This service is only available when your environment is set to development.
### Create/Edit MockCI service
Set MockCI service for a project.
```
PUT /projects/:id/services/mock-ci
```
Parameters:
- `mock_service_url` (**required**) - http://localhost:4004
### Delete MockCI service
Delete MockCI service for a project.
```
DELETE /projects/:id/services/mock-ci
```
### Get MockCI service settings
Get MockCI service settings for a project.
```
GET /projects/:id/services/mock-ci
```