---
title: "Delete a sub-user"
method: DELETE
path: "/sub-users/{subUserId}"
tags: ["Sub-User Management"]
---

# Delete a sub-user

`DELETE /sub-users/{subUserId}`

## Request

- Base URL: `https://api.chat-data.com/api/v2`
- URL: `https://api.chat-data.com/api/v2/sub-users/{subUserId}`
- Auth: HTTP bearer

Delete a sub-user from the company. This also revokes any outstanding magic link or password setup tokens for the sub-user.

Requires the SSO Login add-on (see [plans](/pricing)) and a workspace API key; without the add-on, or with a chatbot-scoped key, the request gets a 403.

## Path parameters

- `subUserId` string, required

## Response `200`

Sub-user deleted successfully.

- object
  - `status` 'ok', required

## Other responses

- `400`: The workspace has no SSO company.
- `401`: Authentication failed: the `Authorization` header is missing or not in the `Bearer <key>` format, the API key does not exist, its workspace is unavailable or has no owner, or the workspace's plan does not include API access. `message` says which.
- `403`: The request used a chatbot-scoped API key (`This operation requires a user-level API key, not a chatbot-specific key`, with `status: error`), or the workspace does not have the SSO Login add-on (`SSO Login is unavailable with your current plan`, with no `status` field).
- `404`: `subUserId` is not a valid ID, or the company has no sub-user with this ID.
- `429`: The workspace sent more than 600 API requests in the last minute. Wait the number of seconds given in the `Retry-After` header (and in `message`) before retrying.
- `500`: An unexpected error occurred while processing the request; `message` contains the error.

---

[API](https://skmtc.dev/chat-data/apis/chat-data-api-schema-guide.md) · [All operations](https://skmtc.dev/chat-data/apis/chat-data-api-schema-guide/llms.txt) · [OpenAPI document](https://skmtc.dev/chat-data/apis/chat-data-api-schema-guide/revisions/72871007f7f0?raw)
