Webhooks

Note:This resource is not available in PhraseApp Enterprise

GET /v2/projects/:project_id/webhooks

List all webhooks for the given project.

This endpoint is paginated.

Example Request

curl "https://api.phraseapp.com/api/v2/projects/:project_id/webhooks" \
  -u USERNAME_OR_ACCESS_TOKEN
phraseapp webhooks list <project_id>

Response

Status: 200
[ { "id": "abcd1234cdef1234abcd1234cdef1234", "callback_url": "http://example.com/hooks/phraseapp-notifications", "description": "My webhook for chat notifications", "events": "locales:create,translations:update", "active": true, "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z" }, { "id": "abcd1234cdef1234abcd1234cdef1234", "callback_url": "http://example.com/hooks/phraseapp-notifications", "description": "My webhook for chat notifications", "events": "locales:create,translations:update", "active": true, "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z" } ]

GET /v2/projects/:project_id/webhooks/:id

Get details on a single webhook.

Example Request

curl "https://api.phraseapp.com/api/v2/projects/:project_id/webhooks/:id" \
  -u USERNAME_OR_ACCESS_TOKEN
phraseapp webhook show <project_id> <id>

Response

Status: 200
{ "id": "abcd1234cdef1234abcd1234cdef1234", "callback_url": "http://example.com/hooks/phraseapp-notifications", "description": "My webhook for chat notifications", "events": "locales:create,translations:update", "active": true, "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z" }

POST /v2/projects/:project_id/webhooks

Create a new webhook.

Parameters

Name Type Description
callback_url string Callback URL to send requests to
description
optional
string Webhook description
events string List of event names to trigger the webhook (separated by comma)
active
optional
boolean Whether webhook is active or inactive
Default: true

Example Request

curl "https://api.phraseapp.com/api/v2/projects/:project_id/webhooks" \
  -u USERNAME_OR_ACCESS_TOKEN \
  -X POST \
  -d '{"callback_url":"http://example.com/hooks/phraseapp-notifications","description":"My webhook for chat notifications","events":"locales:create,translations:update"}' \
  -H 'Content-Type: application/json'
phraseapp webhook create <project_id> \
--callback-url "http://example.com/hooks/phraseapp-notifications" \
--description "My webhook for chat notifications" \
--events "locales:create,translations:update"

Response

Status: 201
{ "id": "abcd1234cdef1234abcd1234cdef1234", "callback_url": "http://example.com/hooks/phraseapp-notifications", "description": "My webhook for chat notifications", "events": "locales:create,translations:update", "active": true, "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z" }

PATCH /v2/projects/:project_id/webhooks/:id

Update an existing webhook.

Parameters

Name Type Description
callback_url string Callback URL to send requests to
description
optional
string Webhook description
events string List of event names to trigger the webhook (separated by comma)
active
optional
boolean Whether webhook is active or inactive
Default: true

Example Request

curl "https://api.phraseapp.com/api/v2/projects/:project_id/webhooks/:id" \
  -u USERNAME_OR_ACCESS_TOKEN \
  -X PATCH \
  -d '{"callback_url":"http://example.com/hooks/phraseapp-notifications","description":"My webhook for chat notifications","events":"locales:create,translations:update"}' \
  -H 'Content-Type: application/json'
phraseapp webhook update <project_id> <id> \
--callback-url "http://example.com/hooks/phraseapp-notifications" \
--description "My webhook for chat notifications" \
--events "locales:create,translations:update"

Response

Status: 200
{ "id": "abcd1234cdef1234abcd1234cdef1234", "callback_url": "http://example.com/hooks/phraseapp-notifications", "description": "My webhook for chat notifications", "events": "locales:create,translations:update", "active": true, "created_at": "2015-01-28T09:52:53Z", "updated_at": "2015-01-28T09:52:53Z" }

DELETE /v2/projects/:project_id/webhooks/:id

Delete an existing webhook.

Example Request

curl "https://api.phraseapp.com/api/v2/projects/:project_id/webhooks/:id" \
  -u USERNAME_OR_ACCESS_TOKEN \
  -X DELETE
phraseapp webhook delete <project_id> <id>

Response

Status: 204

POST /v2/projects/:project_id/webhooks/:id/test

Perform a test request for a webhook.

Example Request

curl "https://api.phraseapp.com/api/v2/projects/:project_id/webhooks/:id/test" \
  -u USERNAME_OR_ACCESS_TOKEN \
  -X POST
phraseapp webhook test <project_id> <id>

Response

Status: 200