Discussions

Ask a Question
Back to All

Creating Attendences sometimes gives 400 Bad Request "Attendance day for employee '<id>` was found on '<date>'."

Hello!

After creating about 5000-7000 attendances the API returns a 400 Bad Request.

{
    "success": false,
    "error": {
        "code": 400,
        "message": "Error when trying to insert Attendances periods rows",
        "detailed_message": [
            {
                "success": false,
                "error_msg": "Attendance day for employee '<id>` was found on '2021-10-15'.",
                "id": null,
                "employee": "<id>",
                "date": "2021-10-15",
                "start_time": "12:15",
                "end_time": "13:15",
                "break": 0,
                "comment": "<comment>",
                "project_id": null,
                "id_v2": "<id>"
            }
        ]
    }
}

When trying to reproduce the response via sending the POST requests for a specific user, the request succeeds, which indicates that our requests have a valid body.

It seems to occur only after about 5000-7000 requests.

We are adhering to the global rate limit of 2000 requests per minute.

We are using the endpoint: https://api.personio.de/v1/company/attendances.

This seems to be an uncommon issue with your API, since we searched a lot of discussions, and this appears to be the only time this was reported before: https://developer.personio.de/v2.0/discuss/64ca18e3f5676200443a2a37. Unfortunately, the discussion does not have a concluding answer.

I am happy to provide more information. Thanks in advance!