Using Deveo Webhooks

Webhooks can be used to notify external services when a project has been created, deleted or updated (company hook), a repository has been created (project hook) or when new commits have been pushed to a repository (repository hook). Deveo will send a HTTP POST request with a JSON payload to the configured endpoint url. Any endpoint that is capable of processing the request can be used.

Adding a webhook


In order to create a company hook, select hooks from the left menu in the company scope. You can find the similar section also in the project scope, where a project or a repository webhook can be created. All types of hooks require the same parameters to be set:
  • Url - The endpoint url to which the payload will be delivered.
  • Secret - An optional string that’s passed with the HTTP requests as an X-Hub-Signature header. The value of this header is computed as the HMAC SHA1 hex digest of the body, using the secret as the key.
  • Content-type - Defines how the payload is serialised. Supported values are form (application/x-www-form-urlencoded) and json (application/json). Default value is form.
  • Insecure ssl - Check this option if your endpoint is using a SSL certificate that cannot be verified (e.g. a self-signed certificate).

Example payloads


Example JSON payload for new project created webhook:
{
    "operation": "created",
    "type": "project",
    "subject": {
        "id": "chuck", "uuid": "a94ea07c-4590-4dc9-b397-c83ca5daf976"
    },
    "project": {
        "id": "test_project", "uuid": "c788fd2a-788c-4888-8673-90e027b1b849",
        "name": "Test project", "description": "Lorem ipsum", "visibility": "company"
    }
}

Example JSON payload for new repository created webhook:
{
    "operation": "created",
    "type": "repository",
    "subject": {
        "id": "chuck", "uuid": "a94ea07c-4590-4dc9-b397-c83ca5daf976"
    },
    "project": {
        "id": "test_project", "uuid": "c788fd2a-788c-4888-8673-90e027b1b849",
        "name": "Test project"
    },
    "repository": {
        "id": "website", "uuid": "ff8f33e9-d619-493e-872d-be7dd4a10235"
        "type": "git"
    }
}

Example JSON payload for new commit pushed webhook
{
    "after": "67ec79c2cc2737eec07b649555b3da32c47d095b",
    "ref": "refs/heads/master",
    "before": "c58a421ed77556d217abc7638de9ba9b3589b36d",
    "compare": "",
    "forced": false,
    "created": false,
    "deleted": false,     "project": {
    "uuid": "c788fd2a-788c-4888-8673-90e027b1b849",
    "name": "Test project",
        "url": "https://deveo.com/example/code/diff/test"
    },
    "repository": { "uuid": "ff8f33e9-d619-493e-872d-be7dd4a10235",
        "name": "website",
        "type": "git",
        "url": "https://deveo.com/example/code/overview/test/repositories/website",
        "https_url": "https://deveo.com/example/projects/test/repositories/git/website",
        "ssh_url": "deveo@deveo.com:deveo/projects/test/repositories/git/website",
        "owner": { "uuid": "a94ea07c-4590-4dc9-b397-c83ca5daf976",
            "name": "chuck",
            "email": "chuck@deveo.com"
        }
    },
    "pusher": { "uuid": "a94ea07c-4590-4dc9-b397-c83ca5daf976",
        "name": "chuck",
        "display_name": "Chuck Norris"
    },
    "commit_count": 1,
    "commits": [{
        "distinct": true,
        "removed": [],
        "message": "Update readme",
        "added": [],
        "timestamp": "2015-01-30T12:17:56Z",
        "modified": ["readme"],
        "url": "https://deveo.com/example/code/diff/test/repositories/website/commits/67ec79c2cc2737eec07b649555b3da32c47d095b",
        "author": {
            "name": "Chuck Norris",
            "email": "chuck@deveo.com"
        },
        "id": "67ec79c2cc2737eec07b649555b3da32c47d095b"
    }]
}


Feedback and Knowledge Base