Home API How do you delete an employee via the API?

How do you delete an employee via the API?

Last updated on Apr 25, 2026

DELETE /v1/employees/{employeeId} deletes an employee within the tenant context. A successful response is 204 No Content.

Endpoint

Parameter Value
Method DELETE
Path /v1/employees/{employeeId}
Base URL https://smartway.pro/api
Auth Bearer token
Required scope employees.write

Purpose

This endpoint is used to delete an employee by employeeId.

The operation is performed within the tenant context from the Bearer token.

Prerequisites

  • The client must send a valid Bearer token.

  • The token must contain company context.

  • The token must contain the employees.write scope.

  • idCompany is not sent separately.

  • employeeId must belong to an employee within the current tenant.

Request

Path parameters

Parameter Type Required Description
employeeId int64 yes Employee ID.

curl example

Delete an employee

curl -X DELETE 'https://smartway.pro/api/v1/employees/4432' \
  -H 'Authorization: Bearer <access_token>' \
  -H 'Accept: application/json'

Response

Successful response: 204 No Content. A successful response has no body.

Response fields

Delete response

Element Type Description
HTTP status 204 No Content The operation completed successfully.
Response body absent No body is returned.

Business logic

  • The BFF takes companyId from the Bearer token, not from request parameters.

  • The endpoint deletes an employee only within the current tenant context.

  • Access requires the employees.write scope.

Edge cases

Edge cases

Scenario API behaviour
employeeId is not found in the current tenant The API returns 404 Not Found.
Bearer token without employees.write The API returns 403 Forbidden.
Operation is successful The API returns 204 No Content with no body.
The client sends idCompany The endpoint does not use idCompany from the client request.

Errors

Error responses

HTTP status When it occurs
401 Unauthorized Bearer token is missing or invalid.
403 Forbidden Insufficient permissions or token without company context.
404 Not Found Employee was not found within the current tenant.
500 Internal Server Error Unexpected BFF error.
503 Service Unavailable Internal integration failure BFF -> back2.

Usage

  • Delete an employee from LMS Smart Way through an integration.

  • Clear test records after integration testing.

  • Remove an employee who should no longer be in the employee dataset.

Common mistakes

Typical integration mistakes

Common mistake Correct approach
Expecting JSON in the response A successful response is 204 No Content with no body.
Sending idCompany Do not send idCompany; companyId is taken from the Bearer token.
Using a token without employees.write DELETE requires the employees.write scope.

FAQ

What does the API return after successful deletion?

204 No Content with no response body.

Do I need to send idCompany?

No. companyId is taken from the Bearer token.

What happens if employeeId is not found?

The API returns 404 Not Found.