The Task object is the core entity in Fragment. It represents a single item of work. It can be used as a one-off task that is generated as part of a broader workflow. It can also be used to represent a ticket that is passed along between different teams.

Example

In this first example, the task has the default fields title, url, and custom fields claim_id and country.
{
    "status": "TODO",
    "due_at": "2025-09-11T12:00:00.000Z",
    "fields": {
        "title": "Claim 123",
        "url": "https://backoffice.com/claims/123",
        "claim_id": "123", 
        "country": "FR"
    }
}

Fields

The task stores information about the task in the fields key. All tasks include two default fields:
  • title - A human-readable title for the task
  • url - An optional URL that provides additional context or links to related resources. The Fragment player will open this URL when the task is opened in the chrome extension.
You can also add custom fields to store any additional data relevant to your workflow.

Create a task

You can create a task by sending a POST request to the tasks endpoint. When a task is created, unless otherwise specified, it will be created with the TODO status and its due date will be set to the current date and time.
example.py
import requests

response = requests.post(
    "https://api.onfragment.com/api/v1/tasks",
    json={
        "fields": {
            # Push title + url
            "title": "Claim 123",
            "url": "https://backoffice.com/claims/123",
            # Add custom fields (relevant metadata)
            "claim_id": "123", 
            "country": "FR",
            # Any other key-value...
        },
    },
    headers={
        "Authorization": f"Bearer {token}",
        "Content-Type": "application/json",
        "User-Agent": "acme/1.0",
    }
)
response.raise_for_status()
data = response.json()
Both endpoints return a JSON of the corresponding resource with a 200 status code. This avoids additional calls. If you receive a 422 status code, your payload is invalid.

Schema

Task schema, same as Task Model.