Webhooks

Add Webhook

post/projects/{projectId}/webhooks

Request

Path parameters

projectIdinteger required

Project Identifier. Get via List Projects

Request body

namestring required

Webhook name

urlstring required

Webhook URL

eventsstring[] required

You can configure webhooks for the following events:

  • 'file.added' — project file is added
  • 'file.updated' - project file is updated
  • 'file.reverted' - project file is reverted
  • 'file.deleted' - project file is deleted
  • 'file.translated' — project file is fully translated
  • 'file.approved' — project file is fully reviewed
  • 'file.qa.finished' - project file QA check is finished
  • 'project.translated' — all strings in project are translated
  • 'project.approved' — all strings in project are approved
  • 'project.qa.finished' - all strings in project QA check are finished
  • 'project.built' - project are successfully built
  • 'preTranslation.completed' - Auto-Translation finishes, fails or is canceled
  • 'translation.updated' — final translation of string is updated (using Replace in suggestions feature)
  • 'string.added' — source string is added
  • 'string.updated' — source string is updated
  • 'string.deleted' — source string is deleted
  • 'string.labelsAssigned' — labels are assigned to source string
  • 'string.labelsUnassigned' — labels are unassigned from source string
  • 'label.created' — label is created
  • 'label.updated' — label is updated
  • 'label.deleted' — label is deleted
  • 'stringComment.created' - string comment/issue is added
  • 'stringComment.updated' - string comment/issue is updated
  • 'stringComment.deleted' - string comment/issue is deleted
  • 'stringComment.restored' - string comment/issue is restored
  • 'suggestion.added' — one of source strings is translated
  • 'suggestion.updated' — translation for source string is updated (using Replace in suggestions feature)
  • 'suggestion.deleted' — one of translations is deleted
  • 'suggestion.approved' — translation for string is approved
  • 'suggestion.disapproved' — approval for previously added translation is removed
  • 'task.added' - task is added
  • 'task.statusChanged' - task status was changed
  • 'task.updated' - task is updated
  • 'task.deleted' - task is deleted
requestType'POST' | 'GET' required

Webhook request type

isActiveboolean

Defines whether webhook is active

batchingEnabledboolean

Defines whether webhook batching is enabled

contentType'multipart/form-data' | 'application/json' | 'application/x-www-form-urlencoded'

Webhook content type

headersobject

Webhook headers

Example request

{
  "name": "Proofread",
  "url": "https://webhook.site/1c20d9b5-6e6a-4522-974d-9da7ea7595c9",
  "events": [
    "file.approved"
  ],
  "requestType": "POST",
  "batchingEnabled": true,
  "headers": {
    "Authorization": "Bearer <ACCESS_TOKEN>"
  },
  "payload": {
    "string.added": {
      "event": "{{event}}",
      "string": {
        "id": "{{stringId}}",
        "identifier": "{{stringIdentifier}}",
        "key": "{{stringKey}}",
        "text": "{{stringText}}",
        "type": "{{stringType}}",
        "context": "{{stringContext}}",
        "maxLength": "{{stringMaxLength}}",
        "isHidden": "{{stringIsHidden}}",
        "isDuplicate": "{{stringIsDuplicate}}",
        "masterStringId": "{{stringMasterStringId}}",
        "revision": "{{stringRevision}}",
        "hasPlurals": "{{stringHasPlurals}}",
        "plurals": "{{stringPlurals}}",
        "labelIds": "{{stringLabelIds}}",
        "url": "{{stringUrl}}",
        "createdAt": "{{stringCreatedAt}}",
        "updatedAt": "{{stringUpdatedAt}}",
        "file": {
          "id": "{{fileId}}",
          "name": "{{fileName}}",
          "title": "{{fileTitle}}",
          "type": "{{fileType}}",
          "path": "{{filePath}}",
          "status": "{{fileStatus}}",
          "revision": "{{fileRevision}}",
          "branchId": "{{branchId}}",
          "directoryId": "{{directoryId}}"
        },
        "project": {
          "id": "{{projectId}}",
          "userId": "{{projectUserId}}",
          "sourceLanguageId": "{{projectSourceLanguageId}}",
          "targetLanguageIds": "{{projectTargetLanguageIds}}",
          "identifier": "{{projectIdentifier}}",
          "name": "{{projectName}}",
          "createdAt": "{{projectCreatedAt}}",
          "updatedAt": "{{projectUpdatedAt}}",
          "lastActivity": "{{projectLastActivity}}",
          "description": "{{projectDescription}}",
          "url": "{{projectUrl}}",
          "cname": "{{projectCname}}",
          "logo": "{{projectLogo}}",
          "isExternal": "{{projectIsExternal}}",
          "externalType": "{{projectExternalType}}",
          "hasCrowdsourcing": "{{projectHasCrowdsourcing}}",
          "groupId": "{{projectGroupId}}"
        }
      },
      "user": {
        "id": "{{userId}}",
        "username": "{{userUsername}}",
        "fullName": "{{userFullName}}",
        "avatarUrl": "{{userAvatarUrl}}"
      }
    }
  }
}

Response

Webhook was successfully added

Example response

{
  "data": {
    "id": 4,
    "projectId": 2,
    "name": "Proofread",
    "url": "https://webhook.site/1c20d9b5-6e6a-4522-974d-9da7ea7595c9",
    "events": [
      "file.approved"
    ],
    "payload": {
      "string.added": {
        "event": "{{event}}",
        "string": {
          "id": "{{stringId}}",
          "identifier": "{{stringIdentifier}}",
          "key": "{{stringKey}}",
          "text": "{{stringText}}",
          "type": "{{stringType}}",
          "context": "{{stringContext}}",
          "maxLength": "{{stringMaxLength}}",
          "isHidden": "{{stringIsHidden}}",
          "isDuplicate": "{{stringIsDuplicate}}",
          "masterStringId": "{{stringMasterStringId}}",
          "revision": "{{stringRevision}}",
          "hasPlurals": "{{stringHasPlurals}}",
          "plurals": "{{stringPlurals}}",
          "labelIds": "{{stringLabelIds}}",
          "url": "{{stringUrl}}",
          "createdAt": "{{stringCreatedAt}}",
          "updatedAt": "{{stringUpdatedAt}}",
          "file": {
            "id": "{{fileId}}",
            "name": "{{fileName}}",
            "title": "{{fileTitle}}",
            "type": "{{fileType}}",
            "path": "{{filePath}}",
            "status": "{{fileStatus}}",
            "revision": "{{fileRevision}}",
            "branchId": "{{branchId}}",
            "branchName": "{{branchName}}",
            "directoryId": "{{directoryId}}"
          },
          "project": {
            "id": "{{projectId}}",
            "userId": "{{projectUserId}}",
            "sourceLanguageId": "{{projectSourceLanguageId}}",
            "targetLanguageIds": "{{projectTargetLanguageIds}}",
            "identifier": "{{projectIdentifier}}",
            "name": "{{projectName}}",
            "createdAt": "{{projectCreatedAt}}",
            "updatedAt": "{{projectUpdatedAt}}",
            "lastActivity": "{{projectLastActivity}}",
            "description": "{{projectDescription}}",
            "url": "{{projectUrl}}",
            "cname": "{{projectCname}}",
            "logo": "{{projectLogo}}",
            "isExternal": "{{projectIsExternal}}",
            "externalType": "{{projectExternalType}}",
            "hasCrowdsourcing": "{{projectHasCrowdsourcing}}",
            "groupId": "{{projectGroupId}}"
          }
        },
        "user": {
          "id": "{{userId}}",
          "username": "{{userUsername}}",
          "fullName": "{{userFullName}}",
          "avatarUrl": "{{userAvatarUrl}}"
        }
      }
    },
    "isActive": true,
    "batchingEnabled": true,
    "requestType": "GET",
    "contentType": "application/json",
    "createdAt": "2019-09-23T09:19:07+00:00",
    "updatedAt": "2019-09-23T09:19:07+00:00"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.