You can configure webhook endpoints to be notified about Task status changes.

Event Object

The webhooks return an Event object**,** with the following attributes

  • type : event type (ex: task.completed)
  • data : event payload
    • task
      • id : task id
      • status : the new task status
    • info
      • any additional info from the task’s integrations information
  • sentAt : datetime at which the webhook is sent
{
  "type": "task.completed",
  "data": {
    "task": {
      "id": "1",
      "status": {
        "name": "DONE",
        "userId": "1",
        "at": "2023-10-27T13:57:12.924742+00:00"
      }
    },
    "info": {}
  },
  "sentAt": "2023-10-27T13:57:12.933484+00:00"
}

Event types

We currently support the following webhooks

  • on_assign : when a Task goes from TODOASSIGNED status

    → type task.assigned

  • on_unassign : when a Task goes from ASSIGNEDTODO status

    → type task.unassigned

  • on_start : when a Task goes from ASSIGNEDSTARTED status

    → type task.started

  • on_pause : when a Task goes from STARTEDASSIGNED status

    → type task.paused

  • on_complete : when a Task goes from STARTEDDONE status

    → type task.completed

Registering a webhook

  1. Register the webhook on your Fragment account, and write down the ID. For example webhook_1234 (for now, you need to ask someone from the Fragment’s team to do it for you)
  2. Add the webhook’s ID to the task integrations payload as follows
{
    "id": "1",
		"title": "Test",
    "url": "https://google.com"
    "integrations": {
        "webhook_1234": {
						"externalId": "123"
				}
    },
    "status": {
        "at": "2023-10-27T14:16:51.173671+00:00",
        "name": "TODO"
    },
    "tags": {
        "name": "test",
        "priority": "High"
    },
		"createdAt": "2023-10-27T14:16:51.173671+00:00",
    "dueAt": "2023-10-27T14:16:51.173671+00:00",
}

The externalId will be returned as part of the webhooks

Example

  1. Create a webhook receiver endpoint on https://webhook.site
  2. Register it with ID webhook_1234
  3. Create a task with the integrations information (see above)
"integrations": {
      "webhook_1234": {
					"externalId": "abc"
			}
  },
  1. Use Fragment to assign or start the task
  2. Go back to your webhook, you should see a new payload
{
  "type": "task.started",
  "data": {
    "task": {
      "id": "1",
      "status": {
        "name": "STARTED",
        "userId": "1",
        "at": "2023-10-27T14:10:19.225944+00:00"
      }
    },
    "info": {
			"externalId": "abc"
		}
  },
  "sentAt": "2023-10-27T14:10:19.234762+00:00"
}

Webhook site