---
title: "Remove a user from an app"
method: DELETE
path: "/apps/{id}/users/{userId}"
tags: ["Apps"]
---

# Remove a user from an app

`DELETE /apps/{id}/users/{userId}`

## Request

- Base URL: `https://api.hypamoon.com/api/v1`
- URL: `https://api.hypamoon.com/api/v1/apps/{id}/users/{userId}`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://app.hypamoon.com/oauth/authorize`, token URL `https://api.hypamoon.com/oauth/token`, scopes: `sites:write`)

The person can no longer sign in; open sessions stop within seconds. Without another app in the project their email address and name are deleted too. With delete_data=true everything of this person in the app goes as well (like DELETE /apps/{id}/users/{userId}/data); ask the owner of the app which they want.

## Path parameters

- `id` string, uuid, required
- `userId` string, uuid, required

## Query parameters

- `delete_data` boolean

## Response `200`

Removed, with delete_data=true: what was deleted.

- object: What was deleted.
  - `app_id` string, uuid, required
  - `user_id` string, uuid, required
  - `deleted` object, required
    - `rows` object, required: Per per-user table, the rows deleted.
    - `files` integer, required
    - `sessions` integer, required: Open sessions; they end within seconds.
    - `passkeys` integer, required
    - `membership` boolean, required
    - `account` boolean, required: true: the email address and name are gone too (no other app in this project knew the person).
  - `app_tables` 'included' | 'not_included' | 'no_database', required: included: the per-user tables (set_table_owner_column) were handled; unmarked_tables may still hold data. not_included: the app has no per-user tables, so no row of the app's own database was exported or deleted; check those tables yourself. no_database: the app has no database.
  - `unmarked_tables` string[], required: Tables that are not marked per-user: Hypamoon cannot tell which rows there belong to this user, so they may still hold data about them.
  - `note` string, nullable, required

## Other responses

- `204`: Removed; their data stays.
- `401`: Unauthorized: unauthorized, missing_api_key, invalid_api_key, api_key_revoked, project_deleted.
- `403`: Forbidden: project_not_enabled, key_mode_mismatch, missing_scope, verification_required.
- `404`: Not Found: not_found.
- `409`: Conflict: conflict.
- `422`: Unprocessable Content: validation_failed.
- `429`: Too Many Requests: rate_limited.
- `500`: Internal Server Error: internal_error.
- `503`: Service Unavailable: service_unavailable.

---

[API](https://skmtc.dev/hypamoon/apis/hypamoon-api.md) · [All operations](https://skmtc.dev/hypamoon/apis/hypamoon-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hypamoon/apis/hypamoon-api/revisions/9f0b90004c06?raw)
