New API version v7.7.0 has been released! 🎉
REST Documentation
POST Create Employment Period

Create Employment Period

Create a new employment period for an employee.

Request

POST /api/v1/employees/{username}/employment-periods
curl --request POST \
     --url 'https://www.zep-online.de/zepinstanz/next/api/v1/employees/{username}/employment-periods' \
     --header 'Accept: application/json' \
     --header 'Authorization: Bearer {token}' \
     --header 'Content-Type: application/json' \
     --data '{
         "start_date": "2024-01-01",
         "end_date": "2024-12-31",
         "note": "Full-time employment as Senior Developer",
         "annual_leave_entitlement": 30,
         "beginning_of_year": "2024-01-01",
         "period_holiday_entitlement": 30,
         "is_holiday_per_year": true,
         "day_absent_in_hours": 8.0
     }'

Response

{
    "data": {
        "id": 789,
        "employee_id": "john.doe",
        "start_date": "2024-01-01",
        "end_date": "2024-12-31",
        "note": "Full-time employment as Senior Developer",
        "created": "2024-10-01T10:00:00.000000Z",
        "modified": "2024-10-01T10:00:00.000000Z"
    }
}

Path Parameters

  • Name
    username
    Type
    string
    Description

    The username of the employee for whom the employment period is being created.

Required Parameters

  • Name
    employee_id
    Type
    string
    Description

    The employee username. Max 32 characters. This is automatically set from the route parameter {username}. Must exist in employees table.

  • Name
    start_date
    Type
    date | Y-m-d
    Description

    Start date of the employment period. Must be before or equal to end_date if end_date is provided.

  • Name
    annual_leave_entitlement
    Type
    numeric
    Description

    Annual leave entitlement in days. Minimum 0.

Optional Parameters

  • Name
    end_date
    Type
    date | Y-m-d
    Description

    End date of the employment period. Leave empty for indefinite employment.

  • Name
    note
    Type
    string
    Description

    Notes about the employment period. Max 255 characters.

  • Name
    beginning_of_year
    Type
    date | Y-m-d
    Description

    Beginning of the year for vacation calculation purposes.

  • Name
    period_holiday_entitlement
    Type
    numeric
    Description

    Holiday entitlement for the period in days. Minimum 0.

  • Name
    is_holiday_per_year
    Type
    boolean
    Description

    Whether holiday entitlement is calculated per year.

  • Name
    day_absent_in_hours
    Type
    numeric
    Description

    Number of hours per absence day. Minimum 0.

404 Not Found

Employee not found.

422 Unprocessable Entity

Validation error.