These docs are for v2.2022.0501. Click to read the latest docs for v2.2023.0501.

Deactivating/Reactivating an Employee

Deactivating/Reactivating an Employee

Deactivating an Employee

To deactivate a user use the DELETE /users endpoint to prevent the user from being able to log into 7shifts. The DELETE logic is a soft delete, it does not remove the user from the system and instead marks the user active = false. Please ensure you only call this endpoint when the user is truly deactivated in your system as it will prevent them from login into 7shifts.

You must read the available inactive reasons for a company before deactivating a user.

Request URL

curl --request GET --url 'https://api.7shifts.com/v2/company/1234/inactive_reasons'

Response body

{
    "data": [
        "rude_to_customers",
        "no_show_late",
        "quit",
        "theft",
        "substance_abuse",
        "maternity_leave",
        "went_back_to_school",
        "medical_or_personal_leave",
        "new_job_offer",
        "terminated_or_let_go",
        "adp_user_assignment",
        "pos_user_assignment",
        "other",
        "covid-19",
        "business_conditions",
        "company_seasonality",
        "covid_19_layoffs",
        "found_another_job",
        "going_back_to_school",
        "medical_personal_reasons",
        "poor_performance",
        "unacceptable_behaviour",
        "voluntary_resignation"
    ],
    "object": "inactive_reason_enum"
}

Here is an example DELETE request to deactivate an employee with ID 5252552:

Request URL

curl --request DELETE --url 'https://api.7shifts.com/v2/company/1234/users/5252552'

Request body

{
     "inactive_reason": "quit",
     "inactive_comments": "ADDITIONAL INFORMATION"
}

Refer to the endpoint GET Inactive Reason and DELETE User endpoints for more details on optional parameters to add sentiment about the departure/deactivation.

Activating an Employee

To activate and employee, setting the active field to true for a user will reactivate the user, and will allow them to log back into 7shifts using their old login credentials. This should also only be set when a user has been truly reactivated in your system, or it could allow ex-employees to log back into the 7shifts company.

Here is an example PUT request to activate an employee with ID 5252552:

NOTE: use the V1 /users endpoint. The active parameter will be included in the response payload for /users in V2 soon.

Request URL

curl --request PUT --url 'https://api.7shifts.com/v2/company/1234/users/5252552'

Request body

{
    "active": true
}