Delete User
Endpoint: https://api.adcyma.com/v1/api/user
Method: DELETE
Description: Offboards a user from your Entra ID tenant. This triggers Adcyma's full deprovisioning workflow: disabling the account, revoking group memberships, and running any employee leaving tasks you have configured. The action is queued and runs at the scheduled time, or right away if you don't specify one.
In most cases you only need to supply userPrincipalName. Adcyma fills in the user's name, job title, and department from the directory cache so audit logs and email templates render correctly. You can override these by passing them explicitly.
Request Headers:
- X-Company-ID: Your tenant identifier.
- X-Api-User: API username.
- X-Api-Key: API secret key.
- Content-Type:
application/json.
Request Body:
- userPrincipalName (required): UPN of the user to deprovision.
- date: Deprovisioning date in
YYYY-MM-DD(Stockholm time). Defaults to today. - time: Deprovisioning time in
HH:mm(Stockholm time). Defaults to17:00. - firstname: Override for the user's first name. Auto-filled from the directory cache when omitted.
- surname: Override for the user's last name. Auto-filled from the directory cache when omitted.
- jobTitle: Override for the user's job title. Auto-filled from the directory cache when omitted.
- department: Override for the user's department. Auto-filled from the directory cache when omitted.
Some HTTP clients drop the request body on DELETE by default. If you get a 400 Bad Request complaining about a missing userPrincipalName, check your client's settings and force it to send the body.
Example Request:
- HTTP
- Python
- PowerShell
DELETE /v1/api/user HTTP/1.1
Host: api.adcyma.com
X-Company-ID: AcmeAB-1f2c8a90
X-Api-User: integrations-bot
X-Api-Key: your-secret-key
Content-Type: application/json
{
"userPrincipalName": "john.doe@example.com",
"date": "2026-05-15",
"time": "17:00"
}
import requests
response = requests.delete(
"https://api.adcyma.com/v1/api/user",
headers={
"X-Company-ID": "AcmeAB-1f2c8a90",
"X-Api-User": "integrations-bot",
"X-Api-Key": "your-secret-key",
},
json={
"userPrincipalName": "john.doe@example.com",
"date": "2026-05-15",
"time": "17:00",
},
)
print(response.json())
$headers = @{
"X-Company-ID" = "AcmeAB-1f2c8a90"
"X-Api-User" = "integrations-bot"
"X-Api-Key" = "your-secret-key"
"Content-Type" = "application/json"
}
$body = @{
userPrincipalName = "john.doe@example.com"
date = "2026-05-15"
time = "17:00"
} | ConvertTo-Json
$response = Invoke-RestMethod `
-Uri "https://api.adcyma.com/v1/api/user" `
-Method DELETE `
-Headers $headers `
-Body $body
$response
Response:
On success, the deprovisioning task is queued. The account is disabled and the offboarding workflow runs at the scheduled time.
Success Response (200 OK):
{
"data": {
"message": "User deletion queued successfully"
}
}
Error Response (400 Bad Request):
{
"error": {
"code": "BAD_REQUEST",
"message": "Missing required field: userPrincipalName"
}
}
Error Response (401 Unauthorized):
{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API credentials"
}
}
Error Response (404 Not Found):
{
"error": {
"code": "NOT_FOUND",
"message": "User not found"
}
}
Error Response (429 Too Many Requests):
{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests"
}
}