{ "openapi": "3.1.0", "info": { "title": "Webhooks", "description": "Trados Cloud Platform Webhooks.", "version": "1.0", "contact": {} }, "servers": [ { "url": "http://localhost:3000" } ], "paths": {}, "components": { "schemas": { "error-task-event": { "title": "Error Task Event", "type": "object", "properties": { "id": { "type": "string", "description": "The error task identifier." }, "status": { "type": "string", "enum": [ "created", "inProgress", "finished", "skipped", "failed" ], "description": "The error task status." }, "outcome": { "type": "string", "description": "The error task outcome.\\\nReturned if the error task was finished.", "enum": [ "done", "accepted", "rejected", "negotiated", "discarded", "retried", "cancelled" ], "nullable": true }, "taskType": { "$ref": "#/components/schemas/error-task-event-task-type", "description": "The task type." }, "project": { "$ref": "#/components/schemas/error-task-event-project", "description": "The project containing the error task." }, "owner": { "$ref": "#/components/schemas/task-event-owner", "description": "The task owner. Returned if the task has an owner." }, "location": { "$ref": "#/components/schemas/object-id", "description": "The project location." }, "assignees": { "type": "array", "description": "The error task assignees.", "items": { "$ref": "#/components/schemas/error-task-event-assignees" } }, "createdAt": { "type": "string", "format": "date-time", "description": "The project's creation date and time.\n\nGMT Timezone\n\nAllowed formats:\\\n\"YYYY-MM-DDThh:mmZ\"\\\n\"YYYY-MM-DDThh:mm:ssZ\"\\\n\"YYYY-MM-DDThh:mm:ss.sZ\"\\\n\"YYYY-MM-DDThh:mm:ss.ssZ\"\\\n\"YYYY-MM-DDThh:mm:ss.sssZ\"" }, "completedAt": { "type": "string", "format": "date-time", "description": "The completion timestamp of the task. \n \nGMT Timezone\n\nAllowed formats:\\\n\"YYYY-MM-DDThh:mmZ\"\\\n\"YYYY-MM-DDThh:mm:ssZ\"\\\n\"YYYY-MM-DDThh:mm:ss.sZ\"\\\n\"YYYY-MM-DDThh:mm:ss.ssZ\"\\\n\"YYYY-MM-DDThh:mm:ss.sssZ\"" }, "dueBy": { "format": "date-time", "type": "string", "description": "The project due date.\n\nGMT Timezone\n\nAllowed formats:\\\n\"YYYY-MM-DDThh:mmZ\"\\\n\"YYYY-MM-DDThh:mm:ssZ\"\\\n\"YYYY-MM-DDThh:mm:ss.sZ\"\\\n\"YYYY-MM-DDThh:mm:ss.ssZ\"\\\n\"YYYY-MM-DDThh:mm:ss.sssZ\"" }, "failedTask": { "$ref": "#/components/schemas/error-task-event-failed-task", "description": "The failed task associated with the error task." } }, "required": [ "id", "status", "taskType", "assignees" ] }, "error-task-event-assignees": { "title": "Error Task Event Assignees", "type": "object", "properties": { "type": { "type": "string" }, "user": { "$ref": "#/components/schemas/object-id" }, "group": { "$ref": "#/components/schemas/object-id" }, "vendorOrderTemplate": { "$ref": "#/components/schemas/object-id" } } }, "error-task-event-project": { "title": "Error Task Event Project", "type": "object", "properties": { "id": { "type": "string", "description": "The project identifier." }, "name": { "type": "string", "description": "The project name." }, "description": { "type": "string", "description": "The project description." } }, "required": [ "id" ] }, "error-task-event-task-type": { "title": "Error Task Event Task Type", "type": "object", "properties": { "id": { "type": "string", "description": "The error task type identifier." }, "key": { "type": "string", "description": "The error task type key." }, "automatic": { "type": "boolean", "nullable": true, "description": "The error task is automatic or manual." } }, "required": [ "id", "key", "automatic" ] }, "error-task-event-failed-task": { "title": "Error Task Event Failed Task", "type": "object", "properties": { "id": { "type": "string", "description": "The failed task identifier." }, "name": { "type": "string", "description": "The failed task name." }, "errors": { "type": "array", "nullable": true, "description": "The occured errors.", "items": { "$ref": "#/components/schemas/failed-task-error" } }, "failedTaskType": { "$ref": "#/components/schemas/failed-task-type", "description": "The failed task type." }, "input": { "$ref": "#/components/schemas/task-input" } }, "required": [ "id", "name", "input" ] }, "failed-task-error": { "title": "Failed Task Error", "type": "object", "properties": { "name": { "type": "string", "description": "The error name." }, "code": { "type": "string", "description": "The error code." }, "value": { "type": "string", "nullable": true, "description": "The error value." } } }, "failed-task-type": { "title": "Failed Task Type", "type": "object", "properties": { "id": { "type": "string", "description": "The failed task type identifier." }, "key": { "type": "string", "description": "The failed task type key." } }, "required": [ "id" ] }, "object-id": { "title": "Object Identifier", "type": "object", "description": "An object with identifier.", "properties": { "id": { "type": "string" } }, "required": [ "id" ] }, "project-event": { "title": "Project Event", "type": "object", "properties": { "id": { "type": "string", "description": "The project identifier." }, "name": { "type": "string", "description": "The project name." }, "description": { "type": "string", "description": "The project description." }, "customFields": { "description": "The custom fields.", "type": "array", "items": { "$ref": "#/components/schemas/project-event-custom-field" } } }, "required": [ "id", "name" ] }, "project-event-custom-field": { "title": "Project Event Custom Field", "type": "object", "properties": { "id": { "type": "string", "description": "The custom field identifier." }, "key": { "type": "string", "description": "The custom field key." }, "value": { "type": "string", "description": "The custom field value." } }, "required": [ "id" ] }, "project-group-event": { "title": "Project Group Event", "type": "object", "properties": { "id": { "type": "string", "description": "The project group identifier." }, "action": { "type": "string", "description": "The action performed. ", "enum": [ "ATTACH", "DETACH" ] }, "projects": { "type": "array", "description": "The projects added or removed.", "items": { "$ref": "#/components/schemas/object-id" } } }, "required": [ "id", "action", "projects" ] }, "project-template-event": { "title": "Project Template Event", "type": "object", "properties": { "id": { "type": "string", "description": "The project template identifier." }, "name": { "type": "string", "description": "The project template name." }, "description": { "type": "string", "description": "The project template description." } }, "required": [ "id", "name" ] }, "source-file-event": { "title": "Source File Event", "type": "object", "properties": { "id": { "type": "string", "description": "The source file identifier." }, "name": { "type": "string", "description": "The source file name." }, "role": { "type": "string", "description": "The source file role." }, "project": { "$ref": "#/components/schemas/object-id", "description": "The project containing the source file." } }, "required": [ "id", "name", "project" ] }, "target-file-event": { "title": "Target File Event", "type": "object", "properties": { "id": { "type": "string", "description": "The target file identifier." }, "name": { "type": "string", "description": "The target file name." }, "role": { "type": "string", "description": "The target file role." }, "project": { "$ref": "#/components/schemas/object-id", "description": "The project containing the target file." } }, "required": [ "id", "name", "project" ] }, "task-event": { "title": "Task Event", "type": "object", "properties": { "id": { "type": "string", "description": "The task identifier." }, "status": { "type": "string", "enum": [ "created", "inProgress", "finished", "skipped", "failed" ], "description": "The task status." }, "outcome": { "type": "string", "description": "Returned if the task was finished.", "enum": [ "done", "accepted", "rejected", "negotiated", "discarded", "retried", "cancelled" ], "nullable": true }, "taskType": { "$ref": "#/components/schemas/task-event-task-type", "description": "The task type." }, "project": { "$ref": "#/components/schemas/object-id", "description": "The project containing the task." }, "owner": { "$ref": "#/components/schemas/task-event-owner", "description": "The task owner. Returned if the task has an owner." }, "location": { "$ref": "#/components/schemas/object-id", "description": "The project location." }, "assignees": { "type": "array", "description": "The task assignees.", "items": { "$ref": "#/components/schemas/task-event-assignees" } }, "dueBy": { "type": "string", "format": "date-time", "description": "The project due date.\n\nGMT Timezone\n\nAllowed formats:\\\n\"YYYY-MM-DDThh:mmZ\"\\\n\"YYYY-MM-DDThh:mm:ssZ\"\\\n\"YYYY-MM-DDThh:mm:ss.sZ\"\\\n\"YYYY-MM-DDThh:mm:ss.ssZ\"\\\n\"YYYY-MM-DDThh:mm:ss.sssZ\"" }, "input": { "$ref": "#/components/schemas/task-input" }, "apiInternalId": { "type": "string", "description": "The internal id of the task. This field is not available for non-workflow tasks", "nullable": true } }, "required": [ "id", "status", "taskType", "assignees", "input" ] }, "task-event-assignees": { "title": "Task Event Assignees", "type": "object", "properties": { "type": { "type": "string", "description": "The assignee type.", "enum": [ "user", "group", "vendorOrderTemplate", "projectCreator", "projectManager" ] }, "user": { "$ref": "#/components/schemas/object-id", "description": "User in the account." }, "group": { "$ref": "#/components/schemas/object-id", "description": "Group of Users." }, "vendorOrderTemplate": { "$ref": "#/components/schemas/object-id", "description": "The vendor order template." } } }, "task-event-owner": { "title": "Task Event Owner", "type": "object", "description": "Task owner. Based on the \"type\", the following properties can be retrieved: \"user\" or \"group\".", "properties": { "type": { "type": "string", "enum": [ "user", "group" ], "description": "The owner type." }, "user": { "$ref": "#/components/schemas/object-id", "description": "The user who owns this task." }, "group": { "$ref": "#/components/schemas/object-id", "description": "The group that owns this task." }, "id": { "type": "string", "description": "The owner's account user identifier.", "deprecated": true } }, "required": [ "type" ] }, "task-event-task-type": { "title": "Task Event Task Type", "type": "object", "properties": { "id": { "type": "string", "description": "The task type identifier." }, "key": { "type": "string", "description": "The task type key." }, "automatic": { "type": "boolean", "nullable": true, "description": "Is task automatic or manual." } }, "required": [ "id", "key", "automatic" ] }, "task-input": { "title": "Task Input", "type": "object", "x-stoplight": { "id": "task-input" }, "description": "Information about the task input. Currently only `sourceFile` and `targetFile` objects are populated in webhook events.", "properties": { "id": { "type": "string", "description": "The input identifier." }, "inputType": { "type": "string", "enum": [ "sourceFile", "targetFile", "languageDirection", "project" ], "description": "The type of input." }, "sourceFile": { "$ref": "#/components/schemas/task-input-source-file", "description": "Source file information. Present when inputType is sourceFile." }, "targetFile": { "$ref": "#/components/schemas/task-input-target-file", "description": "Target file information. Present when inputType is targetFile." } }, "required": [ "id", "inputType" ] }, "task-input-source-file": { "title": "Task Input Source File", "type": "object", "x-stoplight": { "id": "task-input-source-file" }, "description": "Source file information for task input.", "properties": { "fileVersionId": { "type": "string", "description": "The file version identifier." }, "version": { "type": "integer", "description": "The file version number." }, "type": { "type": "string", "enum": [ "native", "bcm" ], "description": "The file type." } }, "required": [ "fileVersionId", "version", "type" ] }, "task-input-target-file": { "title": "Task Input Target File", "type": "object", "x-stoplight": { "id": "task-input-target-file" }, "description": "Target file information for task input. Extends source file with additional sourceFileId.", "allOf": [ { "$ref": "#/components/schemas/task-input-source-file" }, { "type": "object", "properties": { "sourceFileId": { "type": "string", "description": "The identifier of the source file associated with this target file." } }, "required": [ "sourceFileId", "type" ] } ] }, "webhook": { "title": "Webhook", "type": "object", "description": "For correlation between `eventType` and `data`, please check the [Webhook Payload](../docs/webhooks/Webhooks-payload.html) page.", "properties": { "eventId": { "type": "string", "description": "The event identifier." }, "eventType": { "type": "string", "description": "The type of event.", "enum": [ "PROJECT.TASK.CREATED", "PROJECT.TASK.ACCEPTED", "PROJECT.TASK.COMPLETED", "PROJECT.TASK.UPDATED", "PROJECT.TASK.DELETED", "PROJECT.CREATED", "PROJECT.UPDATED", "PROJECT.STARTED", "PROJECT.DELETED", "PROJECT.TEMPLATE.CREATED", "PROJECT.TEMPLATE.UPDATED", "PROJECT.TEMPLATE.DELETED", "PROJECT.SOURCE.FILE.CREATED", "PROJECT.SOURCE.FILE.UPDATED", "PROJECT.SOURCE.FILE.DELETED", "PROJECT.TARGET.FILE.CREATED", "PROJECT.TARGET.FILE.UPDATED", "PROJECT.TARGET.FILE.DELETED", "PROJECT.GROUP.PROJECT.MEMBERSHIP.CHANGE", "PROJECT.ERROR.TASK.CREATED", "PROJECT.ERROR.TASK.COMPLETED", "PROJECT.ERROR.TASK.ACCEPTED" ] }, "version": { "type": "string", "description": "The webhook version." }, "timestamp": { "type": "string", "description": "The time when the event occurred.", "format": "date-time" }, "accountId": { "type": "string", "description": "The account identifier." }, "data": { "description": "Data specific to event. Is different for each event type", "oneOf": [ { "$ref": "#/components/schemas/error-task-event" }, { "$ref": "#/components/schemas/project-event" }, { "$ref": "#/components/schemas/project-group-event" }, { "$ref": "#/components/schemas/project-template-event" }, { "$ref": "#/components/schemas/source-file-event" }, { "$ref": "#/components/schemas/target-file-event" }, { "$ref": "#/components/schemas/task-event" } ] } }, "required": [ "eventId", "eventType", "version", "timestamp", "accountId", "data" ] }, "webhook-batch": { "title": "Webhook Batch", "type": "object", "description": "Payload containing one or more webhook events.", "properties": { "itemCount": { "type": "integer" }, "items": { "type": "array", "items": { "$ref": "#/components/schemas/webhook", "description": "For correlation between `eventType` and `data`, please check the [Webhook Payload](../docs/webhooks/Webhooks-payload.html) page." } } } } } } }