Get last draft by service

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

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

If the data included in the request is correct —both businessId and serviceId—, the response will contain the last draft with its assignments.

Below is an example of the response:

{
    "orquestId": 123456,
    "from": "2025-06-23",
    "to": "2025-06-29",
    "assignments": [
        {
            "blockedType": "NON_EXTENSIBLE_TIME",
            "person": "0001",
            "day": "2025-06-26",
            "presence": {
                "worked": true,
                "timeFrames": [
                    {
                        "startMinuteDay": 1080,
                        "duration": 420,
                        "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-GENERAL",
                            "id": "AUTO",
                            "zone": "General"
                        },
                        "worked": true
                    },
                    {
                        "startMinuteDay": 1500,
                        "duration": 60,
                        "paid": true,
                        "location": {
                            "color": "#2c3f71",
                            "description": "Administrative closing tasks.",
                            "name": "Closing MANAGER",
                            "shortName": "MAN",
                            "requiredLevel": 3,
                            "priority": 5,
                            "maxResources": 1,
                            "type": "VARIABLE",
                            "shouldAvoidOvercover": true,
                            "system": false,
                            "category": "ADMINISTRATIVE",
                            "product": "0001-GENERAL",
                            "id": "CLOSE_AUX",
                            "zone": "General"
                        },
                        "worked": true
                    }
                ]
            }
        }
    ]
}

Considerations

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

If there is no draft for the requested date, the request will return a 404 Not Found error.

If the service specified in the URL does not exist in the business, the request will return a 404 Not Found error with the message not exits.

What is an assignment? How is its structure?

What is a task?