Webhooks

Project’s webhooks

GET /api/v1/projects/:hash_id/hooks

Arguments

  • hash_id of the project

Response

Status: 200 OK
[
  {
    "id": 256,
    "url": "http://semaphoreflag.herokuapp.com/qH36J7zzMAxmF72f",
    "hook_type": "post_build"
  },
  {
    "id": 257,
    "url": "http://semaphoreflag.herokuapp.com/qH36sdffgae2f",
    "hook_type": "post_deploy"
  }
]

Create a hook

POST /api/v1/projects/:hash_id/hooks

Arguments

  • hash_id of the project

Body

{
  "url": "http://google.com",
  "hook_type": "all"
}

Required:

  • url for webhook - type string
  • hook_type trigger events - type string (“post_build”, “post_deploy” or “all”)

Response

Status: 200 OK
{
  "id": 266,
  "url": "http://google.com",
  "hook_type": "all"
}

Update a hook

PUT /api/v1/projects/:hash_id/hooks/:webhook_id

Arguments

  • hash_id of the project
  • webhook_id id of webhook

Body

{
  "url": "http://yahoo.com",
  "hook_type": "all"
}

Required:

  • url for webhook - type string
  • hook_type trigger events - type string (“post_build”, “post_deploy” or “all”)

Response

Status: 200 OK
{
  "id": 266,
  "url": "http://yahoo.com",
  "hook_type": "all"
}

Delete a hook

DELETE /api/v1/projects/:hash_id/hooks/:webhook_id

Arguments

  • hash_id of the project
  • webhook_id id of webhook

Response

Status: 204 No Content