Get last draft by product

This endpoint returns the last draft of a product for the specified day in the request.

GET /api/v1/businesses/{businessId}/products/{productId}/last-draft?day={yyyy-MM-dd}

If the data included in the request is correct —both businessId and productId—, the response will be a 200 OK with the last draft and its assignments.

Response example

{
    "orquestId": 102312,
    "from": "2026-08-10",
    "to": "2026-08-16",
    "assignments": [
        {
            "product": "0001-G",
            "blockedType": "NON_EXTENSIBLE_WORK",
            "person": "0001",
            "day": "2026-08-15",
            "presence": {
                "worked": false,
                "timeFrames": [
                    {
                        "startMinuteDay": 0,
                        "duration": 1425,
                        "paid": false,
                        "worked": false
                    }
                ]
            },
            "virtual": false
        },
        {
            "product": "0001-G",
            "blockedType": "NON_EXTENSIBLE_TIME",
            "person": "0002",
            "day": "2026-08-12",
            "presence": {
                "worked": true,
                "timeFrames": [
                    {
                        "startMinuteDay": 780,
                        "duration": 300,
                        "paid": true,
                        "location": {
                            "color": "#1ab39f",
                            "description": "Assembly tasks.",
                            "name": "AUTO",
                            "shortName": "AUT",
                            "requiredLevel": 3,
                            "priority": 3,
                            "type": "VARIABLE",
                            "shouldAvoidOvercover": false,
                            "system": false,
                            "category": "OPERATIONAL",
                            "product": "0001-G",
                            "id": "AUTO",
                            "zone": "General"
                        },
                        "worked": true
                    }
                ]
            },
            "virtual": false
        }
    ]
}
Details
  • orquestId: internal identifier of the draft in Orquest.

  • from: start date of the interval covered by the draft.

  • to: end date of the interval covered by the draft.

  • assignments: list of assignments in the draft. Each item follows the same structure as an assignment:

    • product: external identifier of the product (section) to which the assignment belongs.

    • blockedType: if the assignment is blocked and how (NONE, EXTENSIBLE_WORK, NON_EXTENSIBLE_WORK, EXTENSIBLE_TIME, NON_EXTENSIBLE_TIME, DAILY_WORKED).

    • person: employee external identifier.

    • day: day of the assignment in yyyy-MM-dd format.

    • presence: type of assignment that contains the work periods (timeFrames) with their locations. It contains the following fields:

      • startTime: the start time of the presence in minutes from the beginning of the day (00:00). It can be null, as the actual start time can be calculated as the sum of the durations of its time periods (timeFrames).

      • duration: the duration in minutes of the entire presence. Can be null, as the actual duration can be calculated as the sum of the durations of its timeFrames.

      • worked: whether the type of assignment or presence is worked (true) or if it is a rest day (false).

      • timeFrames: set of time intervals that contain the tasks to be performed. For each interval, the following information is included:

        • startMinuteDay: start of the interval in minutes elapsed since the beginning of the day (00:00).

        • duration: duration of the interval in minutes.

        • paid: whether the interval, whether work or rest, is paid (true) or not (false).

        • worked: determines if the timeFrame has an assigned task (true) or not (false).

        • location: task to be performed in the defined interval. For each task, the following information is included:

          • color: color configured in Orquest for the task.

          • description: description of the task defined in Orquest.

          • name: name of the task in Orquest.

          • shortName: task abbreviation in Orquest.

          • requiredLevel: skill level required to perform the task. Ranges from 0 (no training needed) to 3 (maximum training level) and must be previously configured in Orquest.

          • priority: priority of task coverage. Ranges from 0 (low) to 5 (high) and must be previously configured in Orquest.

          • maxResources: limit of people for the task.

          • type: type of task, whether it is fixed, variable, or non-plannable (FIXED, VARIABLE, NON_PLANIFIABLE).

          • shouldAvoidOvercover: if this parameter is true, the task will not be overcovered.

          • system: determines if the task was created by the system (true) or by the user (false).

          • category: category of the task previously configured in Orquest.

          • product: external identifier of the product or section.

          • id: external identifier of the task.

          • metadata: any additional data that has been previously configured for the task in Orquest. The metadata structure must be previously configured.

          • zone: physical place in the service (store, restaurant, etc.) where the location is carried out.

    • virtual: indicates whether the employee is virtual (true) or real (false).

Considerations

The level of detail in the response will depend on the configuration set in the business for the different tasks.

Error codes

In addition to the common errors, this endpoint can return the following codes:

Code Message Description

404 Not Found

—

There is no draft covering the day specified in the request. Unlike the 404 responses for an identifier that was not found, this response includes neither a body nor a message field.

What is an assignment?

What is a task?