Transifex

  • Documentation
  • API 2.5 (Deprecated)
  • Webhooks

Webhooks

We are deprecating the API versions namely API v2 and v2.5, to make way for the more usable and maintainable API v3.

As of April 7th, 2022 the API versions 2 and 2.5 will no longer be operational and relevant requests will begin to fail.

The Webhooks endpoint handles READ/UPDATE operations for webhooks in a project.

You must authenticate with a token when calling this endpoint.

Getting a list of webhooks for a project

URL: https://api.transifex.com/organizations/<org_slug>/projects/<project_slug>/webhooks/

GET

This request is used to get list of webhooks for a given project.

Example:

curl -i --user api:<token> -X GET https://api.transifex.com/organizations/transifex/projects/website-project/webhooks/
HTTP/1.0 200 OK
...
[   
    {
        "id":12345,
        "secret_key":"my secret",
        "url":"https://hooks.zapier.com/hooks/catch/2543117/2prft5/",
        "event_type":"translation_completed",
        "status":"active"
    }, …
]

Creating a new webhook

URL: https://api.transifex.com/organizations/<org_slug>/projects/<project_slug>/webhooks/

POST

This request is used to create a new webhook for a project.

The allowed parameters are:

  • secret_key (optional) - the secret key of the webhook, can be numbers of characters
  • url - the URL the webhook should call
  • event_type - the event type of the webhook: all_events, translation_completed, review_completed, proofread_completed, or fillup_completed
  • status - whether the webhook should be set to active or inactive

Example:

curl -i --user api:<token> -X POST https://api.transifex.com/organizations/transifex/projects/website-project/webhooks/ -d '{"url":"https://hooks.zapier.com/hooks/catch/2543117/2prft5/","status":"active","event_type":"translation_completed", "secret_key": "my secret"}' -H "Content-Type: application/json"
HTTP/1.0 200 OK
...

{
    "id": 12346 
    "secret_key":"my secret",
    "url":"https://hooks.zapier.com/hooks/catch/2543117/2prft5/",
    "event_type":"translation_completed",
    "status":"active"
}

Getting details for a webhook

URL https://api.transifex.com/organizations/<org_slug>/projects/<project_slug>/webhooks/<webhook_id>/

GET

This request is used to get details of a specific webhook for a project.

Example:

curl -i --user api:<token> -X GET https://api.transifex.com/organizations/transifex/projects/website-project/webhooks/12345/ 
HTTP/1.0 200 OK
...
{
    "id":12345,
    "secret_key":"my secret",
    "url":"https://hooks.zapier.com/hooks/catch/2543117/2prft5/",
    "event_type":"translation_completed",
    "status":"active"
}

Updating a webhook

URL: https://api.transifex.com/organizations/<org_slug>/projects/<project_slug>/webhooks/<webhook_id>

PATCH

This request is used to edit details of a specific webhook for a project (URL, secret, event type, or status).

Example:

curl -i --user api:<token> -X PATCH https://api.transifex.com/organizations/transifex/projects/website-project/webhooks/12345/ -d '{"event_type":"review_completed"}' -H "Content-Type: application/json"
HTTP/1.0 200 OK
...
{
    "id":12345,
    "secret_key":"my secret",
    "url":"https://hooks.zapier.com/hooks/catch/2543117/2prft5/",
    "event_type":"review_completed",
    "status":"active"
}

Deleting a webhook

URL: https://api.transifex.com/organizations/<org_slug>/projects/<project_slug>/webhooks/<webhook_id>

DELETE

This request is used to delete a webhook from a project.

Example:

curl -i --user api:<token> -X DELETE https://api.transifex.com/organizations/transifex/projects/website-project/webhooks/12345/
HTTP/1.1 204 No Content