---
title: "Orphan a user from their organization"
method: PATCH
path: "/users/{id}/orphan"
tags: ["Administration - Users"]
---

# Orphan a user from their organization

`PATCH /users/{id}/orphan`

Remove a user from their current organization and assign them orphan status.

This operation:
- Removes the user from their current organization
- Invalidates all current user roles
- Assigns the 'orphaned_user' role
- Preserves user account for potential future organization assignment

**Authentication Required**: Yes
**Permissions**: Administrative permissions required

**Use Cases**:
- User leaving an organization
- Administrative account cleanup
- Preparing user for organization transfer

**Warning**: This is a destructive operation that affects user access.

## Request body

- UserBasic
  - `id` integer
  - `first_name` string, required — User first name.
  - `last_name` string, required — User last name.
  - `referring_user` integer, nullable — User who referred this user.
  - `organization` integer, nullable — Organization to which the user belongs.
  - `files` FileJoin[]
    - `tag` string, nullable — User-generated tag(s) or desription.
    - `title` string, nullable — A user-generated title, such as exterior_front, exterior_rear, interior, basement, friends, headquarters, user manual, tornado path, furthest extent, etc. Note: file_files.title and location_locations.name are the default titles. However, this field allows the user to create their own title if it is shared. It may or may not be implemented.
    - `notes` string, nullable — Any user-specific notes, caption, or description for the file. Note: file_files.notes is the default captions. However, this field allows the user to create their own caption if they wish, e.g. if someone else shares it with them. It may or may not be implemented.
    - `created_at` string, date-time — Timestamp when the file was attached to the object.
    - `file_updated_at` string
    - `id` integer
    - `file` integer, nullable, required — The file.id of the file being attached to object_id.
    - `filename` string
    - `url` string
    - `full_url` string
    - `general_file_url` string
    - `blog_url` string
    - `large_blog_url` string
    - `large_thumbnail_url` string
    - `small_thumbnail_url` string
    - `filename_original` string
    - `file_type_t` string
    - `mime_content_type` string
    - `attr` string
    - `image_exif` string

## Response `200`

OK

- User
  - `id` integer
  - `email` string, email — User's email address (used for login and communications)
  - `first_name` string — User's first name
  - `last_name` string — User's last name
  - `organization` UserProfileOrganization — User's primary organization with complete affiliate information
    - `id` integer
    - `name` string, required — Name of the organization.
    - `is_active` boolean, nullable — Indicates whether the organization is active. If false, the organization and its users lose access to all incidents.
    - `roles` string — User-specific roles within this organization
    - `type_t` string, nullable — Translated string indicating the type of organization.
    - `affiliates` string — List of organization IDs that are direct affiliates of this organization
    - `all_affiliates_and_groups` string — Complete list of related organization IDs including affiliates and group members
    - `primary_location` integer, nullable — The primary area in which the organization operates, granting increased access to survivor data.
    - `secondary_location` integer, nullable — The secondary areas in which the organization operates, used for receiving alerts outside the primary working area.
  - `roles` integer[] — Roles associated with the user.
  - `active_roles` string — Approved active role IDs for this user
  - `pending_roles` string — Role IDs the user has requested but not yet been approved/rejected
  - `mobile` string, nullable — User cell phone number.
  - `social` object, nullable — Social media account information.
  - `lineage` integer[], nullable — Lineage of user IDs who referred the current user.
  - `states` string — Application state for the user etc map viewport, etc.
  - `preferences` object — User preferences and settings (write-only)
  - `internal_state` object, nullable — Internal state for limits, quotas, and admin-managed settings. Admin-only field.
  - `files` FileJoin[] — Files associated with the user (profile images, documents, etc.)
    - `tag` string, nullable — User-generated tag(s) or desription.
    - `title` string, nullable — A user-generated title, such as exterior_front, exterior_rear, interior, basement, friends, headquarters, user manual, tornado path, furthest extent, etc. Note: file_files.title and location_locations.name are the default titles. However, this field allows the user to create their own title if it is shared. It may or may not be implemented.
    - `notes` string, nullable — Any user-specific notes, caption, or description for the file. Note: file_files.notes is the default captions. However, this field allows the user to create their own caption if they wish, e.g. if someone else shares it with them. It may or may not be implemented.
    - `created_at` string, date-time — Timestamp when the file was attached to the object.
    - `file_updated_at` string
    - `id` integer
    - `file` integer, nullable, required — The file.id of the file being attached to object_id.
    - `filename` string
    - `url` string
    - `full_url` string
    - `general_file_url` string
    - `blog_url` string
    - `large_blog_url` string
    - `large_thumbnail_url` string
    - `small_thumbnail_url` string
    - `filename_original` string
    - `file_type_t` string
    - `mime_content_type` string
    - `attr` string
    - `image_exif` string
  - `primary_language` integer, nullable — Primary language of the user.
  - `secondary_language` integer, nullable — Secondary language of the user.
  - `referring_user` integer, nullable — User who referred this user.
  - `accepted_terms` boolean, nullable — Indicates whether the user has accepted the terms.
  - `accepted_terms_timestamp` string, date-time, nullable — Timestamp when the user accepted the terms.
  - `last_sign_in_at` string, date-time, nullable — Timestamp of the previous login.
  - `current_sign_in_at` string, date-time, nullable — Timestamp of the current login.
  - `sign_in_count` integer — Total number of times the user has logged in.

## Other responses

- `403` — Permission denied
- `404` — User not found

---

[API](https://skmtc.dev/crisiscleanup/apis/crisiscleanup-api.md) · [All operations](https://skmtc.dev/crisiscleanup/apis/crisiscleanup-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/crisiscleanup/crisiscleanup-api/revisions/3fa73d4b2895/schema)
