---
title: "Update a User's Settings"
method: PATCH
path: "/users/{user_id}/settings/"
tags: ["Users"]
---

# Update a User's Settings

`PATCH /users/{user_id}/settings/`

Updates a user's settings, including email subscriptions, two-factor authentication setup, and account deactivation status.
Only the authenticated user can modify their settings.
## Editable Attributes

 - `two_factor_enabled` (boolean): Enables or disables two-factor authentication.
 - `two_factor_verification` (integer): Verification code for two-factor setup.
 - `subscribe_osf_general_email` (boolean): Subscribe/unsubscribe from OSF general communications.
 - `subscribe_osf_help_email` (boolean): Subscribe/unsubscribe from OSF help communications.
 - `deactivation_requested` (boolean): Request deactivation of your OSF account.

#### Returns
Returns the updated user's settings in a JSON object with a `data` key.
#### Errors
If the request is unsuccessful, an `errors` key containing information about the failure will be returned. Refer to the [list of error codes](#tag/Errors-and-Error-Codes).

## Path parameters

- `user_id` string, required

## Request body

- object
  - `data` object
    - `type` 'user-settings'
    - `id` string — The user ID for the settings update.
    - `attributes` object
      - `two_factor_enabled` boolean — Enable or disable two-factor authentication.
      - `two_factor_verification` integer — Verification code for two-factor authentication.
      - `subscribe_osf_general_email` boolean — Subscribe or unsubscribe from OSF general emails.
      - `subscribe_osf_help_email` boolean — Subscribe or unsubscribe from OSF help emails.
      - `deactivation_requested` boolean — Request deactivation of your OSF account.

## Response `200`

Successfully updated the user's settings.

## Other responses

- `400` — Bad request. This can occur if the two-factor verification code is invalid, or subscription values are incorrect.
- `403` — Permission denied. You do not have permission to update these settings.
- `404` — User not found.

---

[API](https://skmtc.net/osf/apis/osf-apiv2-documentation.md) · [All operations](https://skmtc.net/osf/apis/osf-apiv2-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/osf/osf-apiv2-documentation/versions/ca701048eb0d/schema)
